hares-recovery

Random Fix Theatre

Posted by Derek
May 05 2010

Took a few minutes today to help someone with an Xampp installation. He needed to do three things:

  1. NameVirtualHosts, so that different dyndns-style hostnames would point to different virtual servers on the same box. No problem, he had NameVirtualHost working.

  2. Create a second virtualhost to deliver a directory index of a specified DocumentRoot, and

  3. Point that DocumentRoot at a network share mounted on a windows XP drive letter (B: -> \Server\Share)

Apache would explode. “DocumentRoot must be a directory” and refusal to start. After installing Xampp myself and fooling around for about 20 minutes I found that the DocumentRoot worked fine on a local drive, but not a network share on a drive letter.

So, since B:/ didn’t work, yet C:/ would let the server start, I threw //Server/Share/ at mine and it fired right up, gave the listing. Tada.

<3

Eeexcept it wouldn’t work for him.

After another hour of back and forth on IRC and emailing the config file back and forth (DCC wouldn’t work either but I blame my clearaccess modemrouter), I’m finally ready to declare it a ‘feature’ of windows XP. He had Xampp set up on an XP box, the files to be listed on a windows 7 box, and while he could hit \Server\Share on XP’s ‘Run’ command and have it pop right up with the share, apache would not tolerate //Server/Share and declared “must be a directory” Yet, //S/S would work fine when I tried it on Xampp running on windows 7.

Until I can roll a winxp VM and test it I can’t 100% blame XP, but I’m strongly leaning that direction. I’m assuming it’s a change in implementation in how the OS presents the share path to applications requesting it. 7 properly presents it as a directory and apache is pleased, but somehow XP doesn’t and apache is not amused.

(footnote: apache requires / while windows finds \ far more delicious)

Newer :

Older :

5 Responses

  1. Derek says:

    We both agreed, however, that it’s far simpler on a linux box. Mount the share into any directory, point apache at that directory, blam no problem. Windows 7 provides a utility to do this. XP sort of does, there’s an app in the resource kit, but it’s restricted to local links only. No network.

    bluevulpine: Solution! ditch windows
    bluevulpine: :/
    aCe: ROFL
  2. Darius Greywind says:

    XP is a horrible choice for anything server-y. Don’t forget that it still has the 10 half-open TCP connection limit (7 doesn’t, Vista lost it with SP2). And of course, like all desktop Windows flavors, it hates to be operated continuously without rebooting for long periods. But yeah, there’s no way in hell I’d ever want to run Apache on Windows. That’s just begging for pain.

    Also, why exactly would you want to put the Apache root on a remote drive anyways? I just can’t see any good reason for that.

  3. typhoon says:

    On a server you want to keep patches current so NO windows server can be operated continuously. XAMPP is nice for some light development work but IMO the best way to do Apache on windows is to install a VM Product and run the server in a *nix VM. Share the folder to the local machine with samba so you can do editing and whatever you need to do with the files on windows.

    Allows to set up exactly the same environment as on the target host too.

  4. Derek says:

    The XP box is used as a broadcast platform for a shoutcast stream, and Apache serves the webform for taking listener requests. He was trying to share some large work-related files with a remote colleague, basically one-shot, roll this and then delete it afterward. Rather than copy all the files over to the XP box from his main (and somewhat more secured) Windows 7 system, he was hoping he could SMB-mount the share from 7 on XP and then serve the directory.

    Wound up just copying the files to XP so apache could serve them out of a local directory. There’s a lot of ways he could have tossed the files over, he just figured this’d be easy since he already had apache up and running for his radio show.

  5. Darius Greywind says:

    Windows 7 by default requires 128-bit encryption for SMB. You have to disable that in the Network and Sharing Center advanced options before it will deign to talk to XP.

    As to running Linux on top of Windows, the most elegant way to do that is CoLinux. It’s not a VM, it’s user-mode Linux. You get at least 95% the performance of running it on bare hardware this way. I wouldn’t use it as a permanent server, but it is handy to fiddle with things.