I have followed this guide and am trying to create dynamic vhosts on OSX by allowing
foo.dev to direct to the web folder
/foo. My difference being that I am using
~/Sites as my web folder instead of the Mac HD as in the guide. It uses dnsmasq which I believe is installed and working correctly.
So in my ~/Sites folder I have:
home sites |-foo |-bar
My httpd-vhosts.conf looks like this:
<Virtualhost *:80> DocumentRoot "/Users/harryg/Sites/home" ServerName home.dev UseCanonicalName Off ErrorLog "logs/home/error.log" <Directory "/Users/harryg/Sites/home"> #Options FollowSymLinks Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> </Virtualhost> <Virtualhost *:80> VirtualDocumentRoot "/Users/harryg/Sites/sites/%1" <Directory "/Users/harryg/Sites/sites/%1"> Options FollowSymLinks #Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> ServerName sites.dev ServerAlias *.dev UseCanonicalName Off </Virtualhost>
The first vhost works fine and going to
home.dev leads to the example
index.php file I have in the root of that vhost.
The 2nd vhost just gives a 403 Forbidden error for anything.dev, whether or not a folder exists for the subdomain of .dev.
Latest Log entries
Apache Error Log:
[Wed Dec 18 00:45:37 2013] [error] [client 127.0.0.1] File does not exist: /Users/harryg/Sites/home/favicon.ico [Wed Dec 18 00:45:45 2013] [error] [client 127.0.0.1] client denied by server configuration: /Users/harryg/Sites/sites/test/, referer: http://home.dev/ [Wed Dec 18 00:45:45 2013] [error] [client 127.0.0.1] client denied by server
Server now works (was a problem with error log directory in config file). But still can't access dynamic vhosts.