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

Internal Server Error just for some CGIs

Quote Reply
Internal Server Error just for some CGIs
I have installed the Link 2.0 and found that the admin.cgi can work fine and build the pages properly but the following CGIs have 500 Internal Server Error:

add.cgi
modify.cgi
rate.cgi
subscribe.cgi
jump.cgi
search.cgi

I have make sure that the files are uploaded by ASCII mode and they are set into correct permissions (755). I have run the debugger (perl add.cgi -d) and it says no errors but cannot be run the scripts thru the telnet/shell account. Thus, it is so strange that it cannot be run through the web browser.
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
Did you check location of Perl

#!/usr/local/bin/perl
or
#!/usr/bin/perl
ect...

Did you put them in a different directory.
If they are not in

/cgi-bin/links/

you need to change:
require "admin/links.cfg";
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";

so they point to correct place.


The other way to check for errors is to run in Telnet:
perl -w add.cgi

Hope this helps

Eric
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
The scripts you describe all exist in the same directory. Since they work under Telnet, the obvious problem is that you have their paths incorrect in the links.cfg file. Correct that and you should be okay.

Dan Smile
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
The results from "perl -w add.cgi" indicate no 'fatal' errors. These errors may prevent Telnet execution of the scripts but not from the browser. So no real problem in the coding - BTW, did you alter the code (besides the path_to_perl) at all?

Have you tried reuploading the files (to ensure in ASCII)? Have you verified permissions are set to 0755 (rwxr_xr_x)?

But the problem still seems to do with incorrect paths.

Dan Smile
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
dan

Thank you for your help! However, I have uploaded the scripts again in ASCII and change the files to 755 mode.

All the cgi's perl path is also changed to #!/usr/bin/perl BUT it still having the 500 error!

I have tested it under telnet "perl add.cgi -d" and "perl add.cgi -w". But this time, no error message appear but just CGI error telling I cannot run those scripts under telnet. However, I run them in browser and they have 500 error message. Thus, I really don't know why this happens!

In fact, other than the links.cfg file, I have modified the site_html.pl and links.def files. However, I think they may not the reasons causing the 500 errors for

add.cgi
modify.cgi
rate.cgi
subscribe.cgi
jump.cgi
search.cgi

Thanks a lot!

Do you think my server is restricted me using the Links? I can run Links smoothly in the previous server! So strange! Frown

[This message has been edited by 227 (edited August 20, 1999).]
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
===============
TNT:
===============

My server doc says the perl is in
#!/usr/bin/perl but I leave it to #!/usr/local/bin/perl and the admin.cgi works fine, however I changed the add.cgi to #!/usr/bin/perl it also can't work, so this may not be the problem?!

When typing "perl -w add.cgi"
The following appear:

Ambiguous use of log => resolved to "log" => at add.cgi line 168.
Name "main::build_root_url" used only once: possible typo at add.cgi line 63.
Name "main::build_use_templates" used only once: possible typo at add.cgi line 3
3.
Name "main::db_mail_path" used only once: possible typo at add.cgi line 163.
Name "main::db_smtp_server" used only once: possible typo at add.cgi line 162.
Name "main::db_mailer_log" used only once: possible typo at add.cgi line 169.
Name "main::db_single_category" used only once: possible typo at add.cgi line 60
.
Name "main::db_modified" used only once: possible typo at add.cgi line 94.
Name "main::db_script_url" used only once: possible typo at add.cgi line 139.
Name "main::db_contact_email" used only once: possible typo at add.cgi line 137.
"my" variable $category masks earlier declaration in same scope at /www/227media
/site2/adm/site_html.pl line 684.
Use of uninitialized value at /www/227media/site2/adm/db_utils.pl line 572.
Use of uninitialized value at /www/227media/site2/adm/db_utils.pl line 575.
Content-type: text/html

<PRE>

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

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
ENV : /home/227media/.bashrc
HISTFILESIZE : 1000
HISTSIZE : 1000
HOME : /home/227media
HOSTNAME : thumos2.moreprofits.com
HOSTTYPE : i386
LOGNAME : 227media
LS_COLORS :
MAIL : /var/spool/mail/227media
OSTYPE : Linux
PATH : /usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bi
n:/usr/local/ssl/bin:/usr/local/java/bin:/usr/local/Hughes/bin:/usr/local/mysql/
bin:/usr/local/ssh/bin:/usr/spectro:.:/home/227media/bin
PS1 : \h:\w\$
PS2 : >
SHELL : /bin/bash
SHLVL : 1
SSLTOP : /usr/local/ssl
TERM : ansi
USER : 227media
USERNAME :
_ : /usr/local/bin/perl


Thus, I really don't get any idea about that... Frown

What's wrong with these?

===============
dan:
===============
I have double-checked the links.cfg file and it is correct! I just move the Links from my old server to the new hosting server, but I don't know why the Links don't work in the new server.



Thanks both your help but please help!

Do anyone can give me more idea about that?
Quote Reply
Re: Internal Server Error just for some CGIs In reply to
Hey, I found the answer, I had the same problem. The reason is possibly becuase you have your (assuming you have the files in cgi-bin/links/) links directory chmod wrong. Not the files in the directory but the actual folder. It must be chmoded to 755. That fixed all my problems with those cgi programs.