Apache Virtual Host in Windows - how do I deal with Symbolic links?
Asked Answered
A

2

5

I'm trying to run a virtual host on a WAPP stack. My virtual host has the FollowSymLinks option, but in Windows, all those symbolic links (I'm using shortcuts, and I think this may be the problem) have the .lnk extension. So if I'm trying to access settings.html, Apache can't find it because all i have sitting there is settings.html.lnk. Apologies if my question is unclear.

Amitie answered 14/6, 2010 at 3:43 Comment(2)
symlinks are not shortcuts (see en.wikipedia.org/wiki/Symbolic_link#Shortcuts). This is more suited for superuserOmniumgatherum
You are correct. So does anyone know how to implement a symlink for files in Windows? Or am I S.O.L.?Amitie
D
12

Apache doesn't understand shortcuts. You need to use a proper symlink. On windows this is accomplished using the command line tool mklink. See http://ipggi.wordpress.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/ for more details.

Demodulate answered 20/4, 2012 at 12:13 Comment(1)
I made them with /D, still it does not work, I got 403. The /H is good only for files, the /J or a shortcut gives 404. superuser.com/questions/1681092/…Mortify
I
1

For security reasons, symlinks aren't followed by default on Apache.

Better than enable it in the config file with "Options FollowSymLinks" you should use

http://httpd.apache.org/docs/current/urlmapping.html#outside

That's not exactly the answer you expected but may help...

Illlooking answered 19/2, 2011 at 10:48 Comment(2)
I was struggling with symlinks on Linux. Could not make them work in Apache no matter what. But I tried the method for out-of-root references described in the above Apache doc link and it worked.Toon
Further info: it works when the target is /var/web, but it fails to work if the target is called /var/reuse or /home/reuse. Perhaps "/var/web" is the only place that works for out-of-toot references? This is under cPanel virtual hosting.Toon

© 2022 - 2024 — McMap. All rights reserved.