Serving files with Apache on Windows from a network drive

After I installed Zend Server CE today I had to configure Apache to serve files from a shared network drive. Although these have been given a drive name serving files from it with Apache fails to work.

By default Apache under Windows (or generally any service) is being executed as a local user. This user doesn’t have network rights, and normally shouldn’t have any. But in my case it should. So to get this all working I opened the Windows administration tool for services and modified the Apache service to be run as some other user, in my case DOMAIN\username.

After having done that I configured my Apache configuration to serve files from a shared network drive. To my surprise it still didn’t work and my path was correct… For Windows that is. Windows use the backward slash, for example, \\MYSERVER\Projects\example.com. But for this to work with Apache you have to substitute the backward slashes with forward slashes, like this: //MYSERVER/Projects/example.com.

If you do this all should be well and you can serve files from your network through your locally installed Apache.

Scroll to Top