The whole process was described in this article, but there are few quirks to fix in newer Ubuntu (namely 13.10 / Apache 2.4).
- Every config file in sites-available has to have a .config extension now, so instead of
sudo nano /etc/apache2/sites-available/project
use
sudo nano /etc/apache2/sites-available/project.config
if upgrading fist add the extension to the /etc/apache2/sites-available/project config file, then delete /etc/apache2/sites-enabled/project and re-run “sudo a2ensite project” / restart apache. - If your project root is located in your home directory you might get a persistent 403 / Forbidden error, that (weird as it is) has nothing to do with Linux permissions. To fix it add “Require all granted” directory directive. Here is how the new config file might look:
<VirtualHost *:80>
DocumentRoot /home/user/project
ServerName project.localhost
<Directory /home/user/project>
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
So here are updated instructions for Ubuntu 13.10+ (and maybe some older versions). Continue reading