- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我使用的是 MacOS Catalina,我的 Apache 环境运行良好,直到我决定将我的文档根目录移动到 iCloud 驱动器,以对其进行备份。
在我的文档根目录之前是:
/users/admin/www
现在是
/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www
我相应地编辑了 httpd.conf :
DocumentRoot "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www"
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www">
Options FollowSymLinks Multiviews SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder">
Options +FollowSymLinks +Multiviews +SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Allow from All
Require all granted
</Directory>
重新启动 Apache,重新启动机器,但现在我可以访问 127.0.0.1,除了一个特定的文件夹(我们称它为 www/myfolder)。当我尝试访问 127.0.0.1/myfolder 时,出现以下错误:
Forbidden
You don't have permission to access / on this server.
检查 apache 日志文件,这是我得到的错误:
[Thu Oct 24 14:00:24.830700 2019] [access_compat:error] [pid 61703] [client 127.0.0.1:57804] AH01797: client denied by server configuration: /users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder/public_html/
我在这里错过了什么?请帮忙,我需要工作 :D
最佳答案
我首先看到的是您在目录 block 中使用的是 Apache 2.4 样式语法,但是在您的错误日志中,抛出错误的模块是access_compat
。根据 Apache 文档:
The directives provided by mod_access_compat have been deprecated by mod_authz_host. Mixing old directives like Order, Allow or Deny with new ones like Require is technically possible but discouraged. This module was created to support configurations containing only old directives to facilitate the 2.4 upgrade
下一条线索是错误代码:AH01797
。这是由 server configuration issue 引起的:
Client denied by server configuration
This error means that the access to the directory on the file system was denied by an Apache configuration.
我在这里假设您实际上使用的是 2.4,并且错误地启用了 access_compat
。
再次查看您的配置文件,找到正在加载 mod_access_compat
的 LoadModule
指令,并将其注释掉。它可能在您的 httpd.conf
文件中,但是组织和配置 Apache 安装的方式多种多样,因此它可能在其他地方。如果您有 Debian 风格的安装,则需要删除符号链接(symbolic link) /etc/apache2/mods_enabled/mod_access_compat
。 Grep -R access_compat *
可能有帮助。
编辑另外 2 个观察结果:
目录
节中,你有Allow from all
Require all granted
这是将旧指令语法与新指令语法混合在一起,也是多余的。再次禁用 access_compat
,并在重新启动 Apache 之前删除 Allow from all
行。
directory
节甚至没有必要。您可能可以删除整个 block 并重新启动服务器,这样就可以了。首先尝试 (1) 通过禁用 access_compat
并从 httpd.conf
文件中删除 Allow
指令,然后使用 重新启动 apache >apache2ctl -k 优雅
。如果这不起作用,请注释掉整个第二个 directory
节并重新启动。
我大约有 50% 的把握可以解决这个问题。如果没有,那么我真的需要查看您的整个 httpd.conf 文件,然后才能进一步排除故障。
关于apache - 403 禁止 : Apache not working after moving document root folder to iCloud drive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58321852/
C++ 中的标准“映射”容器允许您插入右值: T x; std::map m; // m[1]; // populate "1" auto it = m.insert(std::make_pair(
我们知道 std::move does not actually move anything .它只是将左值引用 (&) 转换为右值引用 (&&)。 那么在下面的例子中,拷贝构造函数是如何被调用的呢?
http://en.cppreference.com/w/cpp/language/rule_of_three 几个月前我开始使用 c++11并观看了五人规则。 所以..我开始将复制构造函数/复制赋值
这个问题在这里已经有了答案: In what scenarios should I expect to explicitly need to implement a move constructor
我有一个类似于下面的对象,我正在尝试为它实现一个 move 构造函数,这样你就可以为 std::vector 插入一个. struct Mesh { std::vector vPoint
这个问题在这里已经有了答案: How to create an std::function from a move-capturing lambda expression? (3 个回答) 关闭7年前
我有一个源文件,我正在使用它 move 到一个存档目录 关闭。 move (srcfile,dstdir) 但是当存档目标目录中已经存在相同的文件时,它会抛出一个错误,指出无法 move 文件已经存在
这应该有效,但无效并给出以下错误(如下)。 我读过几篇关于 stackoverflow 的帖子 here和 here但在这种情况下似乎没有一个好的答案。我真的希望我只是错过了一些愚蠢的东西,我已经在这
我似乎无法弄清楚为什么会这样。当我运行以下代码时: $uref = APACHE_ROOT . UPLOAD_PATH . $applicant . "_ref_{$email}_{$year}";
我似乎无法弄清楚为什么会这样。当我运行以下代码时: $uref = APACHE_ROOT . UPLOAD_PATH . $applicant . "_ref_{$email}_{$year}";
我的表格行可以上下 move ,但我的问题是数据表行取代了表格标题(第一行)。 我想要一个固定的第一行,这样当您单击向上箭头时,您就不会向上 move 该行来替换标题。 我尝试了一些条件逻辑来检查当前
正如我在Move constructor/operator=中询问的那样,过了一段时间,我同意并接受了这个问题的正确答案,我只是在想,是否有类似“移动析构函数” 这样的东西会在每次移动的对象上调用会有
如果我有一个像这样的 C 类: class C { std::string s; public: C(std::string& s) : s(s) {} C(std::str
我是 C++11 的新手,发现 move 语义和复制省略非常适合编写优雅高效的代码。不过我有一些问题想请教。这里我写了一个模板类 matrix.hpp 并用它来测试 move 语义的行为。 #incl
我在我们的项目中遇到了这样的代码: class A { public: A(A&& obj): valid_(false), data_(obj.data_) {} //... void
move 语义在这个例子中是如何工作的: struct test { int ii[10]; int i; }; test f() { test a; std::cou
假设我有一个类型为 A 的对象 a。 如果我想将其 move 到函数foo(A)。 一个选择是执行 foo(std::move(a)),这将调用 move 构造函数。 但是,假设我正在使用一个我无法控
我用 move 复制构造函数和 move 复制赋值运算符创建了一个简单的应用程序,并且在它们中的每一个上我都做了一个 cout 语句来告诉我,它们正在执行。但是在执行过程中,我没有看到 move 复制
相关问题: Why this move constructor is not called wtih rvalue temporary? [duplicate] Move Constructor vs
我正在努力研究 move 构造函数,并希望通过这个问题获得更多见解。这是一个简单的类。 class A { private: vector Bs; public: /* ..
我是一名优秀的程序员,十分优秀!