Sajito
Sajito

Reputation: 91

How do I get apache to follow symlinks to windows drive on WSL

I'm trying to make apache run on Linux Subsystem for Windows. So I just installed apache and changed DocumentRoot from "/var/www/html" to "/var/www" in /etc/apache2/sites-available/000-default.conf. This has exactly the effect I wanted it to have, namely to list all folders inside when browsing to "localhost".

My projects are located on my Windows drive in "C:/Projekte", so I created a symlink like so:

sudo ln -s /mnt/c/Projekte /var/www/projects

Now my problem is, when I browse to localhost and click on projects it runs into a loop trying to call an index.html, so the url before it breaks looks like this:

http://localhost/projects/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/

I would want to see the directory listing of my folders instead.

I know about the Options Indexes and FollowSymLinks which are both set, but there seems to be something else I have to set for symlinks to work as I expect. If I create a folder instead in "/var/www" it works fine.

Does anybody know how to set this up correctly?

Upvotes: 2

Views: 4415

Answers (1)

Sajito
Sajito

Reputation: 91

By accident I found out, that my issue here is related to this issue on BashOnWindows. Problem is that I used tab to autocomplete the path which automatically added a trailing slash to the end of the path. So the actual command I used to create the symlink was

sudo ln -s /mnt/c/Projekte/ /var/www/projects

Creating the symlink without trailing slash, just like in my question it works just fine.

Upvotes: 7

Related Questions