I'm trying to create a symbolic link to /home/user/www from /var/www/html so I can access the directory in my home folder from the URL: http://localhost/www/

I did: ln -s /home/user/www /var/www/html but when i access the URL above, the server returns 403 Forbidden.

The directory /home/user/www has permissions 775.

I'm on Ubuntu 14.04.

2 Answers 2

  1. Check /home/user/www and /var/www/html owners

Apache user\group must have access to /home, /home/user and /home/user/www paths

  1. Check Apache configuration:

look for FollowSymLinks option

<Directory /var/www/html>
    Options FollowSymLinks

Set permissions for /home/user to 711 and see if that helps any. Keep in mind... localhost/www won't exist unless you have a folder called www inside of the DocumentRoot.

Also, you're better off using ~/public_html over symlinking /var/www/html to something in your home directory. Bad practice/juju.

  • Unless I'm misunderstanding what you mean, ~/public_html isn't that useful unless you have multiple users. Jun 12, 2018 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .