Always doing this on different ubuntu versions and always having to look it up.
Archive for the 'Sysadmin' Category
Ghost is a nice way to configure your development machine for subdomain based application access.
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.
To setup mod_expires apache on debian based:
sudo a2enmod expires
Then 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.
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 deflate
Now 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 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
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