Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-22-2012, 05:13 PM   #1
LQ Newbie
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
Question Apache and cgi scripts - Confused?

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_ubject_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

<VirtualHost *:80>
DocumentRoot /var/www/html/

<VirtualHost *:80>
DocumentRoot /www/mytest
ScriptAlias /cgi-bin/ /www/cgi-bin/

Last edited by emdcyco; 09-22-2012 at 05:17 PM.
Old 09-23-2012, 11:45 AM   #2
LQ Newbie
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Anybody? This is really confusing me


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant seem to run any cgi scripts in cgi-bin folder, confused? j.smith1981 Linux - Server 5 02-14-2011 06:38 AM
Apache 2.0.52 and CGI scripts ZC1 Linux - General 3 05-18-2006 02:21 PM
Cant run CGI scripts on Apache! mylo2003 Linux - General 5 11-09-2004 10:22 AM
configuring apache for cgi scripts ash_r_c Linux - Software 1 09-23-2003 05:03 PM
Apache cgi scripts! boyinfrance Linux - Newbie 2 06-22-2002 11:33 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration