PDA

View Full Version : Centos 4.2 CGI error


redhatlover
29th December 2005, 18:22
Hi,
I installed centos-4.2 in my system.
The problem is cgi script gives error message. The same cgi script is running with Centos-3.4 no problem at all.
Why? please help me

till
29th December 2005, 18:59
What is the exact error message you get?

redhatlover
29th December 2005, 20:49
Hi till,
this is my error message

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.52 (CentOS) Server at * * * * * * Port 80


BUT WHEN I RUN HELLO WORLD, It works fine no error message

#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "Hello, world!\n";

falko
29th December 2005, 23:06
Did you make the script executable? Is there anything in the Apache error log?

redhatlover
30th December 2005, 02:20
Did you make the script executable? Is there anything in the Apache error log?

Hi falko,
yes chmod 755 mail.cgi I did

Apache error log

no such file or directory exec of '/var/www/cgi-bin/'

falko
30th December 2005, 12:25
Does /var/www/cgi-bin exist, and did you put your file in there?

redhatlover
30th December 2005, 13:29
Does /var/www/cgi-bin exist, and did you put your file in there?

yes. my cgi scripts are there.

BUT WHEN I RUN HELLO WORLD, It works fine no error message

#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "Hello, world!\n";
----------------------------------------------
example list-modules.pl is not running. this script also give a error message.

falko
30th December 2005, 14:27
Can you post the output of ls -la /var/www?

redhatlover
30th December 2005, 14:51
Can you post the output of ls -la /var/www?

Hi Fllko

total 72
drwxr-xr-x 9 root root 4096 Dec 30 08:14 .
drwxr-xr-x 24 root root 4096 Dec 30 08:13 ..
drwxr-xr-x 2 root root 4096 Dec 30 08:44 cgi-bin
drwxr-xr-x 3 root root 4096 Dec 30 07:56 error
drwxr-xr-x 2 root root 4096 Dec 30 08:43 html
drwxr-xr-x 3 root root 4096 Dec 30 08:13 icons
drwxr-xr-x 13 root root 4096 Dec 30 07:56 manual
drwxr-xr-x 2 root root 4096 Dec 30 08:14 mrtg
drwxr-xr-x 2 webalizer root 4096 Dec 30 07:56 usage

falko
30th December 2005, 17:20
Maybe it's a problem with suExec? Can you run chown -R <Apache_user>:<Apache_group> /var/www/cgi-bin?

redhatlover
31st December 2005, 03:09
Hi Flako,
thanks for your helps.
I solved my problem.
I convert my cgi script to unix format. now is working.:)

The same cgi script working with centos 3.4 no problem.
but centos 4.2 not working.
you have any idea about this format problem?

falko
31st December 2005, 13:22
You mean you converted Windows linebreaks to Unix linebreaks? But then you should have gotten errors when running that script on the command line with Windows linebreaks...

redhatlover
31st December 2005, 15:34
You mean you converted Windows linebreaks to Unix linebreaks? But then you should have gotten errors when running that script on the command line with Windows linebreaks...

Hi Falko,
yes. I did dos2unix my.cgi