Symbolic link not allowed or link target not accessible

melloman

Registered
Nov 12, 2015
4
0
1
Australia
cPanel Access Level
Root Administrator
I am running WHM/cPanel with CloudLinux and have tried to setup a fairly straight forward symlink from /public_html/symtest to /public_html/images

The symlink works perfectly when I browse to it via FTP but when I browse (in a web browser) to the directory or a file within the linked directory, I get a 403 Forbidden error.

When I check the Apache error logs it shows the following error:
AH00037: Symbolic link not allowed or link target not accessible: /home/*USER*/public_html/symtest


I've checked the WHM Apache settings (Apache Configuration > Global Configuration) and have made sure FollowSymLinks is ticked.
How can I get this Symlink to work?
 

24x7server

Well-Known Member
Apr 17, 2013
1,913
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hello :),

You are using cloudlinux on your server so can you please check cloudlinux symlink protection setting on your server with the following URL.

CloudLinux Documentation
 

melloman

Registered
Nov 12, 2015
4
0
1
Australia
cPanel Access Level
Root Administrator
Here is what I have in /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

fs.symlinkown_gid = 99
# CageFS
fs.proc_can_see_other_uid=0
# SecureLinks Link Traversal Protection Allowd Group Id
fs.protected_symlinks_allow_gid = 984
fs.protected_hardlinks_allow_gid = 984


I tried changing fs.proc_can_see_other_uid to 1
I tried changing fs.protected_symlinks_allow_gid & fs.protected_hardlinks_allow_gid to 99
I tried adding fs.enforce_symlinksifowner = 0 to the bottom of /etc/sysctl.conf

After running sysctl -p there was no difference.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
Hello,

Could you verify if the symbolic link itself is owned by the account username?

Thank you.