04 Feb
by: Eric in Infrastructure, PHP, Ruby on Rails
tags: apache, centos, memcached, mysql, php, rails, ruby, slicehost
I recently purchased a VPS from SliceHost.com. After ruling out a shared host and deciding on a VPS setup, SliceHost seemed to offer the most for my money. My initial setup is the 256slice, which offers 256mb RAM, 10GB of storage, and 100GB of bandwidth for $20 a month. Being able to build my own stack from scratch is very appealing, especially as most of my side projects are written in Rails. My goal was to have Apache 2.2 as a front-end server, proxying requests to mongrel or a cluster of mongrels, with MySQL 5.0 as the database. Of course I also wanted to have Ruby 1.8.6 and Rails 2.0.2. Another useful, though optional, tool is phpMyAdmin. I am also using CentOS 5.0, first because of my familiarity with it and second because it's well documented and supported. The following is the first of a multipart tutorial about how I set this all up. In future installments I will detail how to secure and optimize each installation as well as enable Apache proxying and mongrel clustering.
Change the default root password
>passwd
Update all yum packages
>yum update
Bring in some standard packages
>yum install wget openssl-devel lynx zlib zlib-devel vixie-cron curl lynx subversion make gcc automake
Install Apache
>yum install httpd
Setup your domain records
http://articles.slicehost.com/2007/10/24/creating-dns-records
Create your VirtualHosts in Apache's httpd.conf
http://httpd.apache.org/docs/2.2/vhosts
Note: Apache's conf directory will be /etc/httpd/conf. Don't forget to restart Apache after setting up each new vhost:
>service httpd restart
See http://mongrel.rubyforge.org/docs/apache.html for details on how to get Apache and mongrel to play with each other.
Start Apache
>httpd service start
Install MySQL
>yum install mysql mysql-server
See http://dev.mysql.com/doc/ for post-installation instructions (setting up initial accounts, etc.)
Install Ruby (1.8.6)
>wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz
>gzip -d ruby-1.8.6-p111.tar.gz
>tar xvf ruby-1.8.6-p111.tar.gz
>cd ruby-1.8.6-p111.tar.gz
>./configure
>make
>make install
Install Ruby Gems (1.0.1)
>wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
>tar xvf rubygems-1.0.1.tgz
>cd rubygems-1.0.1.tgz
>ruby setup.rb
Install Rails (2.0.2)
>gem install rails --include-dependencies
Install Mongrel
>gem install mongrel
Optional for phpMyAdmin
Install php
>yum install php
Install php extensions necessary for phpMyAdmin
>yum install php-mcrypt
>yum install php-mbstring
Install phpmyadmin
http://www.phpmyadmin.net/documentation/#setup
Any comments or feedback is appreciated.
Related posts:
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.