Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've looked at Apaches documented Dynamically configured mass virtual hosting, from which I've taken

UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /tmp/access_log vcommon
VirtualDocumentRoot /var/www/localhost/htdocs/%0/web
VirtualScriptAlias /var/www/localhost/htdocs/%0/web

My expectation is that for my local development server, this will save me from needing to set up a new vhost file for every new domain I start with.

  1. To make sure Apache is picking up the file, I add some junk, "dlkmvasp" to the top, check that I get a syntax error, remove junk, and restart the server again.
  2. I add a few domains to /etc/hosts, and try to access
  3. "tail -f /tmp/access_log" now yields " - - [04/Mar/2012:11:37:03 +0100] "GET / HTTP/1.1" 403 265"

How do I debug this? I can post all the vhost config is it's helpful, I just didn't wanna start of with a wall of text if it is not necessary.

share|improve this question
up vote 2 down vote accepted

Since you're getting a 403 rather than a 404 it looks like it's being found; do you just need something like:

<Directory /var/www/localhost/htdocs>
    Order allow,deny
    Allow from all


share|improve this answer

In your example will have a DocumentRoot of /var/www/localhost/htdocs/

Check that the path /var/www/localhost/htdocs/ and files in the web directory have suitable permissions to allow Apache to access them. For the directories apache will need r-x permissions and for the files it will need r--

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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