php - 尝试使用 https 连接时,在 xampp linux 中更改 Web 根目录会出现错误 403

标签 php linux https xampp

我有一个简单的网站位于名为 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/

相关文章:

php/mysql 数据库更新后的 Javascript 弹出窗口

c - 写入帧缓冲区

regex - 为什么这个正则表达式不适用于 grep?

http - HTTPS 中的哪些 HTTP 功能不同?

php - 使用范围 + 毕达哥拉斯定理选择结果

php - 根据用户输入显示数据库中的数据

c# - 为单个应用程序安装 SSL 证书?

https - HTTPS 是有状态的还是无状态的?

php - 在我的情况下避免循环内的查询

linux - 计算 cron 的运行时间