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>
我已使用 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>