Alicia
08-26-2004, 05:22 AM
Hi,
i am trying to run the e-card cgi script but i encountered internal server error.. the file works fine in my other server but not this one..
this is what i have done :
- change the domain name to my new domain name
- chmod the cards folder to 777
- chmod the card.cgi file to 755
- change the first line of perl to correct path
a part of the code :
#!/usr/bin/perl
#set the line above this to your perl path. Usually fine as is
# or /usr/local/bin/perl /sbin/perl
# make certain that the first line stays the first line!
##################################################################
# (C)1998-9 Bignosebird.com cardcgi v2.0
# This software is FREEWARE! Do with it as you wish. It is yours
# to share and enjoy. Modify it, improve it, and have fun with it!
# It is distributed strictly as a learning aid and bignosebird.com
# disclaims all warranties- including but not limited to:
# fitness for a particular purpose, merchantability, loss of
# business, harm to your system, etc... ALWAYS BACK UP YOUR
# SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY
# SOURCE!
use Socket;
$|=1;
#### PROGRAM CONFIGURATION SECTION ############################
#
# Modify each item below to meet your needs.
#
# DAYS: number of days to keep cards before purging
# SMTP_SERVER: the name of the system acting as your sendmail gateway
# localhost should work on most systems.
# IF NOT- SET THE SEND_MAIL VARIABLE!
# BASEDIR is the unix directory that your greeting cards will
# be stored in.
# BASEURL is the URL (http address) of the directory your cards
# will be stored in.
# SITEURL is the home page URL for your site.
# SITENAME is the Name of your site, ie Title
# EXT is the ending name for your card files. NEVER, EVER USE shtml!!
# PROGNAME is the URL of THIS script.
# MAILLOG is a file name that you can capture e-mail addresses in
# FOR SECURITY REASONS: RENAME THIS FILE!!!!!!!!
# okaydomains are (if specified, the ONLY domains that the script
# can be run from. If left empty, anyone could run your script,
# but they wouldn't see any graphics!!! If your site answers to
# both www.domain.com and domain.com, then use both!
#@okaydomains=("http://myweb.org", "http://www.myweb.org");
$DAYS=15;
# USE EITHER SMTP OR SEND_MAIL DEPENDING ON YOUR SYSTEM-
# BUT NOT BOTH!
$SMTP_SERVER="localhost";
#$SEND_MAIL="/usr/lib/sendmail -t";
$BASEDIR="/home/myweb/public_html/cards";
$BASEURL="http://myweb.org/cards";
$SITEURL="http://myweb.org/";
$SITENAME="myweb.org";
$EXT=".html";
$PROGNAME="http://myweb.org/cgi-bin/card.cgi";
$MAILLOG="maillog";
$SUBJECT ="An e-card for you!";
###############################################################
&main_driver;
# follow by other code..
if i keep the value for #@okaydomains as myweb.com (which the script works on that previous hosting) without change it to my new domain name (myweb.net), i didn't get any internal error but it stop at here :
the code :
##################################################################
sub valid_page
{
if (@okaydomains == 0) {return;}
$DOMAIN_OK=0;
$RF=$ENV{'HTTP_REFERER'};
$RF=~tr/A-Z/a-z/;
foreach $ts (@okaydomains)
{
if ($RF =~ /$ts/)
{ $DOMAIN_OK=1; }
}
if ( $DOMAIN_OK == 0)
{ print "Content-type: text/html\n\n Sorry, cant run it from here....";
exit;
}
}
the browser shows " Sorry, cant run it from here..."
so i think the cause of the error is @okaydomains, is that so ??
please advise..
thanks.
i am trying to run the e-card cgi script but i encountered internal server error.. the file works fine in my other server but not this one..
this is what i have done :
- change the domain name to my new domain name
- chmod the cards folder to 777
- chmod the card.cgi file to 755
- change the first line of perl to correct path
a part of the code :
#!/usr/bin/perl
#set the line above this to your perl path. Usually fine as is
# or /usr/local/bin/perl /sbin/perl
# make certain that the first line stays the first line!
##################################################################
# (C)1998-9 Bignosebird.com cardcgi v2.0
# This software is FREEWARE! Do with it as you wish. It is yours
# to share and enjoy. Modify it, improve it, and have fun with it!
# It is distributed strictly as a learning aid and bignosebird.com
# disclaims all warranties- including but not limited to:
# fitness for a particular purpose, merchantability, loss of
# business, harm to your system, etc... ALWAYS BACK UP YOUR
# SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY
# SOURCE!
use Socket;
$|=1;
#### PROGRAM CONFIGURATION SECTION ############################
#
# Modify each item below to meet your needs.
#
# DAYS: number of days to keep cards before purging
# SMTP_SERVER: the name of the system acting as your sendmail gateway
# localhost should work on most systems.
# IF NOT- SET THE SEND_MAIL VARIABLE!
# BASEDIR is the unix directory that your greeting cards will
# be stored in.
# BASEURL is the URL (http address) of the directory your cards
# will be stored in.
# SITEURL is the home page URL for your site.
# SITENAME is the Name of your site, ie Title
# EXT is the ending name for your card files. NEVER, EVER USE shtml!!
# PROGNAME is the URL of THIS script.
# MAILLOG is a file name that you can capture e-mail addresses in
# FOR SECURITY REASONS: RENAME THIS FILE!!!!!!!!
# okaydomains are (if specified, the ONLY domains that the script
# can be run from. If left empty, anyone could run your script,
# but they wouldn't see any graphics!!! If your site answers to
# both www.domain.com and domain.com, then use both!
#@okaydomains=("http://myweb.org", "http://www.myweb.org");
$DAYS=15;
# USE EITHER SMTP OR SEND_MAIL DEPENDING ON YOUR SYSTEM-
# BUT NOT BOTH!
$SMTP_SERVER="localhost";
#$SEND_MAIL="/usr/lib/sendmail -t";
$BASEDIR="/home/myweb/public_html/cards";
$BASEURL="http://myweb.org/cards";
$SITEURL="http://myweb.org/";
$SITENAME="myweb.org";
$EXT=".html";
$PROGNAME="http://myweb.org/cgi-bin/card.cgi";
$MAILLOG="maillog";
$SUBJECT ="An e-card for you!";
###############################################################
&main_driver;
# follow by other code..
if i keep the value for #@okaydomains as myweb.com (which the script works on that previous hosting) without change it to my new domain name (myweb.net), i didn't get any internal error but it stop at here :
the code :
##################################################################
sub valid_page
{
if (@okaydomains == 0) {return;}
$DOMAIN_OK=0;
$RF=$ENV{'HTTP_REFERER'};
$RF=~tr/A-Z/a-z/;
foreach $ts (@okaydomains)
{
if ($RF =~ /$ts/)
{ $DOMAIN_OK=1; }
}
if ( $DOMAIN_OK == 0)
{ print "Content-type: text/html\n\n Sorry, cant run it from here....";
exit;
}
}
the browser shows " Sorry, cant run it from here..."
so i think the cause of the error is @okaydomains, is that so ??
please advise..
thanks.