<?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>Rob Spencer &#187; ssh</title>
	<atom:link href="http://robspencer.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://robspencer.net</link>
	<description>Programming and Web Development</description>
	<lastBuildDate>Thu, 06 Aug 2009 02:05:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Auto Update WordPress Without FTP</title>
		<link>http://robspencer.net/auto-update-wordpress-without-ftp/</link>
		<comments>http://robspencer.net/auto-update-wordpress-without-ftp/#comments</comments>
		<pubDate>Mon, 18 May 2009 18:13:16 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[auto update]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://robspencer.net/?p=15</guid>
		<description><![CDATA[When using the auto update feature to update wordpress to the newest version or to update your plugins, some users wonder why they need to enter ftp details when others don&#8217;t. Or maybe you have to enter the ftp information for your wordpress install on one server but not another. Not only do you have [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://robspencer.net/wp-content/uploads/2009/05/connecinfo-300x176.jpg" alt="Wordpress Automatic Upgrade Asking for FTP Information" title="Wordpress Automatic Upgrade Asking for FTP Information" alt="Wordpress Automatic Upgrade Asking for FTP Information" width="300" height="176" class="alignnone size-medium wp-image-19" /></p>
<p>When using the auto update feature to update wordpress to the newest version or to update your plugins, some users wonder why they need to enter ftp details when others don&#8217;t. Or maybe you have to enter the ftp information for your wordpress install on one server but not another. Not only do you have to enter your ftp details to use the automatic upgrade feature, you also have to chmod your wp-content folder to 0777 or 0775 rather than the default 0755 just so you can use the image uploader. If you have root access to your server, I will show you how to fix that.</p>
<p><span id="more-15"></span></p>
<p>First you want to login to your server as the root user with whatever SSH client you prefer. I use the free and open source <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Putty</a>.</p>
<p>We need to see what user apache is running as. We can do this by simply typing the &#8216;top&#8217; command checking our httpd processes.</p>
<p><code>root@host # top</code></p>
<p><img src="http://robspencer.net/wp-content/uploads/2009/05/httpduser-500x82.jpg" alt="Check which user is running apache" title="Check which user is running apache" width="500" height="82" class="size-large wp-image-20" /></p>
<p>As you can see in the above picture, httpd is running as the user &#8216;nobody.&#8217; Your user may be different depending on your server configuration. Some common ones are nobody, www, or www-data. Just make sure its not root. Generally you will have one httpd process running as root so it can bind to port 80, then a few sub processes running as a different user. When in doubt, you can also find the user in the httpd.conf.</p>
<p>Now that we have our apache user, let see what user owns our website files. You can do this with <code>root@host # ls -l /home</code>.</p>
<p><img src="http://robspencer.net/wp-content/uploads/2009/05/siteuser-500x18.jpg" alt="Check which user owns our website files." title="Check which user owns our website files." width="500" height="18" class="alignnone size-medium wp-image-21" /></p>
<p>From the image above, we can see that the fakeuser/ folder belongs to the user &#8216;fakeuser&#8217; and the group &#8216;fakeuser.&#8217; All we need to do here is <code>chown</code> our folder to change the user to the same one as the webserver.</p>
<p><code>root@host # chown -R nobody /home/fakeuser</code></p>
<p>Now if you <code>ls -l /home</code> again, you will see that the fakeuser folder is now owned by &#8216;nobody&#8217; as well as all files and folders within it (by using -R for recursive). Now go into your wp-admin and try to use the automatic upgrade again. It will now jump straight into the upgrade without asking for your ftp details. You also wont have to edit permissions when using the image uploader.</p>
<p>Disclaimer: Although this eases your use of wordpress, you may have to change settings for other things such as awstats or cpanel, among other things. All server configurations are different. Use this at your own risk and don&#8217;t blame me if you mess something up.</p>
]]></content:encoded>
			<wfw:commentRss>http://robspencer.net/auto-update-wordpress-without-ftp/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

