首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Apache2 -符号链接不允许或链接目标不可访问

Apache2 -符号链接不允许或链接目标不可访问
EN

Stack Overflow用户
提问于 2022-11-10 04:30:44
回答 1查看 26关注 0票数 0

环境:-

代码语言:javascript
运行
复制
Ubuntu 20.04.4 LTS

$ apache2 -version
Server version: Apache/2.4.53 (Ubuntu)
Server built:   2022-03-14T15:01:21

问题:-

一切正常,当我访问http://160.55.56.28/artifacts和终端时,突然开始在浏览器上出现以下错误。

代码语言:javascript
运行
复制
Forbidden

You don't have permission to access this resource.
Apache/2.4.53 (Ubuntu) Server at 160.55.56.28 Port 8080
代码语言:javascript
运行
复制
$ 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>
代码语言:javascript
运行
复制
$ 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

/etc/apache2/apache2.conf中有下面的。

代码语言:javascript
运行
复制
<Directory /var/www>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
</Directory>
代码语言:javascript
运行
复制
$ 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

已经执行了chown -R admin:admin /var/www/chown -R admin:admin /home/admin/.mits/packages/releases,邮政服务重新启动仍然存在同样的问题。

请给我建议可能的解决办法。谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-10 05:17:17

以下这些帮助解决了我的问题。

代码语言:javascript
运行
复制
$ sudo chmod -R +x /home/admin/

$ sudo service apache2 stop
$ sudo service apache2 start
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74384166

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档