好的,所以我正在关注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
file:
<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>
and my 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 相关的错误吗?
如果您需要有关该项目或其他任何信息的其他信息,请告诉我。
万分感谢。
Update:
这是我的.wsgi
file:
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 ]
也许这有帮助?