skip main content

Posts Tagged ‘slicehost’

Deploying WordPress to SliceHost using Capistrano and Git

posted by Duncan at 12:00 pm on February 1st, 2009

Skip straight to the how-to if you don’t care about an introduction.

This post has been in my drafts folder for about 6 months, and I intended to be much more detailed, but I don’t think I’m gonna ever get round to it, so here is the shortened version.

I did a post a while back on how to deploy WordPress to TextDrive using Capistrano, which people seemed to find useful. I still use WordPress, and I still find Capistrano perfect for deployment in this situation. They’re the only two constants though, as I have now changed hosts, changed source control systems, oh and Capistrano has jumped up a major release and many minor releases, so the interface is slightly different.

I moved over to SliceHost because I wanted the control that virtual hosting gives you, and those guys are cheap, as well as having an awesome service thus far.

The actual installation of Apache, MySQL and PHP is quite simple through YUM and well documented via the Slicehost support area so I won’t repeat this. I also moved over to Git a while back, after researching distributed source control systems, and playing with Mercurial for a while. Git just seemed to tick more boxes for my current needs both at work, and home play.

1. Assumptions

I have based the post on the fact I choose to put all the sites I deploy in a my home directory. Some other assumptions are:

  • You have Apache, MySQL and PHP installed
  • You have an account on the machine with sudo access
  • You have a Git installed on the machine you will be deploying from

Now you need to organise your wordpress source into this structure:

README
Capfile
public/
    + index.php
    + wp-admin/
    + wp-xxxx
     etc ....

2. Configure Capistrano

You can download my basic Capfile that should help get you started. The only things you will need to change are :domain and :user. For example, for my site I may use:

set :domain, "whomwah.com"
set :user, "websites"

This would mean that I can normally access my server using:

ssh websites@whomwah.com

3. Initialise your Git repo

I kind of expect you to have already done this, but if you haven’t, change into the root directory (The one with the Capfile in it) and run:

git init
git add .
git commit -a -m 'initial import into Git'

4. Deploy

You should now have enough initial information to let Capistrano deploy WP to your server. First though, you need to run the Capistrano setup command to stick a bunch of folders on your server ready to hold your site. This is a good test command too as it lets you know if you have setup your :domain and :user ok.

cap deploy:setup

If that went ok, then you can now run the mighty:

cap deploy

That’s it! you should now have your blog deploying to your server.

5. Apache setup

All you need to do now is setup Apache to point to the folder. You can use this vhost file. Rename it and edit it’s contents to suit your site, then stick it in your

/etc/httpd/conf.d/

folder. Restart Apache:

sudo /sbin/services httpd restart

Now browse to your sites url and to the admin area and setup your blog as per the WordPress instructions. Best of luck!

Installing daemontools on CentOS5 x86_64

posted by Duncan at 9:43 pm on November 4th, 2008

[UPDATE] It turns out you need to apply the patch below on any recent Linux distribution, not just 64 bit architectures, if that helps anyone.

More head scratching, web searching, friend asking, and huzzah, finally solved. How to actually install daemonstools on my SliceHost CentOS5 slice. The catch for me was that it wouldn’t compile because ‘it required a patch‘. Who’d of known? So here’s my notes:

$ sudo mkdir -p /package
$ sudo chmod 1755 /package/
$ cd /package/
$ sudo wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
$ sudo tar xzf daemontools-0.76.tar.gz
$ sudo wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
$ cd admin/daemontools-0.76
$ sudo patch -p1 < ../../daemontools-0.76.errno.patch
$ sudo rm ../../daemontools-0.76.errno.patch ../../daemontools-0.76.tar.gz
$ sudo ./package/install
...
...
Adding svscanboot to inittab...
init should start svscan now.

back to the top