These commands will install the ruby libaries in /var/lib/gems/1.9.1/. You can now to deploy the Ruby on Rails app to the web server. You may need a few development pacakage for mysql, xml and xslt, so you may need to install the following.</p>
Once this is complete change to the directory and run
/var/lib/gems/1.9.1/bin/bundle install
This will install all the required Gems for the application.
Now we need to install passenger.
gem1.9.1 install passenger
If you use Apache, you will then need the passenger apache module. This requires a number of development libraries, that might not be installed. They can be installed using:
apt-get install build-essential libssl-dev zlib1g-dev apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev
Once that is complete run the following:
/var/lib/gems/1.9.1/bin/passenger-install-apache2-module
vi /etc/apache2/mods-available/passenger.load
a2enmod passenger
/etc/init.d/apache restart
Bacula is a enterprise open source network backup system that can backup all your servers to a central place.
It works by running a Bacula File Service on each server that communicates to a central controller that manages the backup and restore requests to storage daemons. I use a Netgear ReadyNAS and these can run the Bacula Controller and Storage daemons therefore keeping your backup solution in one place.
SSH is a great service, however it is open to dictionary attacks that can allow hackers to get access of the server.
One great tool for limiting the success of the dictionary attacks against your ssh services is DenyHosts. This monitoring the authentication logs of your server and if it detects 3 failed logins from an ip address, it adds that ip address to /etc/hosts.deny.
To improve the service further, it has an optional distributed service that will notify you of ip addresses that are actively attempting to login to ssh servers by synchronising with a central server. Therefore you can block an ip address before it even attempts to login to your server.
The only downside of DenyHosts, is useless developers/users of your servers have a tenancy to forget their passwords occasionally and they then get totally blocked from the server, but that can be easily fixed.
With web page designs becoming richer with additional css, javascript and other media it is important to minimise the
number of requests a browser has to make to download a web page. By using Expires headers you can stop the
unnecessary HTTP requests on all subseqent pages using the same css/javascript and media.
An additional benefit of using expires headers is they reduce the number of requests, allowing web pages to load
quicker and use less bandwidth. This can have additional benefits if your visitors have limited bandwidth (for
example accessing the site via a mobile)
For Apache the quickest way is to add the following to your .htaccess file.
<FilesMatch "\.(gif|png|jpg|css|js|swf|flv|ogg)$">
ExpiresActive On
ExpiresDefault "access plus 4 weeks"
FileETag none
</FilesMatch>
This will send an expires header allowing the file to not be requested for 4 weeks for all files having the
extensions .gif, .png, .jpg, .css, .js, .swf, .flv and .ogg.
For the above to work you need to ensure that the Apache mod_expires is enabled. In debian/Ubuntu this can easily be
done by running
a2enmod expires
Issues
Any files with caching headers need to have a versioned filename, otherwise the changed files will not be
downloaded when they are updated until the expires date has passed