19 12 / 2011

Setting Virtual domain with XAMPP for mac

Sudo Edit the file /Applications/XAMPP/etc/extra/httpd-vhosts.conf
Refer to the examples in the file.

Insert Include conf/extra/httpd-vhosts.conf into /Applications/XAMPP/etc/httpd.conf

Edit /etc/hosts and insert an entry for your doman that points to 127.0.0.1

Edit: For Lion users, add ::1 for every localhost domain that you have. This will speed things up a lot! source: http://stackoverflow.com/questions/6841421/mac-osx-lion-dns-lookup-order

127.0.0.1 localhost
::1 localhost

Have to create a localhost domain when you are using virtual domains.

This is the default:

<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/htdocs"
ServerName localhost
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common

<Directory "/Applications/XAMPP/htdocs">
Options -Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>