Installing Java on Ubuntu Intrepid
April 22nd, 2010 by pyratAlways doing this on different ubuntu versions and always having to look it up.
Always doing this on different ubuntu versions and always having to look it up.

Ghost is a nice way to configure your development machine for subdomain based application access.
This is rails specific to a certain extend and involves setting the expires header on static asset to make browsers cache. This can be dangerous so is best used with timestamped css and javascript assets.
By default: rails helpers will add a timestamp onto the end of the asset so when you redeploy the file the browsers will recache the file because the timestamp has changed.
eg.
<script src="/javascripts/all.js?1242919746" type="text/javascript"></script>
To setup mod_expires apache on debian based:
sudo a2enmod expiresThen in your config
ExpiresActive On <FilesMatch "\.(js|css)$"> ExpiresDefault "access plus 1 year" </FilesMatch>
You can easily add image types to this as well but often css loads images and designer often forget to use these helper methods. So in the real world just doing it with js and css makes it safer to do with maximum performance gain.
When doing some performance tuning for iformis I have noticed a lot of HTTP overhead in serving pages in modern web applications. This is often due to image heavy designs, large javascript libraries and since the average connection speed of clients has increased, asset number and size are being pushed to the background.
By default apache does not perform gzip compression. I recently turned this on and along with a small increase in load I noticed a large performance increase from the client side.
To turn it on (debian / ubuntu)
sudo a2enmod deflateNow im not a fan of copy and paste configs but included below is the mod_deflate config I am currently using. At least read it before using. (Doesnt gzip certain file type and turns off some gzipping for older browsers.)
SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \ no-gzip dont-vary SetEnvIfNoCase Request_URI \ \.(?:exe|t?gz|zip|bz2|sit|rar)$ \ no-gzip dont-vary SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

Monit in the ubuntu dapper repositories is a bit old. I found the following to work
for me.
sudo apt-get install libssl-dev build-essential bison flex wget http://mmonit.com/monit/dist/old/monit-4.9.tar.gz tar xvzf monit-4.9.tar.gz cd monit-4.9/ ./configure && make && sudo make install