Oct 11, 2006
12
0
151
Hi

I have enterred correctly in the httpd.conf the cgi-bin script aliss
also set permissions of perl corrctly 755

i have also debugged correctly and the prog is not showing synatx error

yet when i take it on the browser it shows internal server error.
help?:mad:
 

[email protected]

Well-Known Member
Jul 9, 2005
78
0
156
Belgium
Hi

I have enterred correctly in the httpd.conf the cgi-bin script aliss
also set permissions of perl corrctly 755

i have also debugged correctly and the prog is not showing synatx error

yet when i take it on the browser it shows internal server error.
help?:mad:

1)is the path to perl correct ? (verry first line of the cgi script it should be something like #!/usr/bin/perl
2) to be sure about the perl path run which perl (it returns the correct path)

3) are you using SuExec ? then the cgi must be owned and in the group of the "apache" user (chmod 755 is correct but check the chgrp rights

Code:
cd /path/to/your_script
ls -la
this will show you a list of files in the defined directory and also show who owns the files ...

also don't forget your logs...

Code:
/etc/httpd/logs
tail error_log
this should at least give you a clue what is causing the problem
 

[email protected]

Well-Known Member
Jul 9, 2005
78
0
156
Belgium
ls -la shows file owned by root..
there's your problem you should not run CGI's as root in your httpd.conf where your vhost is defined you will see something like

Code:
user username
group groupname
you can also use this command to find out this information

Code:
grep "^User" /etc/httpd/conf/httpd.conf
(paths may be different on your server through enter the correct path to httpd.conf)

change the ownership of the cgi you want to run to that information

Code:
chown username:groupname file.cgi
 
Last edited:
Oct 11, 2006
12
0
151
Thanks its working now
i also changed the permission of cgi-bin to 755
i aslo changes the first line to #!/usr/bin/perl
now it works
but in my apache
which perl shows
/usr/local/bin/perl
 
Last edited: