Monthly Archive for June, 2010

Setting Up an Apache and PHP server on Slicehost with CentOS 5.4

I recently set up a new slice at Slicehost for serving Seller’s Market, Frugal Me, and California Bungalow. The following post describes what was required for setting up a new CentOS 5.4 slice for serving a few PHP websites with Apache.

First, I changed the DNS records at my registrar to point to Slicehost’s name servers. Then, I followed Slicehost’s article on creating DNS records.

Slicehost has a great intro to CentOS 5.4; their guide will show you how to securely set up your new slice.

To install Apache, I followed Slicehost’s guide to installing Apache on CentOS. Then, I followed their guide to setting up the virtual hosts (for the multiple domains I plan to run on a single slice); I diverged from their directory layout without any problems.

Earlier, I mentioned that I decided to use CentOS 5.4; this is because I wanted to run a newer version of PHP with as little hassle as possible. I used this guide to installing PHP 5.3 on CentOS 5.

After PHP was installed, I still needed a few application-specific items: Memcached, MCrypt, and MySQL. These were easy to install with the repository from the above article:

  • Memcached: sudo yum install –enablerepo=webtatic php-pecl-memcached
  • MCrypt: sudo yum install –enablerepo=webtatic php-mcrypt
  • MySQL: sudo yum install –enablerepo=webtatic php-mysql

And that’s it! Hopefully this post is a helpful guide in getting started with Slicehost. While I haven’t actually had any sites live with Slicehost yet, the experience has been great thus far and I’d recommend them to anyone looking for more advanced hosting. If you haven’t signed up with them yet, I’d appreciate your use of this referral url.