<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Shattered Symmetry - Home</title>
  <id>tag:www.shatteredsymmetry.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://www.shatteredsymmetry.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.shatteredsymmetry.com/" rel="alternate" type="text/html"/>
  <updated>2008-12-23T02:58:12Z</updated>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-12-23:14</id>
    <published>2008-12-23T02:57:00Z</published>
    <updated>2008-12-23T02:58:12Z</updated>
    <category term="capistrano"/>
    <category term="centos"/>
    <category term="howto"/>
    <category term="virtualization"/>
    <category term="xen"/>
    <link href="http://www.shatteredsymmetry.com/using-capistrano-to-control-xen-domains" rel="alternate" type="text/html"/>
    <title>Using Capistrano To Control Xen Domains</title>
<content type="html">
            Since &lt;a href=&quot;http://www.shatteredsymmetry.com/virtualizing-centos-5-2&quot;&gt;virtualizing CentOS 5.2&lt;/a&gt;, I've been running 4 Ubuntu Xen domains:
&lt;blockquote&gt;&lt;strong&gt;sudo xm list&lt;/strong&gt;&lt;pre&gt;Name                       ID Mem(MiB) VCPUs State   Time(s)
Domain-0                    0      793     4 r-----    779.1
u810s1                      1     1031     2 -b----   3023.7
u810s2                      2     2055     2 -b----   7071.0
u810s3                      3     2055     2 -b----   6805.7
u810s4                      4     2055     2 -b----   7103.9&lt;/pre&gt;&lt;/blockquote&gt;
dom0 is the base system (Centos 5.2); u810s1 is an Ubuntu 8.10 Server instance with 1Gb of RAM; u810s2-4 are the same but with 2Gb each. Each machine has a common user account and password, and that user has the following entry at the bottom of /etc/sudoers on each machine:
&lt;blockquote&gt;&lt;pre&gt;justin ALL=NOPASSWD: ALL&lt;/pre&gt;&lt;/blockquote&gt;
Also in each user's ~/.ssh/authorized_keys file is the public key from the user &lt;em&gt;justin&lt;/em&gt; on dom0, so passwordless SSH can happen.&lt;br /&gt;&lt;br /&gt;I &lt;a href=&quot;http://www.shatteredsymmetry.com/installing-ruby-enterprise-edition-on-ubuntu-8-10&quot;&gt;installed Ruby Enterprise Edition&lt;/a&gt; on dom0, as well as RubyGems and &lt;a href=&quot;http://www.capify.org/&quot;&gt;Capistrano&lt;/a&gt;. I know the IP addresses of the u810s instances. So where does that leave me?...&lt;br /&gt;&lt;br /&gt;Able to control them all in unison. :-)
&lt;blockquote&gt;&lt;strong&gt;capfile&lt;/strong&gt;&lt;pre&gt;
role :app_servers, &quot;192.168.1.201&quot;, &quot;192.168.1.202&quot;, 
                        &quot;192.168.1.203&quot;, &quot;192.168.1.204&quot;

# `cap update_ubuntu`
task :update_ubuntu, :roles =&gt; :app_servers do
  run &quot;sudo apt-get update&quot;
  run &quot;sudo apt-get upgrade -y&quot;
end

# `cap shutdown_all`
task :shutdown_all, :roles =&gt; :app_servers do
  run &quot;sudo shutdown -P now&quot;
end

# e.g. `cap -s pkg=denyhosts install`
task :install, :roles =&gt; :app_servers do
  run &quot;sudo apt-get install #{pkg} -y&quot;
end&lt;/pre&gt;&lt;/blockquote&gt;
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-12-07:10</id>
    <published>2008-12-07T02:40:00Z</published>
    <updated>2008-12-07T02:41:20Z</updated>
    <category term="centos"/>
    <category term="howto"/>
    <category term="virtualization"/>
    <category term="xen"/>
    <link href="http://www.shatteredsymmetry.com/virtualizing-centos-5-2" rel="alternate" type="text/html"/>
    <title>Virtualizing CentOS 5.2</title>
<content type="html">
            I recently switched my primary computer from a Linux desktop to a Macbook Pro. Holy wars aside, having a Q9450 with 2TB of disk space and 8GB of DDR2 sitting in the corner collecting dust was getting on my nerves. I set it up as a file and print server for the house, but the CPU was sitting idle most of the time. Today I decided to install &lt;a href=&quot;http://www.xen.org&quot;&gt;Xen&lt;/a&gt; on it so I could create disposable development environments. I've been experimenting with different Rails and PHP architectures, so being able to create virtual environments to test things out seemed like the way to go.&lt;br /&gt;&lt;br /&gt;
Seeing as I've been spending way too much time with Ubuntu as of late, I decided to jump back into the &lt;a href=&quot;http://www.centos.org&quot;&gt;CentOS&lt;/a&gt; world for a spell. Getting Xen up and running was surprising straight-forward on CentOS 5.2 (x64, &quot;Server - GUI&quot; install option):
&lt;blockquote&gt;
# install the Xen packages&lt;br /&gt;
yum install kernel-xen xen&lt;br /&gt;&lt;br /&gt;
# make the Xen kernel the default&lt;br /&gt;
vi /boot/grub/menu.lst&lt;br /&gt;
change &lt;em&gt;default=1&lt;/em&gt; to &lt;em&gt;default=0&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;
# restart to use the new kernel&lt;br /&gt;
reboot -t now
&lt;/blockquote&gt;
After you've restarted, you're ready to get some virtual machines going:
&lt;blockquote&gt;
# create a new virtual machine&lt;br /&gt;
virt-install&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;What is the name of your virtual machine? &lt;strong&gt;u810d&lt;/strong&gt;&lt;br /&gt;
 How much RAM should be allocated (in megabytes)? &lt;strong&gt;2048&lt;/strong&gt;&lt;br /&gt;
 What would you like to use as the disk (file path)? &lt;strong&gt;/vm/u810d.img&lt;/strong&gt;&lt;br /&gt;
 How large would you like the disk (/vm/vm01.img) to be (in gigabytes)? &lt;strong&gt;4&lt;/strong&gt;&lt;br /&gt;
 Would you like to enable graphics support? (yes or no) &lt;strong&gt;yes&lt;/strong&gt;&lt;br /&gt;
 What is the install location? &lt;strong&gt;/media/ubuntu-8.10-desktop-i386.iso&lt;/strong&gt;&lt;/em&gt;
&lt;/blockquote&gt;
(Astute readers will notice the first thing I installed was Ubuntu...)&lt;br /&gt;&lt;br /&gt;
The &lt;em&gt;xm&lt;/em&gt; command is used to control your Xen VMs at this point. Here are a few of the commands that you'll use often (as root or with &lt;em&gt;sudo&lt;/em&gt;):
&lt;blockquote&gt;
&lt;em&gt;xm create &lt;strong&gt;u810d&lt;/strong&gt;&lt;/em&gt; - start the virtual machine&lt;br /&gt;
&lt;em&gt;xm shutdown &lt;strong&gt;u810d&lt;/strong&gt;&lt;/em&gt; - stop the virtual machine&lt;br /&gt;
&lt;em&gt;xm destroy &lt;strong&gt;u810d&lt;/strong&gt;&lt;/em&gt; - forcefully stop the virtual machine&lt;br /&gt;
&lt;em&gt;virt-viewer &lt;strong&gt;u810d&lt;/strong&gt;&lt;/em&gt; - get console access to the virtual machine via X11&lt;br /&gt;
&lt;em&gt;xm list&lt;/em&gt; - list all running virtual machines
&lt;/blockquote&gt;
And since my machine is sitting behind a hefty firewall, I enabled remote desktop in Ubuntu and use Apple's Remote Desktop as my VNC client for any XFree86 access... I use SSH (with X11 forwarding as needed) for most everything else. Get a base instance you like up and running, and then just copy the image and configuration files to a new location to create clones.
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-29:8</id>
    <published>2008-11-29T23:48:00Z</published>
    <updated>2008-11-30T06:18:58Z</updated>
    <category term="freebsd"/>
    <category term="howto"/>
    <category term="mysql"/>
    <category term="upgrade"/>
    <link href="http://www.shatteredsymmetry.com/upgrading-mysql-from-4-x-to-5-0-x-on-freebsd-6" rel="alternate" type="text/html"/>
    <title>Upgrading MySQL From 4.x to 5.0.x On FreeBSD 6</title>
<content type="html">
            I had to update a MySQL installation for a client this weekend who runs FreeBSD. I've never done a MySQL 4.x to 5.0.x upgrade before, so I thought I'd share my notes from the process. It's relatively straight-forward:
&lt;blockquote&gt;
# make a SQL backup in case something explodes&lt;br /&gt;
mysqldump --all-databases &gt; mysql_backup.sql&lt;br /&gt;&lt;br /&gt;
# stop MySQL&lt;br /&gt;
/usr/local/etc/rc.d/mysql-server stop&lt;br /&gt;&lt;br /&gt;
# remove the existing MySQL client and server packages&lt;br /&gt;
# (run `mysql -V` to get your MySQL version number)&lt;br /&gt;
pkg_delete mysql-server-4.1.21&lt;br /&gt;
pkg_delete mysql-client-4.1.21&lt;br /&gt;&lt;br /&gt;
# add the LinuxThreads package, which we'll use to get better threading&lt;br /&gt;
pkg_add -r linuxthreads&lt;br /&gt;&lt;br /&gt;
# build the new version of MySQL from source, using LinuxThreads&lt;br /&gt;
cd /usr/ports/databases/mysql50-server/&lt;br /&gt;
make WITH_LINUXTHREADS=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes&lt;br /&gt;
make install&lt;br /&gt;&lt;br /&gt;
# start up MySQL 5&lt;br /&gt;
/usr/local/etc/rc.d/mysql-server start&lt;br /&gt;&lt;br /&gt;
# upgrade the MySQL data files from 4.x to 5.0.x&lt;br /&gt;
/usr/local/bin/mysql_upgrade -u root -p --datadir=/var/db/mysql&lt;br /&gt;
&lt;/blockquote&gt;
The mysql_upgrade script gave me some issues, as it would report that tables needed to be repaired but wouldn't actually repair them. I used the following PHP script to repair all the tables prior to running mysql_upgrade:
&lt;blockquote&gt;
&amp;lt;?php&lt;br /&gt;
### Enter your username and password into the connection string: ###&lt;br /&gt;
$dbLink = mysql_connect(&quot;localhost&quot;, &quot;&lt;em&gt;user&lt;/em&gt;&quot;, &quot;&lt;em&gt;pass&lt;/em&gt;&quot;) or die(&quot;Unable to connect.&quot;);&lt;br /&gt;&lt;br /&gt;

# hack to get a list of database names;&lt;br /&gt;
# the actual query should be &quot;SHOW DATABASES&quot;, but breaks for info schema&lt;br /&gt;
$sql = &quot;SELECT 'mydatabasename' as 'Database' UNION ALL SELECT 'myseconddatabase' as 'Database'&quot;;&lt;br /&gt;
$query = mysql_query($sql) or die(&quot;error fetching database names&quot;);&lt;br /&gt;&lt;br /&gt;

while ($rs=mysql_fetch_array($query)) {&lt;br /&gt;&lt;br /&gt;

 mysql_select_db($rs['Database'],$dbLink) or die(&quot;Unable to select database: &quot; . $rs['Database']);&lt;br /&gt;&lt;br /&gt;

 $sql = &quot;SHOW TABLES&quot;;&lt;br /&gt;
 $query2 = mysql_query($sql) or die(&quot;error fetching table names&quot;);&lt;br /&gt;&lt;br /&gt;

&amp;nbsp;while ($rs2=mysql_fetch_array($query2)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;$key = &quot;Tables_in_&quot; . $rs['Database'];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;$sql = &quot;REPAIR TABLE &quot; . $rs2[$key];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;$query3 = mysql_query($sql) or die(&quot;Error repairing a table - $sql&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Repaired &quot; . $rs2[$key] . &quot;\n&quot;;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;

echo &quot;Finished!\n&quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;
You're now running MySQL 5.0.x! The majority of your queries should work without any changes; the main issue I came across was with implicit INNER (&quot;comma&quot;) JOINs. As always, test in dev before touching production. :-)
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-25:7</id>
    <published>2008-11-25T04:16:00Z</published>
    <updated>2008-12-03T22:59:13Z</updated>
    <link href="http://www.shatteredsymmetry.com/why-you-need-denyhosts" rel="alternate" type="text/html"/>
    <title>Why You Need DenyHosts</title>
<content type="html">
            Since &lt;a href=&quot;/secure-your-ubuntu-8-10-linode-with-iptables&quot;&gt;installing DenyHosts&lt;/a&gt; four days ago, this is what my /etc/hosts.deny file looks like:
&lt;pre&gt;sshd: 189.56.25.146
sshd: 211.245.106.195
sshd: 189.19.43.55
sshd: 58.120.97.64
sshd: 61.129.64.137
sshd: 190.90.3.171
sshd: 125.69.132.102
sshd: 208.116.36.234
sshd: 75.40.150.27
sshd: 220.162.243.52
sshd: 81.218.0.18
sshd: 219.238.236.3
sshd: 200.33.10.41
sshd: 202.70.193.25
sshd: 222.83.251.84
sshd: 117.36.192.75&lt;/pre&gt;

Brazil, Korea, China, Columbia, Israel, Mexico, India and friggin' New Jersey. One of these things does not belong.&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;Update: more additions to the wall of shame...&lt;/em&gt;
&lt;pre&gt;sshd: 92.50.193.94
sshd: 210.211.187.31
sshd: 12.45.22.213
sshd: 78.40.226.156
sshd: 218.16.101.70
sshd: 65.44.85.155
sshd: 189.10.197.107
sshd: 201.49.29.169
sshd: 212.150.149.164
sshd: 61.148.212.34
sshd: 222.221.12.13
sshd: 24.159.194.218
sshd: 207.226.88.28
sshd: 219.137.24.12
sshd: 202.10.65.81
sshd: 81.208.51.90
sshd: 74.208.99.46
sshd: 24.128.78.196&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-23:6</id>
    <published>2008-11-23T00:55:00Z</published>
    <updated>2008-11-23T00:57:11Z</updated>
    <category term="howto"/>
    <category term="mac"/>
    <category term="optimization"/>
    <category term="php"/>
    <link href="http://www.shatteredsymmetry.com/install-xdebug-on-mac-os-x-leopard-1055" rel="alternate" type="text/html"/>
    <title>Install Xdebug On Mac OS X Leopard 10.5.5</title>
<content type="html">
            Here's a quick how-to explaining how to get xdebug working on Leopard. To get started, download the xdebug source from &lt;a href=&quot;http://xdebug.org/&quot;&gt;http://xdebug.org/&lt;/a&gt;. Untar the source and cd into the directory. Then:
&lt;blockquote&gt;
#prepare the build environment&lt;br /&gt;
phpize&lt;br /&gt;&lt;br /&gt;
# configure xdebug for Leopard 10.5.5&lt;br /&gt;
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp&quot; CCFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot; CXXFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot; LDFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot; ./configure --enable-xdebug&lt;br /&gt;&lt;br /&gt;

# compile xdebug&lt;br /&gt;
make&lt;br /&gt;&lt;br /&gt;

# install it to the php extensions folder&lt;br /&gt;
sudo cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20060613/&lt;br /&gt;&lt;br /&gt;

# configure your php.ini to load xdebug&lt;br /&gt;
sudo vi /etc/php.ini&lt;br /&gt;
add:

&lt;pre&gt;[xdebug]
; load xdebug
zend_extension=&quot;xdebug.so&quot;&lt;/pre&gt;

# finally, restart Apache&lt;br /&gt;
sudo apachectl restart 
&lt;/blockquote&gt;
If you do it any other way, you'll get a non-64-bit extension that you'll be able to see with 'php -m' but won't be active in Apache. It took me a bloody hour to figure this out.
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-23:5</id>
    <published>2008-11-23T00:29:00Z</published>
    <updated>2008-11-23T00:30:09Z</updated>
    <category term="apache"/>
    <category term="howto"/>
    <category term="mephisto"/>
    <category term="optimization"/>
    <link href="http://www.shatteredsymmetry.com/speed-up-mephisto-by-enabling-caching" rel="alternate" type="text/html"/>
    <title>Speed Up Mephisto By Enabling Caching</title>
<content type="html">
            One of the things that wasn't obvious about &lt;a href=&quot;http://www.mephistoblog.com/&quot;&gt;Mephisto&lt;/a&gt; when I set it up was its oh-so awesome caching support. Behind the scenes, it does full-page caching for all site content and stores it within the public/cache directory. Unfortunately, it doesn't &lt;em&gt;use&lt;/em&gt; the cache unless you configure your web server to do so, and there's no mention of this in the documentation. :-)&lt;br /&gt;&lt;br /&gt;
So how does one enable caching in Mephisto? Well, I'm using Apache, so I can just enable mod_rewrite and redirect you the reader to the cache file for a page if it exists. The good part about this is that the request avoids Rails altogether, so it's especially speedy and gentle on your server. (If you're using a different web server, the process will be similar, but you'll obviously have to adapt the syntax to your specific needs.)&lt;br /&gt;&lt;br /&gt;
Just put the following RewriteRules in your httpd.conf file:
&lt;blockquote&gt;
  RewriteEngine On&lt;br /&gt;
  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1.html -f&lt;br /&gt;
  RewriteRule ^/([^.]+)$ /cache/%{HTTP_HOST}/$1.html [QSA,L]&lt;br /&gt;
&lt;/blockquote&gt;
Or, if like me, you've edited &lt;em&gt;config/initializers/custom.rb&lt;/em&gt; in Mephisto to disable multi-site support, your rewrite rules are even simpler:
&lt;blockquote&gt;
  RewriteEngine On&lt;br /&gt;
  RewriteCond %{DOCUMENT_ROOT}/$1.html -f&lt;br /&gt;
  RewriteRule ^/([^.]+)$ /$1.html [QSA,L]&lt;br /&gt;
&lt;/blockquote&gt;
Restart Apache and enjoy the speed boost!
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-21:4</id>
    <published>2008-11-21T05:05:00Z</published>
    <updated>2008-11-21T05:06:09Z</updated>
    <category term="howto"/>
    <category term="intrepid"/>
    <category term="linode"/>
    <category term="security"/>
    <category term="ubuntu"/>
    <link href="http://www.shatteredsymmetry.com/secure-your-ubuntu-8-10-linode-with-iptables" rel="alternate" type="text/html"/>
    <title>Secure Your Ubuntu 8.10 Linode With Iptables</title>
<content type="html">
            Setting up iptables is essential to having a secure Linux installation; leaving ports open when no service is running on them sounds like a rational idea, but it misses the point: actively blocking/dropping connections is much better than doing nothing at all. Showing the script kiddies that you know what you're doing is a powerful deterrent in and of itself, and &lt;a href=&quot;http://www.netfilter.org/projects/iptables/index.html&quot;&gt;iptables&lt;/a&gt; is the first step towards that.&lt;br /&gt;&lt;br /&gt;
The first thing I did after getting my &lt;a href=&quot;http://www.linode.com/&quot;&gt;Linode&lt;/a&gt; up and running was setup iptables to get a firewall protecting my server. Here's how you can, too:
&lt;blockquote&gt;
# change to the root user&lt;br /&gt;
sudo -i&lt;br /&gt;&lt;br /&gt;
# install iptables&lt;br /&gt;
apt-get install iptables&lt;br /&gt;&lt;br /&gt;
# create your iptables configuration&lt;br /&gt;
vi /etc/iptables.up.rules&lt;br /&gt;&lt;br /&gt;
add:
&lt;pre&gt;*filter

-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix \
      &quot;iptables denied: &quot; --log-level 7
-A INPUT -j REJECT
-A FORWARD -j REJECT
COMMIT&lt;/pre&gt;
# apply these rules to the server&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.up.rules&lt;br /&gt;&lt;br /&gt;
# then, setup your interfaces so the rules are reapplied at startup&lt;br /&gt;
vi /etc/network/interfaces&lt;br /&gt;&lt;br /&gt;
add:

&lt;pre&gt;auto lo
iface lo inet loopback
pre-up iptables-restore &amp;lt; /etc/iptables.up.rules&lt;/pre&gt;
&lt;/blockquote&gt;
This will leave you with ports 80, 443 and 22 open, and everything else closed. For good measure, you should also install &lt;a href=&quot;http://denyhosts.sourceforge.net/&quot;&gt;DenyHosts&lt;/a&gt;, which will automatically blacklist IP addresses that have multiple failed SSH login attempts:
&lt;blockquote&gt;
apt-get install denyhosts
&lt;/blockquote&gt;
Finally, update your SSH config to not allow remote root logins:
&lt;blockquote&gt;
vi /etc/ssh/sshd_config&lt;br /&gt;&lt;br /&gt;
change:&lt;br /&gt;
PermitRootLogin yes&lt;br /&gt;
&amp;nbsp;&amp;nbsp;to&lt;br /&gt;
PermitRootLogin no&lt;br /&gt;&lt;br /&gt;

# reload SSH&lt;br /&gt;
/etc/init.d/ssh reload&lt;br /&gt;
&lt;/blockquote&gt;
That's it! You now have a more secure Ubuntu 8.10 Linode.
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-20:3</id>
    <published>2008-11-20T02:54:00Z</published>
    <updated>2008-11-20T02:54:48Z</updated>
    <category term="howto"/>
    <category term="intrepid"/>
    <category term="mephisto"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="ubuntu"/>
    <link href="http://www.shatteredsymmetry.com/installing-mephisto-on-ubuntu-8-10" rel="alternate" type="text/html"/>
    <title>Installing Mephisto on Ubuntu 8.10</title>
<content type="html">
            &lt;em&gt;Note: this tutorial assumes you already have a working Ruby on Rails installation (installed via apt-get/aptitude with rubygems built from source). Bonus points will be awarded if you already have &lt;a href=&quot;/installing-ruby-enterprise-edition-on-ubuntu-8-10&quot;&gt;Ruby Enterprise Edition installed&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;
When it comes to Rails blog engines, there aren't too many choices; &lt;a href=&quot;http://www.typosphere.org/&quot;&gt;Typo&lt;/a&gt; and &lt;a href=&quot;http://www.mephistoblog.com/&quot;&gt;Mephisto&lt;/a&gt; are the two most popular packages, and both are rather stagnant in terms of development. Seeing as the Ruby world moves fast and the Rails world even faster, this can make it difficult to get either of these packages working with the current versions of Ruby and/or Rails. Ubuntu 8.10, the Intrepid Ibex from hell, has this problem. It took a few tries, but this blog is using Mephisto now, and I'd like to share the process that worked for me so you can get it running for your blog, too.&lt;br /&gt;&lt;br /&gt;
Ubuntu 8.10 comes with Ruby 1.8.7 and Rails 2.1.2. This is problematic for Mephisto in two ways: Mephisto only works with Rails &amp;lt;= 2.0.2, and Ruby 1.8.7 removes some Enumerate functionality that Mephisto relies on. But with a little maneuvering, we can get Mephisto working just fine. The process looks like this:&lt;br /&gt;

&lt;blockquote&gt;
# install the required gem dependency:&lt;br /&gt;
sudo gem install tzinfo&lt;br /&gt;&lt;br /&gt;
# get Mephisto from GitHub&lt;br /&gt;
wget http://github.com/technoweenie/mephisto/tarball/master.tar.gz&lt;br /&gt;&lt;br /&gt;
# untar the file and cd into the directory&lt;br /&gt;
tar zxvf technoweenie-mephisto-*.tar.gz&lt;br /&gt;
cd technoweenie-mephisto-*&lt;br /&gt;&lt;br /&gt;
# put the 2.0.2 version of Rails on ice&lt;br /&gt;
rake rails:freeze:edge RELEASE=2.0.2&lt;br /&gt;&lt;br /&gt;
# use the 2.0.2 boot file in Mephisto&lt;br /&gt;
cp vendor/rails/railties/environments/boot.rb config/boot.rb&lt;br /&gt;&lt;br /&gt;
# create your production database&lt;br /&gt;
mysqladmin create mephisto_production&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;-- do the usual config/database.yml username/password/database setup--&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;
# hack Mephisto to work with Rails 2.1.2 and Ruby 1.8.7&lt;br /&gt;
vi config/boot.rb and add the following lines at the top:&lt;br /&gt;

&lt;pre&gt;
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION

unless '1.9'.respond_to?(:force_encoding)
String.class_eval do
    begin
      remove_method :chars
    rescue NameError
      # OK
    end
  end
end&lt;/pre&gt;&lt;br /&gt;
# bootstrap the production database&lt;br /&gt;
rake db:bootstrap RAILS_ENV=production&lt;br /&gt;&lt;br /&gt;
# restart your webserver for good measure&lt;br /&gt;
sudo /etc/init.d/apache2 restart
&lt;/blockquote&gt;
Provided you did this in a web accessible location, you should be able to log into Mephisto now. The magic is freezing Rails to 2.0.2, updating the boot.rb file to force 2.0.2 to be used and overriding Ruby 1.8.7's Enumerate weirdness. If you're using &lt;a href=&quot;/installing-ruby-enterprise-edition-on-ubuntu-8-10&quot;&gt;Ruby Enterprise Edition&lt;/a&gt;, you can ignore the 'unless' section above since REE is still 1.8.6. Make sure to install &lt;em&gt;tzinfo&lt;/em&gt; with REE's gem binary, though, or mod_rails will give you a nice FAIL message when you try to access Mephisto.
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-19:2</id>
    <published>2008-11-19T06:20:00Z</published>
    <updated>2008-11-19T06:21:33Z</updated>
    <category term="howto"/>
    <category term="intrepid"/>
    <category term="ruby"/>
    <category term="ruby enterprise edition"/>
    <category term="ubuntu"/>
    <link href="http://www.shatteredsymmetry.com/installing-ruby-enterprise-edition-on-ubuntu-8-10" rel="alternate" type="text/html"/>
    <title>Installing Ruby Enterprise Edition on Ubuntu 8.10</title>
<content type="html">
            So &lt;a href=&quot;http://www.rubyenterpriseedition.com/&quot;&gt;Ruby Enterprise Edition&lt;/a&gt; doesn't compile on &lt;a href=&quot;http://www.ubuntu.com/getubuntu/download&quot;&gt;Ubuntu 8.10&lt;/a&gt;. It appears as though the version of GCC that comes bundled in Intrepid's build-essential (4.3.2-1ubuntu11) is too awesome for REE to handle. Actually, it's due to some path hacking that REE does to work on systems like FreeBSD, but I digress...&lt;br /&gt;&lt;br /&gt;
So you've all but given up hope of getting REE to work on your Intrepid install. But fear not; the change is actually really simple! In order to make it compile properly, you just need to apply the following patch to the REE source:&lt;br /&gt;
&lt;blockquote&gt;
--- /tmp/ruby-enterprise-1.8.6-20080810/installer.rb&lt;br /&gt;
+++ ruby-enterprise-1.8.6-20080810/installer.rb&lt;br /&gt;
@@ -159,9 +159,9 @@&lt;br /&gt;
                        @destdir += &quot;/&quot;&lt;br /&gt;
                end&lt;br /&gt;&lt;br /&gt;

-               ENV['C_INCLUDE_PATH'] = &quot;#{@destdir}#{@prefix}/include:/usr/include:/usr/local/include:#{ENV['C_INCLUDE_PATH']}&quot;&lt;br /&gt;
-               ENV['CPLUS_INCLUDE_PATH'] = &quot;#{@destdir}#{@prefix}/include:/usr/include:/usr/local/include:#{ENV['CPLUS_INCLUDE_PATH']}&quot;&lt;br /&gt;
-               ENV['LD_LIBRARY_PATH'] = &quot;#{@destdir}#{@prefix}/lib:#{ENV['LD_LIBRARY_PATH']}&quot;&lt;br /&gt;
+                #ENV['C_INCLUDE_PATH'] = &quot;#{@destdir}#{@prefix}/include:/usr/include:/usr/local/include:#{ENV['C_INCLUDE_PATH']}&quot;&lt;br /&gt;
+               #ENV['CPLUS_INCLUDE_PATH'] = &quot;#{@destdir}#{@prefix}/include:/usr/include:/usr/local/include:#{ENV['CPLUS_INCLUDE_PATH']}&quot;&lt;br /&gt;
+               #ENV['LD_LIBRARY_PATH'] = &quot;#{@destdir}#{@prefix}/lib:#{ENV['LD_LIBRARY_PATH']}&quot;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
--- /tmp/ruby-enterprise-1.8.6-20080810/source/vendor/google-perftools-0.98/src/base/linuxthreads.c&lt;br /&gt;
+++ ruby-enterprise-1.8.6-20080810/source/vendor/google-perftools-0.98/src/base/linuxthreads.c&lt;br /&gt;
@@ -49,7 +49,7 @@&lt;br /&gt;
 #include &amp;lt;asm/fcntl.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/posix_types.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/types.h&amp;gt;&lt;br /&gt;
-#include &amp;lt;linux/dirent.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;dirent.h&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;
For those not well-versed in the intricacies of diff, you need to comment out the three ENV lines in &lt;em&gt;installer.rb&lt;/em&gt; starting at line 161, and you need to change the &lt;em&gt;&amp;lt;linux/dirent.h&amp;gt;&lt;/em&gt; include directive to point to plain ol' &lt;em&gt;&amp;lt;dirent.h&amp;gt;&lt;/em&gt; in &lt;em&gt;source/vendor/google-perftools-0.98/src/base/linuxthreads.c&lt;/em&gt;. The rest of the Ruby Enterprise Edition install works the same as in the &lt;a href=&quot;http://www.rubyenterpriseedition.com/download.html&quot;&gt;documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;
That's all there is to it. :-D&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;If you found this post at all useful, I would encourage you to buy an &lt;a href=&quot;http://www.modrails.com/enterprise.html&quot;&gt;Enterprise License&lt;/a&gt; for Ruby Enterprise Edition to support &lt;a href=&quot;http://www.phusion.nl/about.html&quot;&gt;Phusion&lt;/a&gt;. The gods of Karma will thank you.&lt;/em&gt;
          </content>  </entry>
  <entry xml:base="http://www.shatteredsymmetry.com/">
    <author>
      <name>Justin</name>
    </author>
    <id>tag:www.shatteredsymmetry.com,2008-11-19:1</id>
    <published>2008-11-19T02:59:00Z</published>
    <updated>2008-11-19T06:27:13Z</updated>
    <link href="http://www.shatteredsymmetry.com/rebooted" rel="alternate" type="text/html"/>
    <title>Rebooted</title>
<content type="html">
            Welcome to my new home. All hail &lt;a href=&quot;http://www.mephistoblog.com&quot;&gt;Mephisto&lt;/a&gt;!
          </content>  </entry>
</feed>
