简体   繁体   中英

Apache2 403 Forbidden

I have configured mod_wsgi with Apache, but I am getting 403 Forbidden as response.

This is error that I can see in the log:

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

This is how my apache config looks like:

<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>

Can someone advice what can be the problem?

I solved the problem.

I added this configuration to apache config file:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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