A blog post

Apache VirtualHosts On Leopard OSX Made Simple

Posted on the 01 November, 2008 at 3:21 am Written by admin in OSX

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:

  1. 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.

  2. 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!

reply