1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 791
/ 3 Years ago, sun, may 16, 2021, 12:17:01
I want to set up a website with the root /home/x/y.
The problem is, that I get a 403 Forbidden error, although
the configuration files are set up correctly, aren't they?
Here are the configs I edited and the permission states of
the website root directory
Input
$ nano /etc/apache2/apache2.conf
Output
...
<Directory /home/x/y>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
...
Input
$ nano /etc/apache2/sites-available/x.conf
Output
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName x.y.org
ServerAlias www.x.y.org
DocumentRoot /home/x/y
ErrorLog ${APACHE_LOG_DIR}/domain.com_error.log
CustomLog ${APACHE_LOG_DIR}/domain.com_access.log combined
<Directory "/home/x/y">
Order allow,deny
Allow from all
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.x.y.org [OR]
RewriteCond %{SERVER_NAME} =x.y.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Input
$ ls -ld x/
Output
drwxr-xr-x 7 root root 4096 Jan 25 21:18 x/
Input
$ ls -ld x/y/
Output
drwxrwxrwx 3 root www-data 4096 Jan 25 21:44 x/y/
Edit: Yes, all parent directories of the folder y have the execution permission.
More From » permissions