homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

This 39 message thread spans 2 pages: 39 ( [1] 2 > >     
Can't start apache with a mapped network drive in vhost

 1:41 pm on Jul 9, 2009 (gmt 0)

Hi all, having a problem that I've Googled to death and can't find an answer to. I'm running apache 2.2.11 under Windows Vista Home Premium, and I'm having a problem when trying to use a virtual host with the document root on a network drive.

For example, say my mapped network drive is Z:, I'm using:
DocumentRoot z:/home/htdocs/

When I put that in, apache won't start. Now here's the weird part: if I use the full UNC path (say //remote-server/shared/home/htdocs), then apache starts just fine. The problem is, the way most of the site is configured, it is looking for that /home/htdocs directory to be the site root, not that full UNC path, so everything gets messed up. And since the files get copied directly from there to the production site, I can't really be switching code back and forth. Even more strange is a co-worker's computer is the same OS and apache version as mine and his works just fine.

And just to be clear, I can connect in Windows just fine to the network drive. I've also tried running the apache service as the user I log in with instead of Local System, and that didn't work either. Any thoughts are greatly appreciated, thanks!



 3:19 pm on Jul 9, 2009 (gmt 0)

Searching through our old threads, it seems that this is a common problem with Apache on Windows. The only thread here that seems to offer a hint at a solution is this one: [webmasterworld.com...]

The key may be (as implied by the thread) to point the DocumentRoot at a seemingly-local path, and then use an Alias to the mapped network drive name.

Also, according to the Apache documentation,

Any errors during Apache startup are logged into the Windows event log when running on Windows NT. This mechanism acts as a backup for those situations where Apache cannot even access the normally used error.log file. You can view the Windows event log by using the Event Viewer application on Windows NT 4.0, and the Event Viewer MMC snap-in on newer versions of Windows.

so you may find some useful information in the Windows event log.

If you do get a working solution, please post back! -- This seems like an unresolved problem in our forums.



 4:08 pm on Jul 9, 2009 (gmt 0)

Unfortunately the aliasing didn't work. I tried something like the below, but it gives me a warning saying it can't find "C:/foo", which doesn't exist of course.

Alias /foo/ "t:/home/htdocs/"
<Directory /foo>
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
DocumentRoot /foo/

If I remove the DocumentRoot directive, it still doesn't work. Also, the Windows logs didn't have any more information than Apache spits out with the -e debug flag set. I was hoping someone had figured this out by now, and if I get it working, I'll be sure to post back.


 11:43 am on Jul 13, 2009 (gmt 0)

I was the coworker matt was talking about. I can get it to run pefect off a mapped drive on my machine. (same setup - Vista, perl, apache 2.2)

It is clearly a permissions issue with his system, but we have tried everything to get it to work. Almost to the point of having him install XP on top of vista.

Anyone have any ideas?


 3:53 pm on Jul 13, 2009 (gmt 0)

Good old Windows!

Maybe take a look at all of the permissions, starting at the very top: Do you log into your machine as "The Administrator" while he logs in as a user (even with super-user or Admin rights)?

Maybe also poke around with the Group Policy Editor, and see if there are specific settings for mapping network drives and/or using previously-mapped drives -- or drives mapped by other 'users', etc.

Gosh, you'd think that a permissions issue that stops a process dead in its tracks would result in an error being logged *somewhere*... WinNT is *so* much better than Win9x, but it still doesn't do things properly that other OSes have been doing correctly since the early 1970s!



 4:11 pm on Jul 13, 2009 (gmt 0)

Well, he can get to the mapped drive from EVERY other program available. Apache just dies with no errors - it just won't run with the mapped drive.


 4:37 pm on Jul 13, 2009 (gmt 0)

he can get to the mapped drive from EVERY other program available

Are those programs started via the service control manager, too?


 5:55 pm on Jul 13, 2009 (gmt 0)

I recall something similar for a member once but they were using an external drive. Perhaps some of the options in this thread will help:
Using The External Harddrive [webmasterworld.com]


 8:51 pm on Jul 13, 2009 (gmt 0)

Ok, I think I fixed my problem! So the solution is a two-part one (at least for the way we have things set up here in the office).

The first part is you should use the UNC path instead of the mapped drive name. So for example, instead of using Z:/home/htdocs, you would use //FILESERVER/share/home/htdocs.

Now for the second part. (I had tried UNC paths before and it worked to start Apache, but it broke all sorts of file includes and paths). You can use an Alias directive to keep the paths from breaking. So for us, we needed something like:

Alias /home/htdocs //FILESERVER/share/home/htdocs

And then you can use:

DocumentRoot /home/htdocs

and everything will point where you want it to go.

Hope that helps someone else out there.


 9:26 pm on Jul 13, 2009 (gmt 0)

> Are those programs started via the service control manager, too?

Just any old program. Nothing balks at a mapped drive. He could install Office on the mapped drive an it would load and run fine.


 9:34 pm on Jul 13, 2009 (gmt 0)

Ok, so I spoke too quickly. While it will let me use the UNC path for the drives, the extra '//FILESERVER/share' is still throwing off the paths, even with the Alias directory. I was getting a local version of the site at the same path in DocumentRoot before, that's why I thought it was working. So still in search of suggestions...


 9:40 pm on Jul 20, 2009 (gmt 0)

never did figure it out.

anyone have a plan B for this situation?

It is just so frustrating that it works perfectly on my machine (near similar setup) and not on his.

We are contemplating installing Xp on top of his vista to fix this.


 2:45 pm on Jul 23, 2009 (gmt 0)

Have you tried asking Apache to validate your configuration?

I do all my Apache work on Linux but I'll assume this command works on Windows.

httpd -t -c httpd.conf

I'm sure it's something simple as it sounds like you're almost there but one minor path away from success. The kind of things that keep me up until 3am scratching my head that are immediately obvious when I jump out of bed at 7am suddenly knowing what's wrong.

Xp on top of his vista

Funny you mention Vista as I have 2 Vista machines and one runs any old Linux port like cURL, Wget, etc. and the other won't run cURL and I never could figure out why but Wget runs just fine so I had to retool all my scripts to use Wget instead of cURL so they worked on both machines.

Maybe it's a similar issue with something in the Vista config that I just never spent enough time hunting down.


 3:07 pm on Jul 23, 2009 (gmt 0)

The apache works fine if the doc root is NOT the mapped drive.

This works: DocumentRoot /foo/
This does not: DocumentRoot T:/foo/

This works: DocumentRoot C:/foo/
This does Not: T:/foo/

And the mapped nas T drive works perfectly with Vista for EVERYTHING else. No issues with the drive whatsoever.


 3:59 pm on Jul 23, 2009 (gmt 0)

Have you tried a different drive mapping?

You're positive the drive mapping isn't overlapping some other device such as a USB memory stick or something?

Tried rebooting? <ducks>

Only mention it because stuck software often mysteriously runs when it didn't before after a nice reboot.

[edited by: incrediBILL at 4:06 pm (utc) on July 23, 2009]


 4:06 pm on Jul 23, 2009 (gmt 0)

Here is a Question that might help shed some light on this issue. What user account is Apache running under?

The Users or Local System

If it is System, it will not have access to the mapped drive share of the user.

I am assuming the other person who has apache running, is running it under their own login and not system.


 4:08 pm on Jul 23, 2009 (gmt 0)

Ah, good point.

That makes a lot of sense.


 4:13 pm on Jul 23, 2009 (gmt 0)

Is the user you're currently logged in as part of a Windows domain or just standard local-based user/pw security?

What user account is Apache running under?

This is a very important question as well. As Ocean said, the local system user does not have access to the mapped network resources. Go into services and make sure Apache starts as your user instead of the local system account.

FWIW, ANY service will have this problem post Windows XP. This is not an apache specific issue.


 4:31 pm on Jul 23, 2009 (gmt 0)

Vista Home/XP Home Editions can not be part of a domain.


 4:40 pm on Jul 23, 2009 (gmt 0)

Slightly off topic, but I think Ocean may have figured out my cURL problem too as one was installed differently than the other, interesting how things are broken down in Vista security.


 6:21 pm on Jul 23, 2009 (gmt 0)

Unfortunately, I've already tried (and just tried again, to confirm) changing the Apache process to run as another user, and it doesn't work for me. I ran it as myself and as a new 'apache' user I created as an admin to run the process. I've also made sure that the mapped drive was created with my user account.

Ocean--does I need to be a part of a domain for this to work, is that what you were implying?


 6:30 pm on Jul 23, 2009 (gmt 0)

No, for this you do not want to be part of a domain. He was answering my question - I missed the fact that you were on Home edition.

When you go into Control Panel, Users, then click "manage network passwords" on the left side, do you have a stored network password for the server?


 6:40 pm on Jul 23, 2009 (gmt 0)

Nope, no network passwords stored there, and the server doesn't have one to access it...


 6:43 pm on Jul 23, 2009 (gmt 0)

clarification: it is not a "server" really - it is a NAS (buffalo terastation). we have also tested it with a mapped drive on another xp and vista box and neither would work their either (so I am fairly confident, it is not an issue with the drive itself)

[edited by: Brett_Tabke at 7:31 pm (utc) on July 23, 2009]


 7:00 pm on Jul 23, 2009 (gmt 0)

Shouldn't you omit the trailing slash when you define the document root?

I'm not saying that will fix this issue, but it can cause several other problems.


 7:00 pm on Jul 23, 2009 (gmt 0)

Nope, no network passwords stored there, and the server doesn't have one to access it...

Try adding a blank password for the server to that dialog box. That way credentials are cached.


 7:24 pm on Jul 23, 2009 (gmt 0)

Is Windows Firewall enabled?

If it is try disabling it to see if it is causing problems. Disable, means set it to manual or disabled in the services window, then reboot to make sure its completely out of memory. It has a habit of not fully unloading even when stopped.


 7:32 pm on Jul 23, 2009 (gmt 0)

> Is Windows Firewall enabled?

We have turned it completely off for testing.


 8:12 pm on Jul 23, 2009 (gmt 0)

Did you try to run apache via console and not via the service control manager?


 1:15 am on Jul 24, 2009 (gmt 0)

Wrong path, use this:

DocumentRoot "z:\home\htdocs\"

This 39 message thread spans 2 pages: 39 ( [1] 2 > >
Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved