【问题标题】:403 for DocumentRoot outside of ServerRoot403 用于 ServerRoot 之外的 DocumentRoot
【发布时间】:2012-01-02 13:57:25
【问题描述】:

我在linux上的Xampp是这样设置的

ServerRoot "/opt/lampp"
DocumentRoot "/home/webadmin/webroot"
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/home/webadmin/webroot">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html index.html.var index.php index.php3 index.php4
</IfModule>
...

这会导致 403。但是,当我将 DocumentRoot 更改为“/opt/lampp/htdocs”时,它可以工作。

已经仔细检查 /home/webadmin/webroot 是否可读。这可能是什么问题?

【问题讨论】:

    标签: apache xampp


    【解决方案1】:

    ServerRoot 必须是 DocumentRoot 之上的目录,因此如果您确实需要在“/home/webadmin/webroot”处拥有文档根目录,您必须至少将 ServerRoot 设置为“/home/webadmin/webroot”……或者类似“/home/webadmin”

    【讨论】:

    • 你从哪里得到这个的?你能指点我声称这个限制的手册吗? AFAIK,ServerRoot 是网络服务器可执行文件/日志/脚本等的目录,而 DocumentRoot 是提供文件的位置。默认灯安装可能会将后者放在前者中,但将它们分开是完全合乎逻辑的。
    猜你喜欢
    • 2011-08-22
    • 2018-11-14
    • 2017-12-02
    • 1970-01-01
    • 2012-01-20
    • 1970-01-01
    • 2013-02-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多