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

OK, the title may be a bit confuse.

I have a TrueCrypt container that gets mounted as a new drive X: on my Windows machine. Now I want my local testing Apache to deliver files from there via http://x.localhost:

<VirtualHost *:80>
    DocumentRoot "X:/htdocs"
    ServerName x.localhost
    <Directory "X:/htdocs">
        Order allow,deny
        Allow from all

So far so good. When the TrueCrypt container is mounted, all is well. My problem starts when there is no drive 'X:' (which is unfortunately the regular case). Then, Apache refuses to start because it complains about missing folders for DocumentRoot and the <Directory> directive.

Is there a possibility to have some savvy switch implemented so that Apache does start even if no drive X: is present?

share|improve this question
up vote 2 down vote accepted

Under unix, Apache will warn about a document root missing, but will still continue.

You could try:

DocumentRoot C:/
Alias / X:/htdocs
<Location "/">
    Order allow,deny
    Allow from all

You specify a docroot that does exist. You probably want a better directory, probably one that's empty. Next we alias the root uri on top to the docroot. Finally, we use a uri based block rather than a path based block.

share|improve this answer
Cool, that worked. I used the Alias directive in a former try, but somehow I didn't get it right (I remember. The alias must end with a slash, that is, at least under Windows). – Boldewyn Oct 27 '09 at 11:43

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.