View previous topic :: View next topic |
Author |
Message |
Karasu Kami -
Joined: 22 Sep 2003 Posts: 712 Location: Colorado
|
Posted: Thu Jul 08, 2004 1:29 am Post subject: CGI isn't executing again. |
|
|
Well, after i finally get everything working again, the CGI script that shows if my server is online or offline isn't executing.
Here's the code.
Code: | #!/usr/bin/perl
#################################################################################################
#Abax Server Status v1.05, Copyright 2003 By Nathan Dickman, visit http://www.NathanDickman.com/#
#This script may be freely distributed providing all copyright headers are kept intact. #
#Last Updated: 26 September 2003 17:38 #
#################################################################################################
use CGI::Carp qw(fatalsToBrowser);
use LWP::UserAgent;
use HTTP::Cookies;
#Abax Server Status configuration#
#Change the two image locations to the path on your own webserver#
$live = 'http://67.176.95.30/live.gif';
$dead = 'http://67.176.95.30/dead.gif';
#Below is the list of sites that are allowed to call the server status script#
#Leave 'allowedsites blank' if you want anyone to be able to call your script#
@allowedsites = ('');
#DO NOT CHANGE BELOW THIS LINE#
#Check that the call to the script is valid#
local($securitycheck) = 0;
if ($ENV{'HTTP_REFERER'}) {
foreach $allowedsites (@allowedsites) {
if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$allowedsites|i) {
$securitycheck = 1;
last; }
}
}
else {$securitycheck = 1;}
if ($securitycheck != 1) {
print "Location: $dead\n\n";
exit;
}
#Create user agent and send it out#
$ua = new LWP::UserAgent;
$ua->agent("Natbyte/v1.04");
$ua->cookie_jar( HTTP::Cookies->new( file => "cookies.log", autosave=> 1 ));
$ua->timeout(35);
$ua->max_size(6000);
$request = new HTTP::Request('GET', $ENV{'QUERY_STRING'});
$result = $ua->request($request);
if ($result->is_success) {$website = $result->content;}
@website = split(/\n/,$website);
foreach $line (@website) {
if ($line =~ /html|body|title|font/i) {$content = "true";}
if ($line =~ /VeriSign |sitefinder/i) {print "Location: $dead\n\n"};
}
if ($content eq "true") {
print "Location: $live\n\n";
exit;
}
else {
print "Location: $dead\n\n";
exit;
} |
That's the actual script, heres the cgi link to show if it's on or off by calling the picture.
Code: | <table border="0" width="40%">
<tr><!-- Row 1 -->
<td>Paeon Anoma Server: </td><!-- Col 1 -->
<td><img src="http://67.176.95.30/serverstatus.cgi?http://www.paeon-hosting.com/" width="37" height="20"></td><!-- Col 2 -->
</tr>
</table> |
I doubt there's anything wrong with the actual code, it's most likely the server/ and or the php configuration.
Can someone help me, again? -.- _________________ Thank you all. Aprelium most importantly.
*Some may not be complete*
http://paeon-hosting.com
http://quartermoon.info
http://loc.paeon-hosting.com
http://genjipoetry.paeon-hosting.com |
|
Back to top |
|
|
Axis -
Joined: 29 Sep 2003 Posts: 336
|
Posted: Thu Jul 08, 2004 4:34 am Post subject: |
|
|
Hi Karasu Kami--
You wrote "I doubt there's anything wrong with the actual code, it's most likely the server/ and or the php configuration.."
This is a perl script, not a php script. Do you have perl installed and do you have abyss pointing to your interpreter? I am not sure if "php" was a slip of the tongue/keyboard or if you were trying to run this through a php interpreter.
What kind of error message do you get when the script attempts to execute?
Regards,
Axis |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Jul 08, 2004 3:05 pm Post subject: Re: CGI isn't executing again. |
|
|
Karasu Kami,
Have you installed Perl support in Abyss? Is the script file name extension associated with Perl? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Karasu Kami -
Joined: 22 Sep 2003 Posts: 712 Location: Colorado
|
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Jul 11, 2004 7:16 pm Post subject: |
|
|
Karasu Kami,
Do you mean that the script is executed (without any error message) but doesn't behave as expected? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|