Cgi script not working

Djunity

Verified User
Joined
Mar 9, 2008
Messages
243
Location
Holland
Hi all,

On a few new servers we are now running apache 2.4* version a new customer we had today uploaded a cgi script but it doesnt seem to work.

After a few hour looking and comparing it indeed doesnt work even a simple script like hello world doesnt work but you get redirected to the main url with ?500 added in the url

The hello world test script is like:
PHP:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";

When running from shell the script does work.

In the apache error logs ik see error messages like
[Mon Aug 05 22:06:06.507610 2013] [cgi:error] [pid 22920] [client 83.82.126.140:54069] End of script output before headers: hello.cgi

So what am i missing it looks like apache cant handle the scipts so does it need to be found in the vhosts or can it be some thing else mod_ruid2 perhaps ?
 
First check to be sure CGI scripts are turned on for that user/domain.

Then verify that the script is indeed named hello.cgi as with Linux and BSD filenames are case-sensitive.

And then try with a script named hello.pl. If that works, and heoo.cgi doesn't work, then the problem is that the 'cgi' isn't being accepted as a valid type.

Jeff
 
First check to be sure CGI scripts are turned on for that user/domain.
check

Then verify that the script is indeed named hello.cgi as with Linux and BSD filenames are case-sensitive.

And then try with a script named hello.pl. If that works, and heoo.cgi doesn't work, then the problem is that the 'cgi' isn't being accepted as a valid type.

Jeff

check

check

With .pl the result is the same as with .cgi
 
In addition i looked over the following error line:
[Wed Aug 07 18:50:59.623880 2013] [cgi:error] [pid 6837] [client 83.82.126.140:62473] AH01215: (13)Permission denied: exec of '/home/id00100/domains/domain.com/public_html/cgi-bin/hello.cgi' failed

I have compaired the chmod of this server agains another server where it is working (apache 2.2*) and /usr/bin/perl both have root:apache 0705
 
Check the permissions and ownership of all parts of the path /home/id00100/domains/domain.com/public_html/cgi-bin/hello.cgi.

Jeff
 
Check the permissions and ownership of all parts of the path /home/id00100/domains/domain.com/public_html/cgi-bin/hello.cgi.

Jeff

Hi Jeff,

I allready run
/usr/local/directadmin/scripts/set_permissions.sh user_homes
cgi-bin is id00100:id00100 0755 and hello.cgi is the same.

The issue is not only with this account / script but server wide.

This is a new server its running about 2 weeks was a fresh install default settings added mod_ruid2 true cb and added csf firewall but thats basicly it
 
In my humble opinion, someone needs to look at your server, but perhaps user smtalk will have an idea; it may have something to do with a botched mod_ruid2 install. Send a PM to smtalk and ask him to look at this thread.

Jeff
 
Back
Top