Using VMWare to install Ruby on a CentOS5 guest
1 Comment so far
Leave a comment
It looks like to get started with actual development, I’ve decided to install CentOS 5 as a guest host on my VMWare server. This the process I went through. Much thanks to a post on the Rubyonrails.com wiki.
CentOS 5
- Download the NetInstall ISO of CentOS 5.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
- I set the VMWare configuration to boot off of the CentOS netinstall ISO and started it up
- I am installing the text version of CentOS only
- Select English language and US keyboard
- Installation source -> HTTP
- Enable IPv4 w/ DHCP was selected by default, I left that setting in place
- HTTP Setup
- Website Name: mirror.centos.org
- CentOS Directory: centos-5/5.2/os/i386
- Initialize the hard drive
- 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.
- 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”
- Use GRUB as the book loader
- I didn’t add any additional GRUB options or a GRUB password
- I left only my CentOS install as the only OS to attempt to boot
- Boot Loader goes in the MBR
- Configure the eth0 network interface = yes
- I turned off IPv6
- DHCP IP address
- Set my timezone
- Set the root password
- Software selection -> I selected “Customize Software Selection”
- Remove everything but Base
- Done
- Thanks to Comcast, my 540 MB netinstall took less than 10 minutes.
- Before you reboot your VM, edit the CD-ROM settings so it’s not connected and is set NOT to connect at power on.
- Reboot
- After the reboot completes, you will be prompted with some additional configuration options. These are really up to you. I edited:
- The firewall settings, leaving it enabled, but opening ports 22, 80, 443, and 1900 (for RoR)
- Network settings to use a static IP address
- Some of the system services and turned off stuff I don’t need
- Login to localhost
- type, yum update, to get your system fully up to date
- 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.
- 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
- at the command prompt in your ssh client run, yum -y install ruby ruby-rdoc ruby-devel mysql-devel gcc
- next run (check http://rubyforge.org/projects/rubygems/ for latest version), wget http:
//rubyforge.rubyuser.de/rubygems/rubygems-1.3.1.tgz - tar xzf rubygems-1.3.1.tgz
- cd rubygems-1.3.1
- ruby setup.rb
- gem update –system
- gem install mysql –no-rdoc –no-ri — –with-mysql-config=/usr/bin/mysql_config
- gem install mongrel_cluster –no-rdoc –no-ri
- /usr/sbin/adduser -r mongrel
- mkdir /etc/mongrel_cluster
- cp /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/resources/mongrel_cluster /etc/init.d/
- sudo chmod +x /etc/init.d/mongrel_cluster
- /etc/init.d/mongrel_cluster start && /sbin/chkconfig mongrel_cluster on
- mkdir /var/www
- 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.
1 Comment so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Wow, it’s great to see someone using (and giving props to) that guide I wrote on the wiki. I hope everything is working well with your server setup and your startup
Comment by Brazen January 12, 2009 @ 4:18 pm