Turns out the update sort of reset things back to default. Here's what I did to get it to work (This worked for me on Ubuntu 9.10 Karmic Koala):
The localhost directory was set to /var/www
so to change that you will need to edit the default virtual host config file in /etc/apache2/sites-available. Make sure to change both the DocumentRoot
and <Directory >
values.
sudo nano /etc/apache2/sites-available/default
To create a virtual host, create a file in /etc/apache2/sites-available
sudo nano /etc/apache2/sites-available/mysite
Here's an example of what you should put in the virtual host file:
<VirtualHost *:80>
ServerName myvirtualhostname
ErrorLog /var/log/apache2/myvirtualhostname-error.log
CustomLog /var/log/apache2/myvirtualhostname-access.log combined
DocumentRoot /home/name/Projects/myvirtualhostname/public
<Directory /home/name/Projects/myvirtualhostname/public>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Next you will want to enable your virtual host. You can do so by running the "Apache 2 Enable Site" command with the name of the file you created in sites-available
:
sudo a2ensite mysite
You may also need to add your virtual host name to your /etc/hosts
file.
Now restart Apache for it to take affect:
sudo /etc/init.d/apache2 restart
Bonus! If you want to get rid of that message that says "Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName" you can create a config file in /etc/apache2/conf.d/
called fqdn
with the value of ServerName localhost
. You can do this in a single command like this:
echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
For more information, check out setting up Apache, PHP, and MySQL on Ubuntu.