Symbolic link not allowed or link target not accessible

If you found this post helpful, kindly share it and show your support :)

When I was migrating cPanel account to another server through command line using a /scripts/pkgaccount. The package was successfully migrated to a new server and the domain was live again on the new server. But the issue is several functionalities of the site was not working and I got following error was appearing in apache error log constantly.

symbolic link not allowed or link target not accessible

Possible Reasons :-

  • The apache configuration doesn’t allow to Follow Sym Links.
  • The SymLink owner doesn’t match (it usually happens on WHM/cPanel server since cPanel assigns a unique user for every domain)

To Fix “symbolic link not allowed or link target not accessible” on WHM/cPanel Server :

  • Connect to your WHM/cPanel with root privileges from browser e.g http://serverhostname:2086 or http://serverip:2086
  • Go to Main >> Service Configuration >> Apache Configuration >> Global Configuration
  • Check FollowSymLink
FollowSymLinks

You can also Simply change ownership of your symlink files to particular user from command line.

Eg :- Domain name : testdomain.com & cPanel user : testuser

chown testuser:testuser  *

If you are still having difficulties or unable to change ownership of files or its just not working.

  • You can again Go To
Main >> Service Configuration >> Apache Configuration >> Global Configuration
  • Uncheck SymLinksIfOwnerMatch
SymLinksIfOwnerMatch
  • Save it! It should rebuild Apache configuration and reload httpd daemon.

You can also change the same from command line using following steps:

On CentOS/Ubuntu/RedHat:

  • vim /etc/httpd/conf/httpd.conf
  • Add
Options +FollowSymLinks -SymLinksIfOwnerMatch
  • Reload httpd
 /etc/init.d/httpd reload

On debian base distro;

/etc/init.d/apache gracefull 

If you don’t have access to httpd.conf, you can add this in your .htaccess of your document root.

  • vim .htaccess
  • Add
Options +FollowSymLinks -SymLinksIfOwnerMatch
  • Save it! Here you don’t need to reload httpd daemon.

Note :  Using .htaccess method you need to make sure, your httpd.conf is configured/instructed to read .htaccess in your document root.

That’s it. Hope this will help you 🙂

Loading

Mohammed Noufal

I'm Mohammed Noufal, working as Server Admin for the last 10 years.  In my day-to-day life, l had to face different problems related to Web-hosting. On my website Errorlogz.com, you can find solutions for different Web-hosting-related problems. Sometimes, I spent hours searching/googling to find a solution. This inspired me to start a website that gives solutions to different Webhosting problems. This website includes basic Linux and windows commands, and different control panels like cPanel, Plesk, DirectAdmin, Webmin & so on. You can find solutions and or suggestions for different Web-hosting related problems from here. Hence I would like to say Errorlogz is your server protector.  I will be glad if Logdetect can help any one of the Server admins to find a solution to his problem.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *