Hi everyone,
I am just learning Apache on CentOS6 and i am reading some guides and manual pages for it, and i have a question.
I am using VirtualHosts and i am just learning on how to execute CGI scripts and i just left the "Options None" under the <Directoy "/var/www/cgi-bin"> as it was in the default httpd.conf file. But i noticed that when i put a cgi script in the /var/www/cgi-bin directory and link it to my test page it runs (as long as the +x permission is set to others).
I also setup another virtualhost in another directory, /www/mytest and created a /www/cgi-bin directory also and placed my script in the /www/cgi-bin and linked it from my test page in /www/mytest and it ran the script, but the SELinux permissions on the /www/cgi-bin were unconfined_u
bject_r:httpd_sys_content_t and not httpd_sys_script_exec_t as i thought it should be.
My question is, why would the cgi script in /www/cgi-bin run without the proper SELinux permission on the folder?
And why would any script in /var/www/cgi-bin run when "Options None" is set instead of "Options +ExecCGI"?
Thank you for all the help.
If it helps, here is a snipplet from httpd.conf file
<Directory "/var/www/cgi-bin">
AllowOverRide None
Options None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin
test@myvhost.com
DocumentRoot /var/www/html/myvhost.com
ServerName myvhost.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin
admin@mytest.com
DocumentRoot /www/mytest
ServerName mytest.com
ScriptAlias /cgi-bin/ /www/cgi-bin/
</VirtualHost>