<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>pig-monkey.com - wordpress</title><link href="https://pig-monkey.com/" rel="alternate"/><link href="https://pig-monkey.com/tag/wordpress/feed" rel="self"/><id>https://pig-monkey.com/</id><updated>2012-12-22T00:00:00-08:00</updated><entry><title>An Ubuntu VPS on Slicehost: Wordpress</title><link href="https://pig-monkey.com/2008/06/an-ubuntu-vps-on-slicehost-wordpress/" rel="alternate"/><published>2008-06-10T00:00:00-07:00</published><updated>2012-12-22T00:00:00-08:00</updated><author><name>Pig Monkey</name></author><id>tag:pig-monkey.com,2008-06-10:/2008/06/an-ubuntu-vps-on-slicehost-wordpress/</id><summary type="html">&lt;p&gt;&lt;em&gt;As &lt;a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/"&gt;mentioned previously&lt;/a&gt;, I&amp;rsquo;ve recently moved this domain over to &lt;a href="http://www.slicehost.com/"&gt;Slicehost&lt;/a&gt;. What follows is Part Four of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup"&gt;Part One&lt;/a&gt;, &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server"&gt;Part Two&lt;/a&gt;, and &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail"&gt;Part Three&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I prefer to install &lt;a href="http://wordpress.org/"&gt;Wordpress&lt;/a&gt; via Subversion, which makes updating …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;em&gt;As &lt;a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/"&gt;mentioned previously&lt;/a&gt;, I&amp;rsquo;ve recently moved this domain over to &lt;a href="http://www.slicehost.com/"&gt;Slicehost&lt;/a&gt;. What follows is Part Four of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup"&gt;Part One&lt;/a&gt;, &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server"&gt;Part Two&lt;/a&gt;, and &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail"&gt;Part Three&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I prefer to install &lt;a href="http://wordpress.org/"&gt;Wordpress&lt;/a&gt; via Subversion, which makes updating easier. We&amp;rsquo;ll have to install Subversion on the server first:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;aptitude&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;subversion
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;!--more--&gt;

&lt;p&gt;After that, &lt;a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion#New_Install_2"&gt;the Wordpress Codex has a guide to the rest of the install&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Nothing further is needed, unless you want fancy rewrites. In that case, we&amp;rsquo;ll have to make a change to your Nginx vhost config at &lt;code&gt;/etc/nginx/sites-available/mydomain.com&lt;/code&gt;. Add the following to your server block under &lt;code&gt;location / {&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt; wordpress fancy rewrites
if (-f $request_filename) {
    break;
 }
 if (-d $request_filename) {
     break;
  }
  rewrite ^(.+)$ /index.php?q=$1 last;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;While we&amp;rsquo;re here, I usually tell Nginx to cache static files by adding the following right above the&lt;code&gt;location / {&lt;/code&gt; block:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt; serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|css)$ {
    root  /home/user/public_html/mydomain.com/public;
    expires 7d;
    break;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That&amp;rsquo;ll go in the https server section, too. Now, enable rewrites in your Wordpress config. I use the following &amp;ldquo;custom&amp;rdquo; structure:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/%year%/%monthnum%/%day%/%postname%/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then, restart Nginx:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;/etc/init.d/nginx&lt;span class="w"&gt; &lt;/span&gt;restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And there you have it! You know have a working, new web server and mail server.&lt;/p&gt;
&lt;p&gt;(Previously, we did a &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup"&gt;basic setup&lt;/a&gt;, &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server"&gt;installed a web server&lt;/a&gt;, and &lt;a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail"&gt;installed a mail server&lt;/a&gt;.)&lt;/p&gt;</content><category term="general"/><category term="vps"/><category term="linux"/><category term="howto"/><category term="slicehost"/><category term="nginx"/><category term="wordpress"/><category term="ubuntu"/><category term="css"/></entry></feed>