I have a server on AWS which serves a number of websites. Webmin is also installed.
In Apache, when I try to create a website, say ferrari.example.com
, I get the error Forbidden. You don't have permission to access this resource.
when I request it with a web browser.
It is NOT a file permission issue, because if I use a different domain name (pointing to the same directory), it works fine.
It is NOT an Apache config issue, because if I change only the domain name (and no other config settings), it works fine.
Yes, I have a correct DNS entry that points ferrari.example.com
points to my server.
No, there are no other sites conflicting with the domain name in Apache. I did a grep -r ferrari *
in /etc/apache
and found only that one site.
Does anyone have any other ideas why this isn't working?
<VirtualHost *:80>
DocumentRoot /var/www/ferrari.example.com
ServerName ferrari.example.com
<Directory /var/www/ferrari.example.com>
AllowOverride All
Options None
Require all granted
</Directory>
</VirtualHost>
I think I do NOT have SELinux installed.
Log level debug shows these errors:
[Thu Sep 19 19:13:00.740101 2019] [authz_core:debug] [pid 31107] mod_authz_core.c(809): [client 204.112.96.198:13742] AH01626: authorization result of Require all denied: denied, referer: http://ferrari.example.com/
[Thu Sep 19 19:13:00.740130 2019] [authz_core:debug] [pid 31107] mod_authz_core.c(809): [client 204.112.96.198:13742] AH01626: authorization result of <RequireAny>: denied, referer: http://ferrari.example.com/
[Thu Sep 19 19:13:00.740139 2019] [authz_core:error] [pid 31107] [client 204.112.96.198:13742] AH01630: client denied by server configuration: /var/www/html/favicon.ico, referer: http://ferrari.example.com/
Best Answer
I faced the same issue.
Here's how I solved it
Open the apache2.conf file using the nano editor.
Replace the general directory settings with this.
Ensure your virtual host configuration file in
/etc/apache2/sites-available
directory is in this mannerRestart Apache2 service
That's all.
I hope this helps