403 Forbidden with symbolic link
Posted by: Clement016 (88.215.3.---)
Date: July 09, 2015 11:45AM

Hi guys!


I am running Apache 2.4.9 under WampServer 2.5 on Windows 8.1 and I am having issues with symbolic links.
Here is what I am trying to achieve:

I have source files for my website in Z:\projects\website and I have created a symbolic link to this directory in Z:\wamp\www using the mklink cmd: mklink /D Z:\wamp\www\website Z:\projects\website

I have also created a VHost for this, like follows:

<VirtualHost *:80>
DocumentRoot "Z:/wamp/www/website"
ServerName website.dev
ServerAlias website.dev
ErrorLog "logs/website.dev-error.log"
CustomLog "logs/website.dev-access.log" common
FallbackResource /index.html
</VirtualHost>

And allowed the following of symlinks:
<Directory Z:/wamp/www/>
Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
AllowOverride All
Require all granted
</Directory>


Of course, I have also created an entry matching 127.0.0.1 to website.dev in my hosts file.

But it doesn't work sad smiley

When I access website.dev (or directly with the IP or localhost), Apache answers with a 403 Forbidden "You don't have permission to access / on this server."

The error log also says: "Forbidden: Z:/wamp/www/website doesn't point to a file or directory"

This looks like Apache isn't able to follow the symbolic link, but I can't figure it out...

Any help would be really appreciated, I have already spent too may hours on this ^^

Options: ReplyQuote
Re: 403 Forbidden with symbolic link
Posted by: RiggsFolly (---.as43234.net)
Date: July 09, 2015 01:44PM

You do not need to create symbolic links to get Virtual hosts working.

See this Sticky post for help creating Virtual hosts [forum.wampserver.com]

Basically you forgot to add a Vhost for localhost ( its necessary as Apache ignores a lot of host info in httpd.conf once you activate VHOSTS) and you should add a <Directory> ... </Directory> set to each vhost to define to Apache the access rights for that specific vhost.

Anyway its all in that document so give it a read.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 403 Forbidden with symbolic link
Posted by: Clement016 (---.interdsl.co.uk)
Date: July 09, 2015 02:13PM

Thanks for your reply RiggsFolly,

Actually I didn't paste my entire VHost file, the localhost one is still in there winking smiley
The post you linked is full of useful information, I wish I would have read it before!

I have already discovered that it worked by poiting directly to the source folder rather than using the symlink, but I needed to have this symlink for specific reasons.

Anyway, I found the solution to make it work with the symlink: it was the option SymLinksifOwnerMatch which was preventing Apache to follow it.

Thank you for your help smiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.