<?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>aproxacs &#187; selinux</title>
	<atom:link href="http://aproxacs.blog.qrobo.com/tag/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://aproxacs.blog.qrobo.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Jul 2009 23:07:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Passenger and SE linux</title>
		<link>http://aproxacs.blog.qrobo.com/2009/07/03/passenger-and-se-linux/</link>
		<comments>http://aproxacs.blog.qrobo.com/2009/07/03/passenger-and-se-linux/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 15:43:23 +0000</pubDate>
		<dc:creator>aproxacs</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://blog.aproxacs.com/2009/07/03/passenger-and-se-linux/</guid>
		<description><![CDATA[




Before passenger, it was a big issue to deploy rails appliation. We needed so many things to configure such as mogrel, mogrel cluster, and god. Now we just need a passenger and apache. It is as simple as PHP. What makes me more impressed is passenger is super easy to install. It uses gem system.
sudo [...]]]></description>
			<content:encoded><![CDATA[<!-- Easy AdSense V2.41 -->
<!-- Post[count: 3] -->
<div class="ezAdsense adsense adsense-leadin" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-5569204050478966";
/* 468x60, 작성됨 09. 3. 1 */
google_ad_slot = "7973811031";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Before passenger, it was a big issue to deploy rails appliation. We needed so many things to configure such as mogrel, mogrel cluster, and god. Now we just need a passenger and apache. It is as simple as PHP. What makes me more impressed is passenger is super easy to install. It uses gem system.</p>
<pre>sudo gem install passenger</pre>
<p>To install passenger as a apache module passenger-install-apache2-module command is used.</p>
<pre>passenger-install-apache2-module</pre>
<p>This command is very nice because it notifies me what to do next whenever there is a problem. And It shows apache configuration to set at the end. How nice!</p>
<p><a href="http://blog.aproxacs.com/files/2009/07/clip-image001.png"><img border="0" alt="clip_image001" src="http://blog.aproxacs.com/files/2009/07/clip-image001-thumb.png" width="628" height="501" /></a></p>
<h4>SE linux</h4>
<p>A week ago, I asked to set up a deploy environment with passenger and apache on fedora linux. I thought it would be a piece of cake at the first time, but I struggled all day. I installed passenger and configure apache settings and virtual hosts as always. After restarting apache, I found it failed. What’s wrong?</p>
<p>The folowing error occured. This error can be checked in <strong>/var/log/httpd/error_log</strong> file.</p>
<pre>[Thu Jul 02 17:53:03 2009] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Jul 02 17:53:03 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
*** Passenger ERROR (ext/common/ApplicationPoolServer.h:643):
Cannot execute /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/ApplicationPoolServerExecutable: Permission denied (13)</pre>
<p>A permission to execute passenger is denied. But permission is allowed to everybody if I check this file by ls command.</p>
<pre>-rwxr-xr-x. 1 root root 2528880 2009-07-02 17:35 /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/ApplicationPoolServerExecutable</pre>
<p><strong>This is thanks to the </strong><a href="http://en.wikipedia.org/wiki/Selinux"><strong>SELinux</strong></a><strong> policy</strong>. SELinux is Secure Enhanced linux. I am not explainig SE linux here. One thing I know is httpd is affected by the SE linux policy and this policy prevents passenger from executing. The easist way to avoid this is not to use SE Linux. One time command is </p>
<pre>setenforce Permissive</pre>
<p>If you want not to use it permanently, edit <strong>/etc/selinux/config</strong></p>
<pre>SELINUX=permissive</pre>
<p>If you have to keep using SE linux, there is <a href="http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">how-to in passenger documents</a>. I followed these steps once, but failed. It kept showing errors that it did not have a permission to create directory or sock. I stopped a little quickly, casue it was not that important to me. Wish you have a good luck and share me if you success.</p>
]]></content:encoded>
			<wfw:commentRss>http://aproxacs.blog.qrobo.com/2009/07/03/passenger-and-se-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
