Windows – Apache UNC network path under Windows

apache-2.2network-shareuncwindows

Ok, so I'm running apache on two Windows 7 boxes for use as a test environment. The idea is to keep all projects on a shared network path so I can access it with my desktop or notebook anytime.

Running apache as a console using my user account, MyAccount, with access to the network path gives the following error: Warning: DocumentRoot [C:/EMMA/users/*MyAccount*/Documents/*MyWebsite*/] does not exist

All I've done is included the httpd-vhosts.conf file in httpd.conf and added the following to the vhosts config:

<VirtualHost *:80>
    DocumentRoot "\\EMMA\users\MyAccount\Documents\MyWebsite"
    ServerName MyWebsite
    ErrorLog "logs\MyWebsite-error.log"
    CustomLog "logs\MyWebsite-access.log" common
    <directory "\\EMMA\users\MyAccount\Documents\MyWebsite">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    </directory>
</VirtualHost>  

The windows hosts file is setup correctly, as changing the path to the local apache htdocs works fine and I can access the local site without problems in a browser.

My confusion is thus; The apache manual states that apache can not access a network path as a user without access to the network path. However, since the apache console is running as MyAccount which definitely has access to the network path, why isn't this working? I've check the process Menu and it's definitely running under MyAccount and not System. For some reason based on the error message apache is trying to look at a local directory and not a network directory?

Any ideas? If I can figure out why apache is trying to access the network path as a local path I think that should fix it, but I'm at a total loss here.

Best Answer

ID10T Error!!! I needed to use forward (/) slashes instead of backslashes () in the DocumentRoot and configurations. My heard hurts, but my problem is solved. I shall leave this here for posterity and humility.