hab hier Servercheckscript, der läuft irgendwie nicht.
Der Pfad ist wie unten eingestellt!
Habe das gezippte "XAMPP Windows 1.5.1" laufen.
Alle sicherheitseinstellungen von XAMPP sind eingestellt.
Habe WinXP Prof inkl. SP2.
- Code: Select all
#!\xampp\perl\bin\perl.exe
#################################
#
# K+B-Bestellsystem V2.3.2
# *Server-Check*
#
# (c)2004 by amensa EDV-Service
# Stefan Carstensen
#
# Infos www.xxxxxx.de
# Mail info@xxxxxx.de
#
#################################
use Socket;
use Config;
use Cwd;
require File::Find;
import File::Find;
$currentkbbversion = "2.3.2";
$produkt = "K+B-Bestellsystem";
$scriptname = 'servercheck.cgi';
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $input);foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;}@vars = split(/&/, $ENV{QUERY_STRING});
foreach $var (@vars) {($v,$i) = split(/=/, $var);
$v =~ tr/+/ /;
$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$i =~ tr/+/ /;$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$i =~ s/<!--(.|\n)*-->//g;$INFO{$v} = $i;}$action = $INFO{'action'};
$currentdir = getcwd();
######
if($action eq ""){
&start;
}
elsif ($action eq "check"){
✓
}
elsif ($action eq "check_mime"){
&checkmime;
}
elsif ($action eq "check_lwp"){
&checklwp;
}
elsif ($action eq "all_modules"){
&allmodules;
}
elsif ($action eq "module_info"){
&moduleinfo;
}
######
sub checkdata {
if ($^O !~ /win/i) {
foreach ("/bin/sendmail",
"/sbin/sendmail",
"/usr/bin/sendmail",
"/usr/lib/sendmail",
"/usr/share/sendmail",
"/usr/sbin/sendmail",
"/usr/bin/sendmail.restart",
"/etc/sendmail.cf",
"/etc/sendmail.cw",
"/usr/man/man8/sendmail.8",
"/var/qmail/bin/qmail-inject"){
if(-e $_ && -X _){
$sendmail .= "$_<br>";
}
}
if($currentperl eq "" && (-e("/usr/bin/perl"))) {
$currentperl = "/usr/bin/perl";
}
if($whois eq "" && (-e("/usr/bin/whois"))){
$currentwhois = "/usr/bin/whois";
}
##
if ($currentperl =~ /[a-z]/) {
$ok_perl = "ok";
} else {
$ok_perl = "not ok";
}
if ($sendmail =~ /[a-z]/) {
$ok_sendmail = "ok";
} else {
$ok_sendmail = "not ok";
}
if ($currentwhois =~ /[a-z]/) {
$ok_whois = "ok";
} else {
$ok_whois = "not ok";
}
foreach my $key (@INC) {
$INC .= "$key<br>";
}
######
sub module {
if($File::Find::name =~ /\.pm$/){
open(DATA,$File::Find::name) || return;
$p = 0;
while(<DATA>){
if(/^ *package +(\S+);/){
$module_name=$1;
$mod{$module_name}="?";
$p = 1;
}
if(/^.*?VERSION *= *('|"|\sv)?([\d.]+)((.*);|('|")?;)/i and $p){
if($2){$mod{$module_name}=$2;}
last;
}
}
close(DATA);
}
}
$mod_file = "1";
if($mod_file){
find(\&module, @INC);
@keys = sort { lc($a) cmp lc($b)} keys %mod;
foreach (@keys) {
$cpt++;
$mod{$_}='?' unless defined $mod{$_};
$modules .= qq~<font face="Arial" size="2"><a href="$scriptname?action=module_info&module=$_" target="_blank">$_</a></font> <font face="Arial" size="2">Version $mod{$_}</font><br>~;
$modulescount++;
}
}
##
foreach (sort { lc($a) cmp lc($b)} @INC){
chomp;
$modules .= $_ . "<br>";
}
##
}
}
######
sub moduleinfo {
print "Location: http://search.cpan.org/search?module=$INFO{'module'}\n\n";exit(0);
}
######
sub checkmime {
$checkmname = "MIME::Entity";
$mimefound .= qq~<h1><font color=green>Modul <a href="$scriptname?action=module_info&module=$checkmname" target="_blank">$checkmname</a> gefunden!</font></h1>~;
$mimenotfound .= qq~<h1><font color=red>Modul <a href="$scriptname?action=module_info&module=$checkmname" target="_blank">$checkmname</a> nicht vorhanden oder nicht richtig installiert!</font></h1>~;
eval { $died_in_eval = 1; require MIME::Entity; };
if ($@) {
print "Content-Type: text/html\n\n";
print "$mimenotfound";
}
else {
import MIME::Entity;
print "Content-Type: text/html\n\n";
print "$mimefound";
}
}
######
sub checklwp {
$checkmname = "LWP::Simple";
$lwpfound .= qq~<h1><font color=green>Modul <a href="$scriptname?action=module_info&module=$checkmname" target="_blank">$checkmname</a> gefunden!</font></h1>~;
$lwpnotfound .= qq~<h1><font color=red>Modul <a href="$scriptname?action=module_info&module=$checkmname" target="_blank">$checkmname</a> nicht vorhanden oder nicht richtig installiert!</font></h1>~;
eval { $died_in_eval = 1; require LWP::Simple; };
if ($@) {
print "Content-Type: text/html\n\n";
print "$lwpnotfound";
}
else {
import LWP::Simple;
print "Content-Type: text/html\n\n";
print "$lwpfound";
}
}
######
sub start {
print "Content-Type: text/html\n\n";
print<<"Html1";
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>..:: Server-Check K+B-Bestellsystem-V$currentkbbversion ::..</title>
</head>
<body bgcolor="#BFEFFF" style="font-family: Arial">
<div align="center">
<center>
<table border="2" cellspacing="0" width="519" bordercolor="#0054A8" bordercolorlight="#0054A8" bordercolordark="#0054A8">
<tr>
<td width="547">
<form action="$scriptname?action=check" method="post">
<table border="0" cellspacing="0" cellpadding="2" width="521" height="549">
<tr>
<td bgcolor="#003366" width="515" height="516" valign="top">
<p align="center"><font color="#FFFFFF" size="4"><b> <br>
</b></font><font size="4" color="#BFEFFF">
Server-Check $produkt-V$currentkbbversion</font><hr color="#FFFFFF" size="1">
<div align="center">
<table border="0" cellspacing="0" width="99%" cellpadding="0">
<tr>
<td width="100%" bgcolor="#0054A8">
<div align="center">
<table border="0" cellspacing="1" width="100%" height="424">
<tr>
<td width="100%" bgcolor="#BFEFFF" height="18"><b><font size="2">Info</font></b></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" height="398" valign="top"><font size="2">Mit
diesem Script können Sie ganz schnell prüfen, ob Ihr Server bereits über die Systemanforderungen
für unser Produkt <b> $produkt</b> verfügt.<br>
Um den Test zu starten, klicken Sie einfach unten auf <span style="background-color: #BFEFFF">
Server-Check starten! </span></font>
<p><font size="2"> Weitere Informationen zu unseren
Produkten finden Sie auf:</font></p>
<p align="center"><font size="2"> <a href="http://www.amensa-soft.de" target="_blank">http://www.amensa-soft.de</a></font></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<hr color="#FFFFFF" size="1">
<p align="center">
<font size="1"> </font><font color="#ffffff" size="1">© 2001-2004 by </font><a href="http://www.amensa-soft.de"><font color="#ffffff" size="1">amensa-soft.de</font></a>
</td>
</tr>
</center>
<center>
<tr>
<td bgcolor="#0054A8" align="center" width="515" height="25"><font size="2"><input type="submit" value="Server-Check starten!" style="background-color: #BFDFFF; border: 1 solid #003366"></font></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Html1
}
######
sub check {
&checkdata;
print "Content-Type: text/html\n\n";
print<<"Html2";
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>..:: Server-Check K+B-Bestellsystem-V$currentkbbversion ::..</title>
</head>
<body bgcolor="#BFEFFF" style="font-family: Arial">
<div align="center">
<center>
<table border="2" cellspacing="0" width="519" bordercolor="#0054A8" bordercolorlight="#0054A8" bordercolordark="#0054A8">
<tr>
<td width="547">
<form action="$scriptname" method="post">
<table border="0" cellspacing="0" cellpadding="2" width="521" height="152">
<tr>
<td bgcolor="#003366" width="515" height="261" valign="top">
<p align="center"><font color="#FFFFFF" size="4"><b> <br>
</b></font><font size="4" color="#BFEFFF">
Server-Check $produkt-V$currentkbbversion</font><hr color="#FFFFFF" size="1">
<div align="center">
<table border="0" cellspacing="0" width="99%" cellpadding="0">
<tr>
<td width="100%" bgcolor="#0054A8">
<div align="center">
<table border="0" cellspacing="1" width="507" height="295" cellpadding="3">
<tr>
<td width="499" bgcolor="#FFFFFF" colspan="3" height="18"><b><font size="2">Systemanforderungen</font></b></td>
</tr>
<tr>
<td width="128" bgcolor="#BFEFFF" height="18"><font size="2">Perl*</font></td>
<td width="268" bgcolor="#BFEFFF" height="18"><font SIZE="2">$currentperl</font></td>
<td align="center" bgcolor="#BFEFFF" height="18" width="91"><font size="2">$ok_perl</font></td>
</tr>
<tr>
<td width="128" bgcolor="#FFFFFF" height="18"><font size="2">Sendmail*</font></td>
<td width="268" bgcolor="#FFFFFF" height="18"><font size="2">$sendmail</font></td>
<td align="center" bgcolor="#FFFFFF" height="18" width="91"><font size="2">$ok_sendmail</font></td>
</tr>
<tr>
<td width="128" bgcolor="#BFEFFF" height="18"><font size="2">Whois*</font></td>
<td width="268" bgcolor="#BFEFFF" height="18"><font size="2">$currentwhois</font></td>
<td align="center" bgcolor="#BFEFFF" height="18" width="91"><font size="2">$ok_whois</font></td>
</tr>
<tr>
<td width="128" bgcolor="#FFFFFF" height="20"> </td>
<td width="268" bgcolor="#FFFFFF" height="20"> </td>
<td align="center" bgcolor="#FFFFFF" height="20" width="91"> </td>
</tr>
<tr>
<td width="128" bgcolor="#BFEFFF" height="18"><font size="2">MIME::Entity*</font></td>
<td width="268" bgcolor="#BFEFFF" height="18"><font size="2">
<a href="$scriptname?action=check_mime" target="_blank"><b><span style="letter-spacing: -2pt">>></span>Modul
jetzt prüfen<span style="letter-spacing: -2pt"><<</span></b></a></font></td>
<td align="center" bgcolor="#BFEFFF" height="18" width="91"><font size="2">?</font></td>
</tr>
<tr>
<td width="128" bgcolor="#FFFFFF" height="18"><font size="2">LWP::Simple**</font></td>
<td width="268" bgcolor="#FFFFFF" height="18"><font size="2"><a href="$scriptname?action=check_lwp" target="_blank"><b><span style="letter-spacing: -2pt">>></span>Modul
jetzt prüfen<span style="letter-spacing: -2pt"><<</span></b></a></font></td>
<td align="center" bgcolor="#FFFFFF" height="18" width="91"><font size="2">?</font></td>
</tr>
<tr>
<td width="499" colspan="3" height="65" valign="top" bgcolor="#BFEFFF">
<font size="1">* Muss ok sein </font>
<p><font size="1"> ** Modul ist optional </font></p>
</td>
</tr>
<tr>
<td width="499" bgcolor="#FFFFFF" colspan="3" height="18"><font size="2"><b>Informationen</b></font></td>
</tr>
<tr>
<td width="128" bgcolor="#BFEFFF" height="12"><font size="2">Modul-Verzeichnisse</font></td>
<td width="365" bgcolor="#BFEFFF" height="12" colspan="2"><font size="2">$INC</font></td>
</tr>
<tr>
<td width="128" bgcolor="#FFFFFF" height="28"><font size="2">Serverpfad
zur servercheck.cgi </font></td>
<td width="365" bgcolor="#FFFFFF" height="28" colspan="2"><font size="2">$currentdir</font></td>
</tr>
<tr>
<td width="128" bgcolor="#BFEFFF" height="12"><font size="2">Anzahl Module</font></td>
<td width="365" bgcolor="#BFEFFF" height="12" colspan="2"><font size="2">$modulescount Module
wurden gefunden<br>
<a href="$scriptname?action=all_modules" target="_blank"><b><span style="letter-spacing: -2pt">>></span>alle
Module anzeigen<span style="letter-spacing: -2pt"><<</span></b></a></font></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<hr color="#FFFFFF" size="1">
</td>
</tr>
</center>
<center>
<tr>
<td bgcolor="#003366" width="515" height="1" valign="top">
<p align="center"><font color="#ffffff" size="1">© 2001-2004 by </font><a href="http://www.amensa-soft.de"><font color="#ffffff" size="1">amensa-soft.de</font></a>
</td>
</tr>
<tr>
<td bgcolor="#0054A8" align="center" width="515" height="25"><font size="2"><input type=button value="zurück" style="background-color: #BFDFFF; border: 1 solid #003366" onclick="history.back()"></font></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Html2
}
######
sub allmodules {
&checkdata;
print "Content-Type: text/html\n\n";
print<<"Html3";
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<h2><font face="Arial" color="#C0C0C0">Folgende Module wurden gefunden</font></h2>
<script language="JavaScript">
var NS4 = (document.layers); // Which browser?
var IE4 = (document.all);
var win = window; // window to search.
var n = 0;
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
// Find next occurance of the given string on the page, wrap around to the
// start of the page if necessary.
if (NS4) {
// Look for match starting at the current point. If not found, rewind
// back to the first match.
if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;
// If not found in either direction, give message.
if (n == 0)
alert("Not found.");
}
if (IE4) {
txt = win.document.body.createTextRange();
// Find the nth match from the top of the page.
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
// If found, mark it and scroll it into view.
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
// Otherwise, start over at the top of the page and find first match.
else {
if (n > 0) {
n = 0;
findInPage(str);
}
// Not found anywhere, give message.
else
alert("Module not found!");
}
}
return false;
}
</script>
<form name="search" onSubmit="return findInPage(this.string.value);">
<input name="string" type="text" size=20 onChange="n = 0;">
<input type="submit" value="search">
</form>
$modules
Html3
};
Bekomme den Fehler:
- Code: Select all
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1 Server at localhost Port 80
Was verdammt nochmal mache ich falsch !??