Environment:-
Ubuntu 20.04.4 LTS
$ apache2 -version
Server version: Apache/2.4.53 (Ubuntu)
Server built: 2022-03-14T15:01:21
Problem:-
Everything was working fine, Suddenly started getting below errors on browser when i access http://160.55.56.28/artifacts
and terminal.
Forbidden
You don't have permission to access this resource.
Apache/2.4.53 (Ubuntu) Server at 160.55.56.28 Port 8080
$ curl http://localhost/artifacts
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<hr>
<address>Apache/2.4.53 (Ubuntu) Server at 160.55.56.28 Port 8080</address>
$ sudo tail -f /var/log/apache2/error.log
[Thu Nov 10 09:11:46.009901 2022] [core:error] [pid 517203:tid 139940436375296] [client 160.55.56.28:44400] AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/artifacts
[Thu Nov 10 09:11:46.721754 2022] [core:error] [pid 517203:tid 139940302157568] [client 160.55.56.28:44404] AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/artifacts
[Thu Nov 10 09:11:46.886521 2022] [core:error] [pid 517203:tid 139940419589888] [client 160.55.56.28:44406] AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/artifacts
In /etc/apache2/apache2.conf
have below.
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
$ ls -lsa /var/www/html/artifacts
0 lrwxrwxrwx 1 admin admin 55 Nov 10 09:03 /var/www/html/artifacts -> /home/admin/.mits/packages/releases
Already executed chown -R admin:admin /var/www/
and chown -R admin:admin /home/admin/.mits/packages/releases
, Post service restart still same problem persisting.
Please suggest me possible solution. Thanks!
CodePudding user response:
The following helped to solve my problem.
$ sudo chmod -R x /home/admin/
$ sudo service apache2 stop
$ sudo service apache2 start