# Apache
sudo aptitude install apache2 apache2-mpm-prefork apache2-utils apache2.2-common
sudo a2enmod rewrite
# Server name
echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
# Restart Apache
sudo service apache2 restart
# PHP
sudo aptitude install libapache2-mod-php5 php5-cli php5-mysql php5-curl php5-mcrypt php5-gd php5-xcache php5-xdebug
# PHP development settings
sudo mv /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini.bak
sudo cp -s /usr/share/php5/php.ini-development /etc/php5/apache2/php.ini
# Apache user dir
# http://www.techytalk.info/enable-userdir-apache-module-ubuntu-debian-based-linux-distributions/
sudo a2enmod userdir
sudo service apache2 restart