You don't have permission to access this resource. code example
Example 1: You don't have permission to access this resource.
$ sudo systemctl restart apache2
Example 2: You don't have permission to access this resource.
In Apache’s main configuration file /etc/apache2/apache2.conf, ensure that you
have this block of code:
<VirtualHost *:80>
....
<Directory /var/www/html/PATH_TO_DIR/>
AllowOverride All
Require all granted
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
.....
.....
</VirtualHost>
Save and exit and thereafter, restart the Apache.
sudo systemctl restart apache2
Example 3: apache you don't have access to this resource
<VirtualHost *:80>
ServerAdmin email
DocumentRoot /var/www
ServerName domain_or_ipAddress
<Directory /var/www/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>