06 April, 2009

VirtualHost on Leopard

Here's how I created a virtual host on my Mac OS X 10.5.x.
1. Start with 'hosts' file, might be located at /private/etc/hosts. Add following line:
127.0.0.1    your.virtual.host

2. Add virtual host to Appace. Open file /private/etc/apache2/extra/httpd-vhosts.conf and add:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<virtualhost *:80 >
DocumentRoot "/Users/username/Sites/mark-kirby"
ServerName mark-kirby.dev
</virtualhost>