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.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Peeaytchpee
  • 316
  • 1
  • 4
  • 6
  • symlinks are not shortcuts (see http://en.wikipedia.org/wiki/Symbolic_link#Shortcuts). This is more suited for superuser –  Jun 14 '10 at 04:04
  • You are correct. So does anyone know how to implement a symlink for files in Windows? Or am I S.O.L.? – Peeaytchpee Jun 15 '10 at 03:00

2 Answers2

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.

hollandlef
  • 247
  • 2
  • 10
  • 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. https://superuser.com/questions/1681092/apache-does-not-follow-symlinks-on-windows-403-forbidden – inf3rno Oct 11 '21 at 11:02
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...

gdoumenc
  • 589
  • 7
  • 10
  • 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. – David Spector Sep 23 '18 at 13:40
  • 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. – David Spector Sep 23 '18 at 14:00