SunQuest
           Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old January 24th, 2001, 12:46 AM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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

Reply With Quote
  #2  
Old January 24th, 2001, 08:14 AM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
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!

Reply With Quote
  #3  
Old January 24th, 2001, 08:19 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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.

Reply With Quote
  #4  
Old January 24th, 2001, 11:59 AM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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

Reply With Quote
  #5  
Old January 24th, 2001, 12:19 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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???

Reply With Quote
  #6  
Old January 24th, 2001, 12:39 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Quote:
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??

Reply With Quote
  #7  
Old January 24th, 2001, 05:57 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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:
URL

you can also look at the actual message board by going to:
URL


Thanks to everybody who has read this

Reply With Quote
  #8  
Old January 24th, 2001, 06:12 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
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

Reply With Quote
  #9  
Old January 24th, 2001, 07:35 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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

Reply With Quote
  #10  
Old January 24th, 2001, 07:39 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
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


Reply With Quote
  #11  
Old January 24th, 2001, 08:52 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm looking at yabb. Does anybody have any thoughts or experience with this?

Reply With Quote
  #12  
Old January 25th, 2001, 06:43 AM
ssert ssert is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 17 ssert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 40 sec
Reputation Power: 0
Quote:
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

Reply With Quote
  #13  
Old January 29th, 2001, 02:29 PM
dsb dsb is offline
PerlGuy
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Posts: 714 dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 15 h 44 m 20 sec
Reputation Power: 36
Send a message via AIM to dsb
Sometimes its as simple as making sure you have given the correct permissions for the file to accessed by outside browsers.
__________________
- dsb -
Perl Guy

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Trouble in CGI city


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |