I am trying to add a vhost for a specific project located within my MAMP htdocs folder.
Steps I did:
Open /Applications/MAMP/htdocs/conf/apache/httpd.conf
and uncomment the Include /Applications/MAMP/htdocs/conf/apache/extra/httpd-vhosts.conf
line.
Open /Applications/MAMP/htdocs/conf/apache/extra/httpd-vhosts.conf
and removed both demo vhosts, and added the following:
<VirtualHost *:80>
DocumentRoot /Applications/MAMP/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/arko/Sites/mysite"
ServerName mysite
</VirtualHost>
Edit hosts file: sudo vim /etc/hosts
and added this line:
127.0.0.1 mysite
My hosts file now looks like this:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# MAMP Virtual Hosts
127.0.0.1 mysite
Then I opened up my MAMP and restarted the servers (stop servers, then started servers).
Whenever I go to http://mysite/
I just get the contents of /Applications/MAMP/htdocs
(a ugly list of all my folders in there, since I have no index file in my htdocs
folder.
So it seems like it is ignoring my vhost, and just using my hosts file to route http://mysite/
to 127.0.0.1
(localhost)
Update
When I go to http://mysite/ I get this error in my apache error log:
[Wed Mar 16 11:04:39 2016] [error] [client 127.0.0.1] client denied by server configuration: /Applications/MAMP/htdocs/.DS_Store