Several websites are available as useful resources for configuring your Leopard osx to handle virtual hosts on Apache2.
- http://mymacinations.com/2007/10/28/apache-php-and-mysql-on-leopard/
- http://www.givegoodweb.com/post/53/cakephp-leopard-virtual-hosts
If you’re too lazy to read, here’s what the two websites above in summary:
- Edit /etc/apache2/extra/httpd-vhosts.conf and type in the following:
NameVirtualHost *<VirtualHost *>
ServerName “website.dev”
DocumentRoot “/www/website”
</VirtualHost>This tells the Apache2 where the site files are located locally.
- Edit /etc/hosts and type in the following:127.0.0.1 website.dev
This tells the system that the domain website.dev points to the localhost.
Oh, and do not forget to restart your Web Server!
Done and done!
