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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.12658 seconds
  • Memory Usage 2,889KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates