How to setup virtualhost in Mac OS X 10.9.1 Maverick

Submitted by admin on Thu, 02/06/2014 - 21:06

In case you are not using MAMP, you might need this tip whether if you want to avoid the killer "Forbidden" message when you try to access to document root :)

1. Go to

sudo nano /etc/apache2/httpd.conf

and uncomment line number 478

Include /private/etc/apache2/extra/httpd-vhosts.conf

2. Go to


y put something like

<VirtualHost *:80>
DocumentRoot "/Library/Webserver/Documents/mtnforum7/"
ErrorLog "/private/var/log/apache2/"
CustomLog "/private/var/log/apache2/" common
<Directory /Library/Webserver/Documents/mtnforum7/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

3. If you need redirect a domain, go to

nano /etc/hosts

y put inside something like

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
## localhost broadcasthost
::1 localhost
fe80::1%lo0 localhost