
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://selinuxproject.org/w/skins/common/feed.css?63"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://selinuxproject.org/w/?title=ApacheRecipes&amp;action=history&amp;feed=atom</id>
		<title>ApacheRecipes - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;action=history"/>
		<updated>2013-05-23T20:44:14Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.10.4</generator>

	<entry>
		<id>http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=1003&amp;oldid=prev</id>
		<title>Jaxelson: added category</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=1003&amp;oldid=prev"/>
				<updated>2010-08-31T18:28:52Z</updated>
		
		<summary type="html">&lt;p&gt;added category&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 18:28, 31 August 2010&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 46:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 46:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_use_cifs&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_use_cifs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;[[Category:Recipes]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jaxelson</name></author>	</entry>

	<entry>
		<id>http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=824&amp;oldid=prev</id>
		<title>MurrayMcAllister: text review</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=824&amp;oldid=prev"/>
				<updated>2009-11-25T10:35:48Z</updated>
		
		<summary type="html">&lt;p&gt;text review&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 10:35, 25 November 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 1:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 1:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;Apache is &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a &lt;/del&gt;very configurable &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;service and &lt;/del&gt;therefore there are many ways to confine it. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Here are some &lt;/del&gt;recipes to get &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you going in &lt;/del&gt;common configurations.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;The &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;is very configurable&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;; &lt;/ins&gt;therefore&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;there are many ways to confine it. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This page contains &lt;/ins&gt;recipes to get &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;started with &lt;/ins&gt;common configurations.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;= Labeling public_html correctly =&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;= Labeling &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;public_html &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;directory &lt;/ins&gt;correctly =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;The public_html directory in your user home directory already has correct labeling rules&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, however if &lt;/del&gt;you create &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;it&lt;/del&gt;, it may not be labeled correctly. Additionally, if you move files from your home directory they may not be labeled correctly. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;To &lt;/del&gt;relabel your public_html directory &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;run restorecon&lt;/del&gt;:&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;The public_html directory in your user home directory already has &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;correct labeling rules &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;in the system file contexts. This directory may or may not exist by default. If &lt;/ins&gt;you create &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;this directory&lt;/ins&gt;, it may not be labeled correctly. Additionally, if you move files from your home directory they may not be labeled correctly. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Use the restorecon command to &lt;/ins&gt;relabel your public_html directory:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[method@localhost ~]&lt;/del&gt;$ ls -Z &lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; $ ls -Z &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; drwxrwxr-x. method method system_u:object_r:user_home_t:s0 public_html&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; drwxrwxr-x. method method system_u:object_r:user_home_t:s0 public_html&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; &lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[method@localhost ~]&lt;/del&gt;$ restorecon -R public_html&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; $ restorecon -R public_html&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[method@localhost ~]&lt;/del&gt;$ ls -Z &lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; $ ls -Z &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; drwxrwxr-x. method method staff_u:object_r:httpd_user_content_t:s0 public_html&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; drwxrwxr-x. method method staff_u:object_r:httpd_user_content_t:s0 public_html&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;As &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you can see &lt;/del&gt;above, the directory was relabeled from user_home_t to httpd_user_content_t. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;The public_html &lt;/del&gt;directory should now be accessible &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;by &lt;/del&gt;Apache.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;As &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;shown &lt;/ins&gt;above, the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;public_html &lt;/ins&gt;directory was relabeled from user_home_t to httpd_user_content_t. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This &lt;/ins&gt;directory should now be accessible &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server&lt;/ins&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;= Allow Apache to connect to your database server =&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;= Allow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to connect to your database server =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;To allow Apache to connect to a MySQL or PostgreSQL &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;server &lt;/del&gt;enable the httpd_can_network_connect_db boolean&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;To allow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to connect to a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;database server, such as &lt;/ins&gt;MySQL or PostgreSQL&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;enable the httpd_can_network_connect_db boolean&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage boolean -m --on httpd_can_network_connect_db&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_can_network_connect_db&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [root@localhost ~]# &lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;= Allow Apache to run CGI scripts =&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;= Allow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to run CGI scripts =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Normally we don't want &lt;/del&gt;Apache &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;executing &lt;/del&gt;scripts &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;but some &lt;/del&gt;users &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;need &lt;/del&gt;Apache to execute CGI scripts. To &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;do &lt;/del&gt;this first enable the httpd_enable_cgi boolean&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Allowing the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server to execute &lt;/ins&gt;scripts &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;can be a security risk. Some &lt;/ins&gt;users &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;require the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to execute CGI scripts. To &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;allow &lt;/ins&gt;this&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;first enable the httpd_enable_cgi boolean&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage boolean -m --on httpd_enable_cgi&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_enable_cgi&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [root@localhost ~]#&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;If your CGI scripts are in the cgi-bin directory of your web root &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you &lt;/del&gt;are &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;done&lt;/del&gt;. If not you&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'ll &lt;/del&gt;need to label &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;those files as &lt;/del&gt;httpd_sys_script_exec_t&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;If your CGI scripts are in the cgi-bin directory of your web root&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, no more steps &lt;/ins&gt;are &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;required&lt;/ins&gt;. If &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;they are &lt;/ins&gt;not&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;you need to label &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the scripts with &lt;/ins&gt;httpd_sys_script_exec_t&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage fcontext -a -t httpd_sys_script_exec_t /var/www/html/path/to/my/cgi   &lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage fcontext -a -t httpd_sys_script_exec_t /var/www/html/path/to/my/cgi   &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# restorecon /var/www/html/path/to/my/cgi&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # restorecon /var/www/html/path/to/my/cgi&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;= Allow Apache to send mail =&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;= Allow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to send mail =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;To allow Apache to send mail enable the httpd_can_sendmail boolean&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;To allow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;Apache &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;HTTP Server &lt;/ins&gt;to send mail&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;enable the httpd_can_sendmail boolean&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage boolean -m --on httpd_can_sendmail&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_can_sendmail&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [root@localhost ~]# &lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Using an NFS or CIFS home directory =&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Using an NFS or CIFS home directory =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;For home directories on NFS enable the httpd_use_nfs boolean&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;For home directories on NFS&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;enable the httpd_use_nfs boolean&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage boolean -m --on httpd_use_nfs&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_use_nfs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [root@localhost ~]# &lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;For home directories on CIFS enable the httpd_use_cifs boolean&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;For home directories on CIFS&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;enable the httpd_use_cifs boolean&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[root@localhost ~]&lt;/del&gt;# semanage boolean -m --on httpd_use_cifs&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; # semanage boolean -m --on httpd_use_cifs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [root@localhost ~]#&lt;/del&gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MurrayMcAllister</name></author>	</entry>

	<entry>
		<id>http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=689&amp;oldid=prev</id>
		<title>JoshuaBrindle at 15:36, 29 September 2009</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=689&amp;oldid=prev"/>
				<updated>2009-09-29T15:36:42Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 15:36, 29 September 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 15:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 15:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to connect to your database server =&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to connect to your database server =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;To allow Apache to connect to a MySQL or PostgreSQL server enable the httpd_can_network_connect_db boolean.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage boolean -m --on httpd_can_network_connect_db&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to run CGI scripts =&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to run CGI scripts =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;Normally we don't want Apache executing scripts but some users need Apache to execute CGI scripts. To do this first enable the httpd_enable_cgi boolean.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage boolean -m --on httpd_enable_cgi&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]#&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;If your CGI scripts are in the cgi-bin directory of your web root you are done. If not you'll need to label those files as httpd_sys_script_exec_t.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage fcontext -a -t httpd_sys_script_exec_t /var/www/html/path/to/my/cgi   &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# restorecon /var/www/html/path/to/my/cgi&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to send mail =&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Allow Apache to send mail =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; To allow Apache to send mail enable the httpd_can_sendmail boolean.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage boolean -m --on httpd_can_sendmail&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Using an NFS or CIFS home directory =&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;= Using an NFS or CIFS home directory =&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;For home directories on NFS enable the httpd_use_nfs boolean.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage boolean -m --on httpd_use_nfs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;For home directories on CIFS enable the httpd_use_cifs boolean.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]# semanage boolean -m --on httpd_use_cifs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; [root@localhost ~]#&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JoshuaBrindle</name></author>	</entry>

	<entry>
		<id>http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=688&amp;oldid=prev</id>
		<title>JoshuaBrindle: Initial apache recipes page</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=ApacheRecipes&amp;diff=688&amp;oldid=prev"/>
				<updated>2009-09-29T15:15:20Z</updated>
		
		<summary type="html">&lt;p&gt;Initial apache recipes page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Apache is a very configurable service and therefore there are many ways to confine it. Here are some recipes to get you going in common configurations.&lt;br /&gt;
&lt;br /&gt;
= Labeling public_html correctly =&lt;br /&gt;
&lt;br /&gt;
The public_html directory in your user home directory already has correct labeling rules, however if you create it, it may not be labeled correctly. Additionally, if you move files from your home directory they may not be labeled correctly. To relabel your public_html directory run restorecon:&lt;br /&gt;
&lt;br /&gt;
 [method@localhost ~]$ ls -Z &lt;br /&gt;
 drwxrwxr-x. method method system_u:object_r:user_home_t:s0 public_html&lt;br /&gt;
 &lt;br /&gt;
 [method@localhost ~]$ restorecon -R public_html&lt;br /&gt;
 [method@localhost ~]$ ls -Z &lt;br /&gt;
 drwxrwxr-x. method method staff_u:object_r:httpd_user_content_t:s0 public_html&lt;br /&gt;
&lt;br /&gt;
As you can see above, the directory was relabeled from user_home_t to httpd_user_content_t. The public_html directory should now be accessible by Apache.&lt;br /&gt;
&lt;br /&gt;
= Allow Apache to connect to your database server =&lt;br /&gt;
&lt;br /&gt;
= Allow Apache to run CGI scripts =&lt;br /&gt;
&lt;br /&gt;
= Allow Apache to send mail =&lt;br /&gt;
&lt;br /&gt;
= Using an NFS or CIFS home directory =&lt;/div&gt;</summary>
		<author><name>JoshuaBrindle</name></author>	</entry>

	</feed>