When designing a new theme for this blog I discovered that the virtual hosts I had set up didn’t actually work (only having one)1. For these to work you need to use the IP address rather than an *.
This means that a definition for a host needs to look like:
/private/etc/apache2/extra/httpd-vhosts.conf
<NameVirtualHost 127.0.0.1:80>
DocumentRoot "/Library/WebServer/Documents"
ServerName localhost
DocumentRoot "/Users/user/Sites/site"
ServerName blog.dev
ServerAlias www.blog.dev
Options FollowSymLinks
AllowOverride AllThe biggest change is in that I added another definition (to ensure that the standard webserver still worked), as well as adding the local IP and port (127.0.0.1:80) to the definition. This is due to the way in which Apache 2 processes definitions, and was actually broken in the first version I put together.
As an addendum if you typeapachectl configtest into the terminal it will tell you if there are any errors in your .conf files.