mkdir -p /var/www/example.com/webroot
cd /var/www/example.com/webroot
wget http://joomlacode.org/gf/download/frsrelease/18323/80368/Joomla_3.1.1-Stable-Full_Package.zip
unzip Joomla_3.1.1-Stable-Full_Package.zip

You may have an issue, needing to hack the code to make it work:

Once installation is done, save the configuration and remove installation folder.

nano configuration.php
mv installation installation.off