<?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>Ares Saldaña</title>
	<atom:link href="http://ares.im/feed" rel="self" type="application/rss+xml" />
	<link>http://ares.im</link>
	<description></description>
	<lastBuildDate>Sun, 08 Jan 2012 23:31:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Configuring Apache to use a Dropbox folder as a DocumentRoot (Mac OS X)</title>
		<link>http://ares.im/configuring-apache-to-use-a-dropbox-folder-as-a-documentroot-mac-os-x/tech-tips</link>
		<comments>http://ares.im/configuring-apache-to-use-a-dropbox-folder-as-a-documentroot-mac-os-x/tech-tips#comments</comments>
		<pubDate>Sun, 08 Jan 2012 23:27:13 +0000</pubDate>
		<dc:creator>Ares</dc:creator>
				<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://ares.im/?p=5</guid>
		<description><![CDATA[I&#8217;ve been using dropbox for a few years now and I find it to be a terrific tool, specially if you have more than one workstation. I just got a new machine for the office and still have a laptop that I use to work on the go or at home. So being able to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-6" title="dropbox-logo" src="http://ares.im/wp-content/uploads/2012/01/dropbox-logo.jpg" alt="" width="200" height="186" />I&#8217;ve been using <a href="http://db.tt/DeqHbTm">dropbox</a> for a few years now and I find it to be a terrific tool, specially if you have more than one workstation.</p>
<p>I just got a new machine for the office and still have a laptop that I use to work on the go or at home. So being able to not worry when I leave the office about if I should take some files with me it&#8217;s very important and relaxing.</p>
<p>So, since I do a lot of web development it was normal to me that I should use a Dropbox folder my apache DocumentRoot, and since every time I get a new machine I spend 30 mins figuring out how to make it work I decided to make this little guide.</p>
<p>In my setup I am using ~/Dropbox/Sites as my document root, but feel free to change it to whatever fits better your needs.</p>
<p>Okay, the first thing we have to do is to specify  the new DocumentRoot directory. So open up a terminal and fire up!</p>
<pre lang="bash">sudo vi /etc/apache2/httpd.conf</pre>
<p>Look for DocumentRoot (not the inside MACOSXSERVER) and change it to whatever you want the path to be. In my case &#8220;/Users/Ares/Dropbox/Sites&#8221; then look for:</p>
<p>#<br />
# This should be changed to whatever you set DocumentRoot to.<br />
#<br />
&lt;Directory &#8220;/Users/Ares/Dropbox/Sites&#8221;&gt;</p>
<p>and change the directory to the same as your DocumentRoot.</p>
<p>you can then save an exit.</p>
<p>&nbsp;</p>
<p>Now, in OS X , apache runs under the user _www with group _www. So right now, due to permissions apache would not be able to read your document root. There are a few approaches we could take here to grant apache access to the DocumentRoot such as just giving everything under /Users a 777 permission, but this is not optimal so I opted for adding the user _www to the group staff since &#8220;staff&#8221; already has reading permissions to your user directory anyways. So, in your terminal issue the following command:</p>
<pre lang="bash">sudo dseditgroup -o edit -a _www -t user staff</pre>
<p>Now, the last thing you need to do is to grant &#8220;read and write&#8221; rights to the group under your  dropbox folder. It is important to note that the group needs access to every folder down the way to dropbox folder so you will need to do something like</p>
<pre lang="bash">sudo chmod 740 /Users
 sudo chmod 740 /Users/your-username
 chmod 740 /Users/your-username/Dropbox
 chmod -R 750 /Users/your-username/Dropbox/Sites</pre>
<p>once this is done all you need to do is restart apache with</p>
<pre lang="bash">sudo apachectl graceful</pre>
<p>This should get rid of the &#8220;Forbidden&#8221; error apache would throw if you just change your httpd.conf file without changing your permissions.</p>
<p>Happy sync&#8217;in and programming!</p>
]]></content:encoded>
			<wfw:commentRss>http://ares.im/configuring-apache-to-use-a-dropbox-folder-as-a-documentroot-mac-os-x/tech-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

