Virtual Hosts
In an effort to clean up my URLs for my personal Web site as well as the wiki I have been running, I decided to add virtual hosting to my Ubuntu Hardy (8.04) box. The most difficult and time consuming part of it was keeping what I was doing straight. I was frustrated as hell with it until I realized that I had to continualy clear my cache of my Firefox broswer when I wanted to test a new setting in the /etc/apache2/sites-available directory.
The process included:
- enabling the virtual hosting module (a2enmod vhost_alias)
- creating virtual host config files in /etc/apache2/sites-available
- enabling the new virtual sites (a2ensite sitename)
- restarting apache (apache2ctl restart)
I’ve created multiple domains now on this single server which point to different DocumentRoot directives in the sites-available directory (including boswellwiki.com, sidboswell.com, blog.sidboswell.com).
Prior to this, I had used my domain registrar to forward URL requests and in some places mask the true domain. This never was really what I wanted so I’m glad that I spent the time to enable and figure out virtualization.
As I mentioned, I was a bit frustrated as I would make a minor change to test something, restart Apache and then reload from my browswer window to no avail. I learned the hard way that sometimes it’s best to clear your cache when testing changes made on the server.