Skip to content

Symlinks and shortcuts and Apache

So, I’m helping install Apache on a friend’s computer. He’s running Windows XP SP1, and Apache has a very nice page describing how to install on Windows. A few issues did arise, however.

1. I encountered the following error message on the initial startup of the web server:

[Tue Jun 15 23:09:11 2004] [error] (OS 10038)An operation was attempted on something that is not a socket. : Child 4672: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.

I read a few posts online that suggested I could just follow the instructions–I did and just added the Win32DisableAcceptEx directive to the bottom of the httpd.conf file. A restart, and now localhost shows up in a web browser.

2. Configuration issues: My friend also has a firewall on his computer (good idea). I had to configure the firewall to allow Apache to receive packets, and respond to them. Also, I had to configure the gateway (my friend shares a few computers behind one fast internet connection) to forward the port that external clients can request information from to the computer on which Apache was running. Voila, now I can view the default index.html page using his IP address.

3. However, the biggest hurdle is yet to come. My friend wants to server some files off one of his hard drives (a different one than Apache is installed upon). No problem on unix, just create a symlink. On windows, I can use a shortcut, right? Just like a symlink, they “…can point to a file on your computer or a file on a network server.”

Well, not quite. Shortcuts have a .lnk extension, and Apache doesn’t know how to deal with that, other than to serve it up as a file. I did a fair bit of searching, but the only thing I found on dealing with this issue was this link which basically says you should just reconfigure Apache to have its DocRoot be the directory which contains whatever files you’d like to serve up. Ugh.

However, the best solution is to create an Alias (which has helped me in the past) to the directories you’re interested in serving up. And now my friend has Apache, installed properly as a service, to play around with as well.

5 thoughts on “Symlinks and shortcuts and Apache

  1. moore says:

    Chris Hamilton dropped a nice, informative note about creating hard links in Windows:

    I noticed [this article] regarding the difficulty of trying to get Apache to utilize Windows shortcuts in a similar fashion to *nix symlinks. I have just recently installed Apache on a Windows XP box at home just for the hell of it and ran into this exact same problem. Sadly there doesn’t seem to be too much useful information out there regarding this problem (probably because no one cares about Apache for Windows, but that’s another story). Anyway, for my own application I needed symlinks to work for files, not just directories (i.e. having various symlinks pointing to the same perl script that will do different things based on the basename it is actually called with) and had to go hunting for a solution. I came across the following website which seems to have worked well for me, apparently Windows XP does support hard linking after all:

    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil_hardlink.mspx?mfr=true

    In short, the command line syntax to create the hard link is:

    *fsutil hardlink* *create* *NewFilename* *ExistingFilename*

    This very well could be something you are already aware of, but since you
    were one of the few people who actually had any information even remotely
    related to this problem I thought I’d send it along just in case it held any
    interest for you. Thanks.

  2. Vincent says:

    Excellent article and comment ! And quite well referenced by Google since it is the first result for a search on “apache windows symlink”. Please keep it online !

  3. Dave Hennessey says:

    Gosh – this is about the only thing out there on the mighty Internet about this.
    fsutil hardlink solved my problem with a few short keystrokes.

    Thanks Dan!

Comments are closed.