Symbolic link not allowed or target not accessible

aqdennis

New member
Joined
Sep 1, 2014
Messages
1
Hi,

Until now I had a webshop running on shared hosting, but we decided to run it on a VPS with DirectAdmin running on CentOS.
As the webshop is currently still running, I first want to build the new webshop before letting the domain name point at it. Hence, I would have to refer to the new webshop with just the IP address for now, but the problem is that somehow doesn't work.

In httpd.conf the DocumentRoot is specified as /var/www/html. This is also the directory I see when I just type the IP address in my browser.
The new webshop (domain = engrano.nl) will run in /home/admin/domains/engrano.nl/public_html
There is a symbolic link linking /home/admin/public_html to /home/admin/domains/engrano.nl/public_html

Hence, what I did is making a symbolic link from /var/www/html/public to the new webshop's public_html directory. But when I try to access the webshop in my browse through "<IP address>/public" I get a 403 error and the Apache log says:

Symbolic link not allowed or link target not accessible: /home/admin/public_html
File does not exist: /var/www/html/403.shtml


What I've made sure of and tried, but unsuccessfully, is:

- both symbolic link as directory is linked to have full read/write/exec rights
- making owner/group the same for both ends of the symbolic link
- add in httpd.conf for /var/www/html the options "+FollowSymLinks" and remove "-SymLinksIfOwnerMathc"
- try to replace the symbolic link with an Alias

The strange thing is, that there are more symbolic links in /var/www/html for for instance phpMyAdmin, and those work. But, they link to other directories within /var/www and not to /home/admin/domains....
So it seems that the symbolic link is found and executed, but the problem is in the directory it's pointing too. However, I do not see what the problem there might be.

Anyone a clue what I can try ??

Thanks in advance,
Dennis
 
You can change your Apache coinfiguraiton to allow symbolic links (very insecure) or allow symbolic links if owner matches (somewhat more secure). Neither are a good idea. And as yoou can see, neither will work because PHP considers it insecure. You can make it less secure, but don't.

Better to either use a separate dedicated IP#, in which case you can reach your new site by IP# while working on it.

Or to make changes in your local machine's hosts file to be able to point to it with the actual domain name. You may want a separate IP# later anyway, so you can use a Secure Site Certificate.

Or you can just create a new temporary domain name to use for working on the new server.

Jeff
 
Back
Top