繁体   English   中英

禁止使用Apache2 403

[英]Apache2 403 Forbidden

我已经用Apache配置了mod_wsgi,但是得到403 Forbidden作为响应。

这是我在日志中看到的错误:

Symbolic link not allowed or link target not accessible: /mnt/myapp/current

这是我的apache配置的样子:

<VirtualHost *:443>
        ServerName somedomain.com
        ServerAlias www.somedomain.com

        <Directory /mnt/myapp/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Require all granted
        </Directory>

        <Directory /mnt/myapp/current/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Require all granted
        </Directory>

        # Django Application
        Alias /static /mnt/myapp/current/static
        <Directory /mnt/myapp/current/static>
                Options FollowSymLinks
                Require all granted
        </Directory>

        <Directory /mnt/myapp/current/myproject/apache>
                <Files wsgi.py>
                        Options FollowSymLinks
                        Require all granted
                </Files>
        </Directory>

        WSGIDaemonProcess grapevine python-path=/mnt/myapp/current:/mnt/env/lib/python3.4/site-packages
        WSGIProcessGroup myproject
        WSGIScriptAlias / /mnt/myapp/current/myproject/apache/wsgi.py

        SSLEngine on
        SSLCertificateFile /home/myapp/myapp.com.crt
        SSLCertificateKeyFile /home/myapp/myapp.com.key
        SSLCertificateChainFile /home/myapp/myapp.crt

</VirtualHost>

有人可以建议出什么问题吗?

我解决了问题。

我将此配置添加到apache配置文件中:

DocumentRoot /mnt
<Directory />
       Options FollowSymLinks
       AllowOverride None
</Directory>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM