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

HTTP 500 Error on admin/admin.cgi

Quote Reply
HTTP 500 Error on admin/admin.cgi
I'm trying to install Links but until now my sucess is very low.

When I try to run in browser "http://www.togrc.com/cgi-bin/links/admin/admin.cgi", I get a "HTTP 500 error".

I did a "perl -c" on both links.cfg and admin.cgi, it doesn't return any error.

What could be wrong?


Here is my links.cfg :
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/big/dom/xtogrc/cgi-bin/links/admin";
$db_dir_url = "http://www.togrc.com/cgi-bin/links/admin";

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

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/big/dom/xtogrc/www/bguilds/links";
$build_root_url = "http://www.togrc.com/bguilds/links";

# 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";


Here is my directory structure :

under cgi-bin :
drwxr-xr-x 3 1024 Mar 7 11:37 links/

under links :
-rwxr-xr-x 1 6087 Mar 7 11:37 add.cgi*
drwxr-xr-x 7 1024 Mar 7 11:50 admin/
-rwxr-xr-x 1 4878 Mar 7 11:37 jump.cgi*
-rwxr-xr-x 1 6893 Mar 7 11:37 modify.cgi*
-rwxr-xr-x 1 4217 Mar 7 11:37 rate.cgi*
-rwxr-xr-x 1 11671 Mar 7 11:37 search.cgi*
-rwxr-xr-x 1 4812 Mar 7 11:37 subscribe.cgi*

under cgi-bin/links/admin :
drwxr-xr-x 2 1024 Mar 7 11:36 HTML/
drwxr-xr-x 3 1024 Mar 7 11:36 LWP/
-rw-r--r-- 1 12275 Mar 7 11:37 Mailer.pm
-rw-r--r-- 1 4668 Mar 7 11:37 Template.pm
-rw-r--r-- 1 3314 Mar 7 11:37 Validator.pm
-rwxr-xr-x 1 2658 Mar 7 17:13 admin.cgi*
-rwxr-xr-x 1 71022 Mar 7 11:37 admin_html.pl*
drwxr-xr-x 2 1024 Mar 7 11:36 backup/
-rw-r--r-- 1 3191 Mar 7 11:37 category.def
drwxr-xr-x 4 1024 Mar 7 11:36 data/
-rwxr-xr-x 1 37892 Mar 7 11:37 db.pl*
-rwxr-xr-x 1 23351 Mar 7 11:37 db_utils.pl*
-rw-r--r-- 1 10387 Mar 7 17:08 links.cfg
-rw-r--r-- 1 4777 Mar 7 11:37 links.def
-rwxr-xr-x 1 47765 Mar 7 11:37 nph-build.cgi*
-rwxr-xr-x 1 7488 Mar 7 11:37 nph-email.cgi*
-rwxr-xr-x 1 9721 Mar 7 11:37 nph-verify.cgi*
-rwxr-xr-x 1 37114 Mar 7 11:36 site_html.pl*
-rwxr-xr-x 1 16354 Mar 7 11:37 site_html_templates.pl*
drwxr-xr-x 2 1024 Mar 7 11:35 templates/

under cgi-bin/links/admin/data :
-rw-rw-rw- 1 0 Mar 7 11:36 categories.db
-rw-rw-rw- 1 1 Mar 7 11:36 categoryid.txt
-rw-rw-rw- 1 0 Mar 7 11:36 email.db
drwxrwxrwx 2 1024 Mar 7 11:36 hits/
-rw-rw-rw- 1 0 Mar 7 11:36 links.db
-rw-rw-rw- 1 1 Mar 7 11:36 linksid.txt
-rw-rw-rw- 1 0 Mar 7 11:36 modified.db
drwxrwxrwx 2 1024 Mar 7 11:36 rates/
-rw-rw-rw- 1 0 Mar 7 11:36 url.db
-rw-rw-rw- 1 0 Mar 7 11:36 validate.db

under /www/bguilds : (renamed from Pages)
drwxr-xr-x 2 1024 Mar 7 11:39 links/

under /www/bguilds/links :
total 7
-rw-r--r-- 1 38 Mar 7 11:39 background.gif
-rw-r--r-- 1 5990 Mar 7 11:39 links.css

Thanks,

Moonlight
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
1) Check your Perl Path in the admin.cgi file.

2) Make sure that you have the COMPLETE PATH to your links.cfg file in the require line, like the following:

Code:
require ""/big/dom/xtogrc/cgi-bin/links/admin/links.cfg";

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
I tried your suggestion and it's not working.

The path is correct, I triple-checked it.

I even re-saved all the files in Unix format to make sure it isn't because the returns are in PC format.

Do you have any other solutions?

When I try to run the admin.cgi from a Telnet session, I get the following :

CGI ERROR
==========================================
Error Message : You cant run this script from telnet/shell.
Script Location : ./admin.cgi
Perl Version : 5.00404

Do you have any other solutions?

I never had any problems with any CGI files so I do not know what could be wrong.

Moonlight
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
Yea...The error message plainly states that you cannot execute the admin.cgi file via telnet...It has to be executed via your web browser!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
I know. I just wanted to point out that it seems to be doing the "requires" part correctly since I would have gotten the missing required file error.

When I try from the browser, I get the HTTP 500 error.

Moonlight
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
Well, then check the syntax of the file, with the following commands via telnet:

1) At the command prompt, type in the following command:

Code:
cd /big/dom/xtogrc/cgi-bin/links/admin

2) Check the syntax with the following command:

Code:
perl -c admin.cgi

Then copy the error message you receive in this Topic.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
Here is the result :

[moonlight@FQ-Taz:/big/dom/xtogrc/cgi-bin/links/admin ]$ perl -c admin.cgi
admin.cgi syntax OK

Moonlight
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
Well, since the Perl Path is correct, your file permission is correct, the path to the links.cfg is correct, you have tried executing the file via your web browser, and there are no syntax error...I would suggest contacting your Hosting Company for assistance.

These are the only things I can think of.

Good luck.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
I figured what was wrong.

I created an .htaccess file to restrict access to that directory by an IP Address.

When I remplaced the .htaccess to use an User ID/Password, the script worked fine.

I don't understand why it was giving me the HTTP 500 error with the first .htaccess since it's the same .htaccess that I use for other directories (non-CGI) and I have no problems. Probably by denying all, I'm denying the server to access the script.

Thanks for your time, I would never thought an .htaccess would do so much problems,

Moonlight
Quote Reply
Re: HTTP 500 Error on admin/admin.cgi In reply to
.htaccess is a dangerous file! Smile If you do not use it properly, it can really screw up your web site. Be careful with it!

Glad you figured it out.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums