<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Diego Búrigo Zacarão's Weblog &#187; SELinux</title>
	<atom:link href="http://diegobz.net/category/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://diegobz.net</link>
	<description>Let me talk about something</description>
	<lastBuildDate>Mon, 01 Aug 2011 14:53:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Enabling apache UserDir (public_html) with SELinux enabled on Fedora</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/</link>
		<comments>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 20:11:28 +0000</pubDate>
		<dc:creator>diegobz</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://diegobz.net/?p=309</guid>
		<description><![CDATA[I do it barely and for me it&#8217;s kinda getting a headache every time I need to do it. I never remember exactly how it needs to be done. So here there are some steps in order to get a specific user using its home dir (usually ~/public_html/) with Apache. It will surely help me [...]]]></description>
			<content:encoded><![CDATA[<p>I do it barely and for me it&#8217;s kinda getting a headache every time I need to do it. I never remember exactly how it needs to be done. So here there are some steps in order to get a specific user using its home dir (usually ~/public_html/) with Apache. It will surely help me in the future and maybe it might help you too. <img src='http://diegobz.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ol>
<li>Edit the <strong><em>/etc/httpd/conf/httpd.conf</em></strong> file.<br />
Change the <strong><em>&#8216;UserDir disabled&#8217;</em></strong> line to <strong><em>&#8216;UserDir enabled &lt;username&gt;&#8217;</em></strong>.<br />
Uncomment the <em><strong>&#8216;UserDir public_html&#8217;</strong></em> line.<br />
Also uncomment the whole <em><strong>&#8216;&lt;Directory /home/*/public_html&gt;&#8217;</strong></em> section until the <em><strong>&#8216;&lt;/Directory&gt;&#8217;</strong></em>.</li>
<li>Apply the proper permissions:<br />
# chmod 711 ~&lt;username&gt;<br />
# chmod 755 -R ~&lt;username&gt;/public_html/</li>
<li>Run the following commands so SELinux wouldn&#8217;t bother you:<br />
# setsebool -P httpd_enable_homedirs true<br />
# chcon -R -t httpd_sys_content_t ~&lt;username&gt;/public_html   <em># It looks like it&#8217;s not necessary. See dgrift&#8217;s comments below.</em></li>
<li>Extra Tip: It looks like on PHP versions  &gt;= 5.3.0, to allow the short tag &#8216;&lt;?&#8217; we need to set <em><strong>&#8216;short_open_tag = On&#8217;</strong></em> in the <em><strong>/etc/php.ini</strong></em>.</li>
</ol>
<p>Restart the httpd service and after it you should be able to access http://localhost/~&lt;username&gt;/</p>
<p>References:<br />
<a href="http://fedoraproject.org/wiki/SELinux/apache" target="_blank">http://fedoraproject.org/wiki/SELinux/apache</a><br />
<a href="http://albertux.ayalasoft.com/2010/01/30/fedora-12-httpd-userdir-selinux-works/" target="_blank">http://albertux.ayalasoft.com/2010/01/30/fedora-12-httpd-userdir-selinux-works/</a><br />
<a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html" target="_blank">http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html</a></p>
<p>UPDATE 1: Altered <strong><em>&#8216;setsebool httpd_enable_homedirs true&#8217;</em></strong> into <strong><em>&#8216;setsebool -P httpd_enable_homedirs true&#8217;</em></strong>. Also added comment about the <strong><em>&#8216;chcon&#8217;</em></strong> command. Thanks, dgrift.</p>
]]></content:encoded>
			<wfw:commentRss>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

