<?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>Common Media, Inc. &#187; file permissions</title>
	<atom:link href="http://www.commonmediainc.com/tag/file-permissions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.commonmediainc.com</link>
	<description>Online Communities and Web Development</description>
	<lastBuildDate>Fri, 06 May 2011 15:10:43 +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>Phusion Passenger, permissions, and Rails&#8217; session store</title>
		<link>http://www.commonmediainc.com/2008/11/25/phusion-passenger-permissions-and-rails-session-store/</link>
		<comments>http://www.commonmediainc.com/2008/11/25/phusion-passenger-permissions-and-rails-session-store/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 21:16:18 +0000</pubDate>
		<dc:creator>pjmorse</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[phusion passenger]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.commonmediainc.com/?p=63</guid>
		<description><![CDATA[For various reasons, we&#8217;re moving three Rails apps hosted on one VPS to use Phusion Passenger rather than the Apache/Mongrel Cluster stack (via Coda Hale) we&#8217;ve been using since we got started. The Passenger installation process really is as easy as it&#8217;s been described, particularly if you&#8217;re as comfortable with Apache configuration as we are, [...]]]></description>
			<content:encoded><![CDATA[<p>For various reasons, we&#8217;re moving three Rails apps hosted on one VPS to use <a href="http://www.modrails.com/">Phusion Passenger</a> rather than the <a href="http://httpd.apache.org">Apache</a>/<a href="http://mongrel.rubyforge.org">Mongrel</a> Cluster stack (<a href="http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/">via Coda Hale</a>) we&#8217;ve been using since we got started.</p>
<p>The Passenger installation process really is <a href="http://www.modrails.com/videos/passenger.mov">as easy as it&#8217;s been described</a>, particularly if you&#8217;re as comfortable with Apache configuration as we are, but by moving responsibility for serving your apps from Mongrel to Apache, file and process ownership becomes an issue in a way it wasn&#8217;t when Mongrel and Apache talked to each other and otherwise minded their own stores. <a href="http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/">Ben Hughes hinted at this in his walk-through</a> of the Passenger installation, and we were not immune.</p>
<p>Our problem turned out to be session files. The first application we moved to Passenger (and it&#8217;s worth noting that apps running on Passenger and apps running Mongrel cluster can coexist under the same Apache) was <a href="http://www.redmine.org/">Redmine</a>, which uses file-based session store by default. If ownership of those session files creates a problem, and it did for us, <a href="http://wiki.rubyonrails.com/rails/pages/HowtoChangeSessionStore">switching to ActiveRecord session storage</a> resolves the problem.</p>
<p>For those wondering about the point of Passenger, it&#8217;s memory use. A single Mongrel instance and an app running under Passenger have comparable RAM requirements, but because Passenger is an Apache module, it can spawn new instances as requests arrive; the Mongrel cluster solution requires multiple mongrel instances to be running <em>all the time</em>. This means Mongrel apps essentially require the RAM for peak capacity <em>all the time</em>. Passenger gives that RAM back at non-peak times, which allows more apps to share the same system, allowing us to get more mileage from our VPSes. (It&#8217;s worth noting that the Phusion guys claim a 33% memory savings per instance if <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a> is also used, so that will probably be our next step when all the apps are Passenger-ized.)</p>
<p><strong>Update, 12/10:</strong> Another gotcha we found was file permissions. Again because of the permissions issues, Rails wasn&#8217;t writing to the <code>shared/logs/production.log</code> file. We didn&#8217;t notice this immediately, because the applications ran, they just didn&#8217;t log anything. The solution here was to change the ownership and permissions on the files. Specifically, we changed <em>group</em> ownership to &#8220;nobody&#8221; (the group Apache runs under) and the mode of the log file to 664.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.commonmediainc.com/2008/11/25/phusion-passenger-permissions-and-rails-session-store/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.modrails.com/videos/passenger.mov" length="18988364" type="video/quicktime" />
		</item>
	</channel>
</rss>

