2009
05.12

Recently I installed CentOS 5 as a guest host on my VMWare server to run a RoR development environment.  This the process I went through.  Much thanks to a post on the Rubyonrails.com wiki that got me going in the right direction.

ror centos_logo_45 logo_vmware

CentOS 5

  1. Download the NetInstall ISO of CentOS 5.2
  2. I created my guest host using most of the basic Linux settings, 256 MB RAM and an 8GB hard drive (the great thing about VMWare is those values are so easy to change later
  3. I set the VMWare configuration to boot off of the CentOS netinstall ISO and started it up
    1. I am installing the text version of CentOS only
    2. Select English language and US keyboard
    3. Installation source -> HTTP
    4. Enable IPv4 w/ DHCP was selected by default, I left that setting in place
    5. HTTP Setup
      1. Website Name: mirror.centos.org
      2. CentOS Directory: centos-5/5.2/os/i386
    6. Initialize the hard drive
    7. I selected “Remove all partitions on selected drives and create default layout” because I’m not that concerned with the specific directory structure and I can always add another virtual hard disk if I need more space.
    8. I got a memory warning that there isn’t a lot of memory on my machine, and a swap file is required right away.  I selected, “Yes”
    9. Use GRUB as the book loader
    10. I didn’t add any additional GRUB options or a GRUB password
    11. I left only my CentOS install as the only OS to attempt to boot
    12. Boot Loader goes in the MBR
    13. Configure the eth0 network interface = yes
    14. I turned off IPv6
    15. DHCP IP address
    16. Set my timezone
    17. Set the root password
    18. Software selection -> I selected “Customize Software Selection”
      1. Remove everything but Base
      2. Done
    19. Thanks to Comcast, my 540 MB netinstall took less than 10 minutes.
    20. Before you reboot your VM, edit the CD-ROM settings so it’s not connected and is set NOT to connect at power on.
    21. Reboot
    22. After the reboot completes, you will be prompted with some additional configuration options.  These are really up to you. I edited:
      1. The firewall settings, leaving it enabled, but opening ports 22, 80, 443, and 1900 (for RoR)
      2. Network settings to use a static IP address
      3. Some of the system services and turned off stuff I don’t need
    23. Login to localhost
    24. type, yum update, to get your system fully up to date
    25. There are a number of additional configuration steps to finish the CentOS install, but what exactly you do from here will be up to you.  I recommend at least creating a user so you can login as someone other than root, and update your SSH settings so that root cannot login.
    26. Next, I change from the VMWare console to an SSH client (keep in mind, that without completing your OS install properly you really are running the server at a greater risk level)…

Ruby on Rails

  1. at the command prompt in your ssh client run, yum -y install ruby ruby-rdoc ruby-devel mysql-devel gcc
  2. next run (check http://rubyforge.org/projects/rubygems/ for latest version), wget http://rubyforge.rubyuser.de/rubygems/rubygems-1.3.1.tgz
  3. tar xzf rubygems-1.3.1.tgz
  4. cd rubygems-1.3.1
  5. ruby setup.rb
  6. gem update –system
  7. gem install mysql –no-rdoc –no-ri — –with-mysql-config=/usr/bin/mysql_config
  8. gem install mongrel_cluster –no-rdoc –no-ri
  9. /usr/sbin/adduser -r mongrel
  10. mkdir /etc/mongrel_cluster
  11. cp /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/resources/mongrel_cluster /etc/init.d/
  12. sudo chmod +x /etc/init.d/mongrel_cluster
  13. /etc/init.d/mongrel_cluster start && /sbin/chkconfig mongrel_cluster on
  14. mkdir /var/www
  15. mkdir /var/www/apps

That should get you far enough to install your first Ruby on Rails app.  I’m sure I’ll follow up this post with more details about that part of the process.

3 comments so far

Add Your Comment
  1. Hi, good post. I have been wondering about this issue,so thanks for posting. I’ll definitely be coming back to your site.

  2. Have you load tested your CentOS VM?   We are seeing a huge degradation of performance running Ruby on CentOS VM.

    • I have not done any load testing. I really only use the CentOS VM for development purposes and have not run any production apps in that setup. The hardware running VMWare will for sure effect how well the CentOS guest runs, but I would not be surprised if it’s not fast enough for production.

/Good/Bad/Tech