Attempting to use symbolic link for var/www/html

Viewed 22003

this is what I'm trying to accomplish: creating symbolic link from var/www/html to a directory in the home (~) folder. the directory I'm trying to symlink to in home (~) is a git repository, if that makes any difference. I have an index.html file in this directory.

I've created a symbolic link to var/www/html on an Amazon EC2 instance using this command: ln -s ~/dirIWant/ html, however this is resulting in the following error when I try to access my webpage: 403 Forbidden "You don't have permission to access / on this server." I'm using apache.

Has anybody else tried to do something similar and gotten it to work?

Currently, when I go to my website www.blah.com, it shows this 403 error. I've tried to change the permission using sudo chown -h apache:apache but it doesn't seem to help. Do you have any other ideas?

2 Answers
here how to link file into other directory example with apache2 config file 

**user of symbolic**
## if file available then first remove it 
$ sudo rm -rf /etc/apache2/sites-enabled/000-default.conf 
## sudo lm -s  /path of source /path of destination 
$ sudo ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/
$ sudo systemctl restart apache2
$ sudo systemctl status apache2

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/pRSoq.png
Related