【发布时间】:2014-02-18 09:33:24
【问题描述】:
好的,所以我正在关注this 教程。当我尝试通过本地服务器访问我的网站时,我收到了这个奇怪的错误:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.6 (Ubuntu) Server at mysite.com Port 80.
就我而言,我做的一切都是正确的(我实施了两次建议的方法),这很可能是一个操作系统错误(我正在运行 Mint 16 并且错误说(Ubuntu)),但是我没有经验并且所以我需要一些帮助。
我做了一些研究,但这些 (1,2) 问题以及其他问题似乎都无法回答我的情况。
所以这里是mysite.conf 文件:
<VirtualHost *:80>
WSGIScriptAlias / /home/nick/Mysite/mysite.wsgi
ServerName mysite.com
Alias /static /var/www/mysite/static/
<Directory /var/www/mysite/>
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
还有我的 hosts 文件,它显示了 IP 地址如何重定向到我的本地主机:
127.0.0.1 localhost
127.0.1.1 nick-HP-Notebook-PC
192.168.1.2 mysite.com
192.168.1.2 mysite2.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
那么你认为问题是什么。这可能只是一个与 Linux 相关的错误吗? 如果您需要有关该项目或任何其他信息的其他信息,请告诉我。
非常感谢。
更新:
这是我的.wsgi 文件:
import os
import sys
sys.path = ['/var/www/mysite'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
当我重新启动服务器时,我也会收到此消息。
Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message [ OK ]
也许这有帮助?
【问题讨论】:
标签: linux django apache ubuntu mod-wsgi