我有一个简单的网站位于名为 test 的文件夹中,所以我调用了 http://localhost/test
并且收到了一条 Hello World!
消息.当我在 HTTPS
模式下调用它时,我也收到了同样的消息:https://localhost/test
。
问题是,在我将我的 Webroot htdocs 目录从 /opt/lampp/htdocs
更改为 /home/ubuntu/www
之后,我仍然能够看到通过调用 HTTP 链接获取 hello world 消息,但是当我调用 HTTPS 链接时,我得到:
Access forbidden!
You don't have permission to access the requested
directory. There is either no index document or the directory is
read-protected. If you think this is a server error, please contact
the webmaster. Error 403
最佳答案
解决方案是同时修改位于/etc/extra/中的 httpd-ssl.conf 文件,并将我们拥有 DocumentRoot "/opt/lampp/htdocs"的第 86 行修改为新目录 "/home/Ubuntu/www"
关于php - 尝试使用 https 连接时,在 xampp linux 中更改 Web 根目录会出现错误 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38742485/