Well, here it is - the third and final part to this guide for installing and configuring your own personal Ruby on Rails / PHP webserver using Ubuntu. Today I will quickly cover the setup of Exim for mail, and CVS for source code control. So, lets begin!
Exim will allow all of our PHP and Rails applications to send email (a necessity for most web apps today). This will be a pretty painless install and setup - again many thanks to apt-get. So, with your shell konsole open, type the following and hit enter:
sudo apt-get install exim4
Apt get will spit out the following "The following NEW packages will be installed: exim4 exim4-base exim4-config exim4-daemon-light" which is exactly what we want. After we hit Y, the system will churn away for a few moments until finally Exim is installed. Now, to finish the install, and make certain everything will work fine with your system - run the following command and answer the straightforward questions:
sudo dpkg-reconfigure exim4-config
After running through the configuration setting selection - Exim should be properly working on your machine. Now, lets move on to installing and using CVS. This should also be fairly painless - so lets go.
sudo apt-get install cvs cvsd
Cvsd will provide us with more options that could increase security if you apply them correctly. Feel free to look into cvsd and all its options. For this demonstration I will setup one repository and make certain the config files are ready for connections.
So, after installing via apt-get we will need to do the following (as a note, cvsd is automatically installed in /var/lib/cvsd):
sudo cvsd-buildroot /var/lib/cvsd
sudo mkdir /var/lib/cvsd/myfirstrepository
sudo cvs -d /var/lib/cvsd/myfirstrepository init
At this point cvsd is setup with its root being /var/lib/cvsd. Inside the root path we created a directory for our first repository (change this accordingly for your repository's name - likewise replace it wherever else you see it). The final command initiates our directory as a repository and adds a bunch of fun files inside to help manage everything.
Now we will set the ownership for the files in our repository, create a couple usernames and passwords to access it, and check the values in our config.
sudo chown -R cvsd:cvsd /var/lib/cvsd/myfirstrepository
sudo cvsd-passwd /var/lib/cvsd/myfirstrepository user1
sudo cvsd-passwd /var/lib/cvsd/myfirstrepository user2
sudo nano /var/lib/cvsd/myfirstrepository/CVSROOT/config
Inside the config we will want to make certain that the following option is set to no:
# Set `SystemAuth' to `no' if pserver shouldn't check system users/passwords.
SystemAuth=no
And finally we will want to check our main config file:
sudo nano /etc/cvsd/cvsd.conf
And make certain that the following is at the bottom:
Listen * 2401
Repos /myfirstrepository
Thats it! Now you have email and cvs setup ready for your use. If you are having any problems try restarting both Exim and Cvsd --
sudo /etc/init.d/exim4 restart
sudo /etc/init.d/cvsd restart
Well that wraps it up for this series. Now that we have a fully documented "How To" for a complete Ruby on Rails hosting server we can continue working on learning the Rails framework. As a recap - these posts covered installing and configuring: Ruby 1.8.4, Rails 1.1.6, Ruby Gems .9, MySQL 5, PHP 5 CGI, Lighttpd 1.4.13, Exim 4, Cvsd 1.0.12, and Vsftpd 2.0.4. Although all of this working without problem on my machine - I cannot guarantee that this How To is completely accurate in all setups or even the best way to do it. If anyone sees any part that I should review - please leave me a comment!
My new years resolution? To learn more about RoR and document as much as possible, of course! Until next time, happy coding. =)
