dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: internal server error

  1. #1
    Join Date
    Nov 2003
    Posts
    95

    internal server error

    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.

  2. #2
    Join Date
    Mar 2004
    Posts
    282
    @okaydomains never gets set becuase it's commented out.

    remove the "#" in front of @okaydomains.

  3. #3
    Join Date
    Nov 2003
    Posts
    95
    Hi,

    I have tried to remove the # but it is still not working,,, any other suggestion ?

    please advise.

  4. #4
    Join Date
    Mar 2004
    Posts
    282
    Why aren't you using strict? put "use strict;" somewhere at the top of your script. That will force you to code *strictly*. Calling this pragma will also warn you of mistakes in your code. You may also want to throw in "use CGI::Carp qw(fatalsToBrowser);" this will spit out those ugly error messages to the browser for you.

  5. #5
    Join Date
    Nov 2003
    Posts
    95
    thanks for ur suggestion silent, but i am very new to perl.. i dun really get what is the functions you mentioned.

    i am wondering why it works fine on one server but not another =(

  6. #6
    Join Date
    Jan 2003
    Location
    USA
    Posts
    687
    ...do you have a "live" link to the ecard form page?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles