#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0

    Exclamation


    I heavily modified a message board script available through Matt's Script archive for use on my friend's band's website (http://limestonemusic.com/).

    I think I altered something slightly and now the **** has hit the fan. I get an internal server error regardless of what I submit. An interesting thing to note is that when I run the scrip like this "perl wwwboard.pl" through telnet from the server, I get an HTML output that tells me that I have an error because I didn't submit anything (which is what should happen).

    I guess the best place to start would be, why isn't this error printing out in the web browser. Before you ask, yes, there is an appropriate header printed at the top of the HTML.

    Thanks
    David Frey
  2. #2
  3. Ole` Timer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    N.W. Iowa
    Posts
    472
    Rep Power
    15

    Thumbs up Always check your error_log


    If you have access to the server error_log file, that's the first place to check.

    You can add this simple line of code just below the shibang line in the script(path to Perl)

    Code:
    #!/usr/bin/perl
    ########################################
    BEGIN {
    open (STDERR, ">my_error.log");
    }
    ########################################
    # rest of script.
    Now when the script is executed it will produce an file and if an error occurs, the error is print to this file(the name can be want ever). If no error is produced, then it simple produces an empty file, and the script continues as normal.

    Or you can use the Carp to display errors:
    use CGI::Carp qw(fatalsToBrowser);

    Hope this helps

    Mickalo

    Thunder Rain Internet Publishing

    Custom Programming & Database development
    Providing Personal/Business
    Internet Solutions that work!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep Power
    0
    >>why isn't this error printing out in the web browser

    Because perl wwwboard.pl uses GET method which is different from pressing Submit button (POST method for wwwboard).

    >>I get an internal server error regardless of what I submit

    It's hard to tell without looking at your script. The first thing that comes in my mind is that, you specified the server path of some files in the wrong location.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0

    response


    I'll try the suggestions in the first post.
    Regarding the second post, I know it works with the POST method because I have been using it all along and it worked before.

    Thanks for the help
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    I tried both of the methods mentioned in the first reply. The first method:
    BEGIN {
    open (STDERR, ">my_error.log");
    }

    did not create a file and I just got the same internal server error message.

    The second method:
    use CGI::Carp qw(fatalsToBrowser);

    also didn't do anything. It just gave me the same internal server error.


    what is going on here???
  10. #6
  11. Ole` Timer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    N.W. Iowa
    Posts
    472
    Rep Power
    15
    Originally posted by slacker_x
    I tried both of the methods mentioned in the first reply. The first method:
    BEGIN {
    open (STDERR, ">my_error.log");
    }

    did not create a file and I just got the same internal server error message.

    The second method:
    use CGI::Carp qw(fatalsToBrowser);

    also didn't do anything. It just gave me the same internal server error.


    what is going on here???
    You might have to include a full server path to the "my_error.log" to a folder that has read/write access. If the script is in a "cgi-bin" the script may not be able to create/write to the this error file.

    Do you have access to your server's error log file??

    Thunder Rain Internet Publishing

    Custom Programming & Database development
    Providing Personal/Business
    Internet Solutions that work!
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    Whether or not I have access to the logs is questionable. You see when I telnet in, I am chrooted to the home directory. There is a folder called logs that contains 3 files. access_log error_log and xferlog. I tried taking a look at error_log, but it didn't really say anything specific. All it said was a date and time, the ip of the client, the file that caused the error and "premature end of script headers".

    I changed the code at the top of the script to:
    BEGIN {
    open (STDERR,">/home/livevic/public_html/limestone/my_error.log");
    }


    It still won't create a file in my home directory. Does the file have to be closed as well?

    I have made a copy of the perl script available for download from:
    http://www.limestone.livevictoria.com/wwwboard.txt

    you can also look at the actual message board by going to:
    http://www.limestone.livevictoria.com/wwwboard.html


    Thanks to everybody who has read this
  14. #8
  15. Ole` Timer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    N.W. Iowa
    Posts
    472
    Rep Power
    15
    A few problems noted. First is this setup as a sub domain off your master domain??

    Your variables:

    $basedir = "/home/livevic/public_html/limestone";
    $baseurl = "http://www.limestone.livevictoria.com";
    $cgi_url = "http://www.limestone.livevictoria.com/wwwboard.pl";

    $mesgdir = "";


    If this is a sub domain, drop the "www"'s off the URL's

    You haven't assigned the $mesgdir folder so the script can not create the messages.

    Besure the wwwboard.html main message page has read/write access. Ususally chmoded at 776 or 777

    The folders "limestone" and what ever the $mesgdir folder is , needs to also have worldwide read/write access.

    Make sure the data.txt file is chmoded 666

    Just areas to check off the top of my head I didn't think anyone was still using Wright's old WWWBoard script any more. Massive security holes in that script!

    Mickalo

    Thunder Rain Internet Publishing

    Custom Programming & Database development
    Providing Personal/Business
    Internet Solutions that work!
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    Before I pull out anymore hair trying to sort this message board out, what free alternatives are there. Free means no banners.


    thanks for your help
  18. #10
  19. Ole` Timer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    N.W. Iowa
    Posts
    472
    Rep Power
    15
    Well as far as free, there are quiet a few good free BBS programs out there, guess it all depends on what sort of BBS your looking for. Have you checked out HotScripts.Com


    Thunder Rain Internet Publishing

    Custom Programming & Database development
    Providing Personal/Business
    Internet Solutions that work!
  20. #11
  21. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    I'm looking at yabb. Does anybody have any thoughts or experience with this?
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    17
    Rep Power
    0
    Originally posted by slacker_x
    All it said was a date and time, the ip of the client, the file that caused the error and "premature end of script headers".
    you need to send your html headers before any output to the browser, the content-type is deffiantly needed

    print "Content-type: text/htmlnn"; before any output
  24. #13
  25. No Profile Picture
    PerlGuy
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Posts
    720
    Rep Power
    42
    Sometimes its as simple as making sure you have given the correct permissions for the file to accessed by outside browsers.
    - dsb -
    Perl Guy

IMN logo majestic logo threadwatch logo seochat tools logo