2016-03-24 199 views
0

我已经配置mod_wsgi与Apache,但我得到403 Forbidden作为响应。Apache2 403禁止

这是错误,我可以在日志中看到:

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> 

可有人建议还有什么能问题?

回答

0

我解决了这个问题。

我加入这个配置Apache的配置文件:

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