I'm hosting my website on my own server running OSX 10.6.6. I have the main site up all fine with www2.chrislrobinson.co.uk pointing to my IP address (and hence the /Library/WebServer/Documents/ directory). My blog is located at www2.chrislrobinson.co.uk/blog but I would like to add to access it through blog.chrislrobinson.co.uk. My understanding is that I need to enable virtual hosts but I can't seem to get it to work properly.

So far, I've enabled the virtual host bit in /private/etc/apache2/httpd.conf. I've added

<VirtualHost *:80>
DocumentRoot "Library/WebServer/Documents/blog"
ServerName blog.chrislrobinson.co.uk

to /private/etc/apache2/extra/httpd-vhosts.conf and blog.chrislrobinson.co.uk

to /private/etc/hosts. After restarting apache, not only does blog.chrislrobinson.co.uk not work, but I get the message

Forbidden You don't have permission to access /blog/ on this server.

I'd appreciate any help you guys can give. Thanks Chris


Check your httpd.conf for your Allow/Deny permissions. You probably need to add a <Directory /Library/Webserver/Documents/blog> directive within the VirtualHost to allow accessibility.

Also, you're missing your leading / in the VirtualHost path.

  • Thanks for that. My user/group are both set to _www and everything now seems to work when I set the ServerName line in httpd.conf to www2.chrislrobinson.co.uk:80. However, using the above settings (albeit with the corrected leading /), blog.chrislrobinson.co.uk directs me to www2.chrislrobinson.co.uk (or /Library/WebServer/Documents). Am I still doing something wrong?
    – Sonoman
    Jan 26 '11 at 8:41
  • I assume in your vhosts.conf you have added/uncommented 'NameVirtualHost *', correct? You could try moving ww2.chrislrobinson.co.uk to a vhost as well to see if it continues to override blog.
    – M. Early
    Jan 26 '11 at 20:32

you should use Server Admin for such a task. The reason is that it's not easier or better but if you make any changes from the command line, you will get Server Admin GUI out of sync with the real status of the configuration. To solve your problem use Redirect Directive. More info is here:


  • Sorry I should mentioned that I am running 10.6.6 client, not server. Can you recommend another GUI for server admin?
    – Sonoman
    Jan 26 '11 at 10:01
  • Oh, I was confused from your original post. Follow the link I sent you if you want to go the command line way. Otherwise install a control panel like Webmin, Plesk etc. Just google for it
    – BobC
    Jan 26 '11 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.