Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI-BIN problems

Status
Not open for further replies.

greendot

ISP
Feb 22, 2005
1
US
Hi guys,

I know there are many existing threads on this, but i am not having any luck, a whole week flat out on this i cant figure it out. I was advised in another forum to try here.

I can't get Apache to execute a CGI script from anywhere except /var/ Below is parts of the httpd.conf
I can execute from but not from
I can load and execute html files from anywhere i configure it to look. But CGI can only execute from /var/
Apart from this file are there anyother files i need to look at. I have been through the includes conf.d/* and nothing there that could be overriding it.

I get 500 error, its seeing the script because if i rm test.cgi i get file not found. I've done 755 on the whole directory. The error log shows:

Tue Feb 22 11:45:12 2005] [error] [client 169.254.100.125] (13)Permission denied: exec of '/usr/lib/nagios/cgi/test.cgi' failed
[Tue Feb 22 11:45:12 2005] [error] [client 169.254.100.125] Premature end of script headers: test.cgi


Anyone please.. this is driving me mad....

Thanks in advance
Ash

Include conf.d/*.conf
User apache
Group apache

DocumentRoot "/var/<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory "/var/ Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


DirectoryIndex index.html index.html.var

ScriptAlias /cgi-bin/ "/var/<Directory "/var/ AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /nagios/cgi-bin/ "/usr/lib/nagios/cgi/"
<Directory "/usr/lib/nagios/cgi/">
AllowOverride None
Options ExecCGI
order deny,allow
allow from all
</Directory>

AddHandler cgi-script .cgi .pl
 
This could usually result in one of the following:

1) Access problems
- Check and make sure that the webserver/group have access to the file that you are executing from the top level all the way to the file.

2) Make sure that the program has the execute bit turned on.

ie:
chmod 755 test.cgi

3) If you are using perl or shell programming within the program make sure you are referencing the correct binaries from the O/S.

ie:
#!/usr/bin/perl

4) Try and execute the program from the command line and see what results you get back. If it even executes.



WarpZero Technologies
 
greendot,

Try changing

ScriptAlias /nagios/cgi-bin/ "/usr/lib/nagios/cgi/"
<Directory "/usr/lib/nagios/cgi/">
AllowOverride None
Options ExecCGI
order deny,allow
allow from all
</Directory>

to

order allow,deny

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top