I have created a virtualHost setup according to this website: https://ourcodeworld.com/articles/read/302/how-to-setup-a-virtual-host-locally-with-xampp-in-ubuntu
This part of the setup apparently works. However, I want to have the project folder in another location than htdocs so that the work gets backed up automatically to the cloud with my other documents.
The VirtualHost file looks like this:
<VirtualHost 127.0.0.2:80>
DocumentRoot "/home/dave/Dropbox/Documents/Projects/MyApp"
ServerName lcover.local
DirectoryIndex index.html
<Directory "/home/dave/Dropbox/Documents/Projects/MyApp">
Options All
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/lcover.local-error_log"
CustomLog "logs/lcover.local-access_log" common
</VirtualHost>
When I go to http://lcover.local, I get the 403 error.
I am pretty sure that this is an owner / permissions problem and I have tried several combinations but cannot get it to work.
How should I set the permissions for the directory & files?
<VirtualHost 127.0.0.2:80>
to<VirtualHost *:80>
, modify the relevant line in/etc/hosts
in a way as this:127.0.0.1 localhost.localdomain localhost lcover.local
, restart Apache2 and then try to accesshttps://lcover.local
(from the same machine). The other things look good.www-data
within the native Apache2 installation, maybehttpd
in your case) should have readable access to the files in your home directories and in this case you should tweak only the Apache's configuration. However, maybe in your some permissions are changed. In order to help you I've wrote the answer below.