php commandline on ubuntu
November 20th, 2007 by pyratTested on Ubuntu LTS 6.06
sudo apt-get install php5-cli
Tested on Ubuntu LTS 6.06
sudo apt-get install php5-cli
There is a great slicehost article which goes into more detail than this. But the following script will install it from source in one go!.
#!/bin/bash sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev wget http://sysoev.ru/nginx/nginx-0.5.33.tar.gz tar -zxvf nginx-0.5.33.tar.gz cd nginx-0.5.33 ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module make sudo make install cd ~ cd sources sudo wget http://notrocketsurgery.com/files/nginx -O /etc/init.d/nginx sudo chmod 755 /etc/init.d/nginx sudo update-rc.d nginx defaults

Ubuntu Dapper will only install ruby as high as 1.8.4 which is not ideal sometimes. To upgrade an existing ruby installation to 1.8.6 do the following.
sudo apt-get install build-essential sudo apt-get install libreadline5 libreadline5-dev wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz tar -xzf ruby-1.8.6.tar.gz cd ruby-1.8.6 ./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local make sudo make install
Even if you had rubygems you need to install it and all your gems! Again.
wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz tar -xzf rubygems-1.1.1.tgz cd rubygems-1.1.1 sudo ruby setup.rb
Now this is where you need to do a little fix. Openssl will not work out of the box and some application need it so you should just set it up now.
Note: If apt-get libssl-dev complains about a not found run: sudo apt-get update
sudo apt-get install libopenssl-ruby sudo apt-get install libssl-dev cd ~/src/ruby-1.8.6/ext/openssl ruby extconf.rb make sudo make install
And thats it!

I have been doing a bit of sysadmin stuff with iformis recently which has involved a bit of virtual host configuration for a number of sites. Although Nginx is top for rails, apache is still the king of PHP.
We use apache in a debian / ubuntu environment so I have gone and written a wee gem to make vhost configuration a bit easier.
1. Install apacheconf
sudo gem install apacheconf
2. Setup YAML Config
site_name: fun
server_name: fun.com
server_alias: www.fun.com
document_root: /var/www/apps/fun
3. Run apacheconf
apacheconf –enable fun.yml
4. There is no step 4!

Please contact me with any issues and ideas for improvements.
For installing mysqli extension after PHP is installed on a Linux ubuntu or debian.
NOTE: after install, you need to reboot apache
This allows HTTPS, HTTP and SSH traffic on a non standard port.
Monit is great for keeping your services online. I use them for keeping my collection of slices online when I am asleep.
The example monitrc is a great starting point of listing the services which you should be monitoring.
One thing: monit can have its own little http server which runs internally. This is off in the example config as you have to explicitly enable it.
I hope to release a monit config generator gem in the near future which makes this a lot quicker.

I have recently been moving some sites from shared hosting to my vps. And one of the benefits of shared hosting is a shiny cpanel installation which provides controls for working with email. Something which a barebones vps installation lacks. (Which is not a bad thing ![]()
Whilst it is good to have postfix configured so your site can send email I am now of the mind that it is easier and a better use of resources to outsource the incoming email to google apps.
It is still free for the time being and all you need to do is add a few MX records to allow google to handle your mail and you are cooking on gas.
Also there is the ability to create domain aliases, so you can have multiple domains running through one google apps account. (Assuming you want to do this).
I was too short on time to learn the ins and outs of postfix so im using yet another google web service solved my problems.