Bug 33504 - ScriptAlias does not work
Summary: ScriptAlias does not work
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cgi (show other bugs)
Version: 2.0.52
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2005-02-10 22:39 UTC by bob teeter
Modified: 2007-08-07 07:33 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description bob teeter 2005-02-10 22:39:00 UTC
on apache 2.0.52 on fedora core 3 a ScriptAlias entry does not allow a script to
be run. It gives a Permission denied: exec of '/usr/local/nagios/sbin/test2.cgi'
failed.  The conf system cgi-bin is a follows:

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

My additional entry is as follows:
ScriptAlias "/nagios/cgi-bin/ "/usr/local/nagios/sbin/"
Options ExecCGI
AllowOverride None
Allow from all
Order allow,deny

Directories /usr, /usr/local, /usr/local/nagios, /usr/local/nagios/sbin
have been set to 777 and the file test1.cgi is set to 777

the test1.cgi file work just fine in /cgi-bin/  but when I copy it to
/nagios/cgi-bin/ I get the Permission denied error.

It appears that files in /cgi-bin/ work and others in /nagios/cgi-bin/ will not.


Bob Teeter
Comment 1 Rici Lake 2005-02-11 05:23:01 UTC
This is almost certainly a configuration problem. You should check your error log for specifics, as well 
as your suexec log.
Comment 2 Jeff Trawick 2005-02-12 03:45:07 UTC
If you have set permissions properly on the directories and files, then this has
something to do with Fedora security policy.  It isn't up to Apache to fail the
exec() call with EPERM.  That is the OS.
Comment 3 Joe Orton 2005-02-12 11:55:46 UTC
Specifically the SELinux policy - see
http://fedora.redhat.com/docs/selinux-apache-fc3/ or ask on
fedora-selinux-list@redhat.com - try

# chcon -R system_u:object_r:httpd_sys_script_exec_t /usr/local/nagios/sbin

to label the nagios scripts properly; more work will probably be needed though.
Comment 4 Ruediger Pluem 2007-08-06 13:27:41 UTC
Please specfiy new information what doesn't work for you if you apply the
comments below.
Comment 5 Joshua Slive 2007-08-07 07:33:26 UTC
I imagine this bug was reopened accidentally.