Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

500 Internal Server Error - Premature end of Script

Quote Reply
500 Internal Server Error - Premature end of Script
Hi, I have been trying to install Links 2.0 on my directory in the Hypermart server for the last couple of days, but have made little progress. What should I do next? Just to cover the basics, I confirmed the path to the PERL interpreter is correct, I FTP'ed the files in ASCII and chmoded them per the README.TXT but when I try to run the admin.cgi I get an error message [500] Error- Internal Server Error.

The following are: the error message, the top few lines from links.cfg and admin.cfg from my site.


Errors:
exec of /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed, reason: No such file or directory (errno = 2)
[Tue Mar 2 17:47:24 1999] access to /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed for 199.217.140.22, reason: Premature end of script headers
____________________________________________________________________

links.cfg (header chopped off)

=====================================================================
# Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/data1/hypermart.net/goodreferences/cgi-bin/links/admin";
$db_dir_url = "http://www.goodreferences.com/cgi-bin/links/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://www.goodreferences.com/cgi-bin/links/cgi-bin";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/data1/hypermart.net/goodreferences/cgi-bin/links/pages";
$build_root_url = "http://www.goodreferences.com/cgi-bin/links/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

# PATH and URL of What's Cool page. No Trailing slash.
$build_cool_path = "$build_root_path/Cool";
$build_cool_url = "$build_root_url/Cool";

# PATH and URL of What's Rating page. No Trailing slash.
$build_ratings_path = "$build_root_path/Ratings";
$build_ratings_url = "$build_root_url/Ratings";
__________________________________________________________________________
admin.cgi

#!/usr/local/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: admin.cgi
# Description: This is the administrative interface for the links program.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
# Required Librariers
# --------------------------------------------------------
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require 5.001; # Make sure we have at least perl 5.001.
require "/data1/hypermart.net/goodreferences/cgi-bin/links/cgi-bin/admin/links.cfg";
require "$db_lib_path/db.pl"; # Database Routines.
require "$db_lib_path/db_utils.pl"; # Database Support utilities.
require "$db_lib_path/admin_html.pl"; # Admin HTML routines.

};

if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}

# ========================================================
eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.
# ========================================================




[This message has been edited by Lyss (edited March 02, 1999).]
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
You have a period in your path. You need to follow the instructions in the FAQ at the top of the page to fix the error.
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
Thanks Bob,
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
I opened both FAQ's at the top of the page but there is no mention of the "period" problem. I tried taking the ".net" off hypermart.net but that did not help. I tried taking the "www." and the ".com" off of www.goodreferences.com" but that did not help either. Where is this errant period located? Also, I am mystified about the correct way to specify the path and URL in links.cfg Hypermart says the path to my root directory is /data1/hypermart.net/goodreferences
Normally my URL is www.goodreferences.com
Can you help?
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
You are reading the wrong FAQ I guess. Here is the link:

http://www.gossamer-threads.com/...oduct=Links&ww=1
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
Try changing "hypermart.net" to "hypermart\.net" in the paths, not the URLs. Let me know if that works.

------------------
Bob Connors
bobsie@orphanage.com
www.orphanage.com/goodstuff/


[This message has been edited by Bobsie (edited March 04, 1999).]
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
OK, I checked the FAQ - good info.
I modified the links.cfg as listed below - still get the same errors. Notice that the format of my paths and URL's are the same as those posted on this forum at:

http://www.gossamer-threads.com/scripts/forum/resources/Forum2/HTML/000416.html
http://www.gossamer-threads.com/scripts/forum/resources/Forum2/HTML/000419.html

Any other ideas?

Errors:
exec of /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed, reason: No such file or directory (errno = 2)
[Thu Mar 4 12:11:15 1999] access to /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed for 199.217.140.22, reason: Premature end of script headers


links.cfg (header stripped off)
______________________________________________________________
# Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin";
$db_dir_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/data1/hypermart.net/lyssmurphey/cgi-bin/links/pages";
$build_root_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

# PATH and URL of What's Cool page. No Trailing slash.
$build_cool_path = "$build_root_path/Cool";
$build_cool_url = "$build_root_url/Cool";

# PATH and URL of What's Rating page. No Trailing slash.
$build_ratings_path = "$build_root_path/Ratings";
$build_ratings_url = "$build_root_url/Ratings";




[This message has been edited by Lyss (edited March 04, 1999).]
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
I tried it but got the same errors:

Errors:
exec of /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed, reason: No such file or directory (errno = 2)
[Thu Mar 4 20:17:36 1999] access to /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed for 199.217.140.22, reason: Premature end of script headers

# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/data1/hypermart\.net/lyssmurphey/cgi-bin/links/cgi-bin/admin";
$db_dir_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/data1/hypermart\.net/lyssmurphey/cgi-bin/links/pages";
$build_root_url = "http://server10.hypermart.net/lyssmurphey/cgi-bin/links/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
Sorry to say, I think either Alex, Mark, or someone else from Hypermart is going to have to answer this one.
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
 
Quote:
exec of /data1/hypermart.net/lyssmurphey/cgi-bin/links/cgi-bin/admin/admin.cgi failed, reason: No such file or directory (errno = 2)

Your path to perl is wrong. I'm not sure what the proper path to perl for hypermart is, check Hypermart's CGI faq and set the first line of all .cgi files to the proper path to perl and that should fix it up.

Hope that helps,

Alex

Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
I faced this same problem, and i solved this by deleting the file admin.cgi, and used emacs to recreate new admin.cgi. (i used paste and copy from old file)

Unfortunately, the new file works! i guess that the old admin.cgi is binary type.

hope this helps too.

Pumin
MadMacs Inc.
Quote Reply
Re: 500 Internal Server Error - Premature end of Script In reply to
Thanks All!
For the record, the path to PERL was OK.
I must have uploaded admin.cgi in binary because I unzipped a fresh copy and FTP'ed into my directory without modification, chmod to 755 and it worked like a charm! On the the next error... Thanks Bobsie, Alex, and Pumin !