I am trying to create a local environment in Linux/Ubuntu.
I have install Apache 2.4.7 (using apt-get).
I have changed my /etc/hosts to this:
127.0.0.1 example.dev
127.0.0.1 localhost
...
I also added a file "example.dev.conf" to "/etc/apache2/sites-available" which looks like this:
<VirtualHost *:80>
ServerName example.dev
DocumentRoot "/home/yahya/path/to/projec"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/home/yahya/path/to/project">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
But when I go to example.dev I get the following message:
403 Forbidden! You don't have permission to access / on this server.
I also edited apache.conf part for <Directory />
from suggestions from this link: Forbidden You don't have permission to access / on this server and Error message "Forbidden You don't have permission to access / on this server"
from:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
to
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Require all granted
</Directory>
I have used a2ensite. But still does not work.
a2ensite example.dev
– AnabranchBut still does not work!!!
doeswww-data
have enough permissions to list files in the folder/home/yahya/path/to/projec
? – Informedls -la
in the folder and up, to check thatwww-data
has access to it. askubuntu.com/questions/43485/… and so on. Before doing anything in Linux you have to learn basics about, at least, permissions. Otherwise you can just damage the whole system. – Informed/home/yahya/path/to/projec
withls -la /home/yahya/path/to/projec
You will see the folder's owner. The userwww-data
needs read access to this folder. – Anabranch