[英]Django and apache2 restart
我尝试使用apache设置Django时遇到以下问题:
$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
[Wed Mar 07 03:21:17 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Wed Mar 07 03:21:18 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
...done.
有什么想法会导致这种情况吗?
这是sites-available
文件的内容:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin@website.com
ServerName www.website.com
ServerAlias website.com
Alias /static /home/website/store/static
DocumentRoot /home/website/store
WSGIScriptAlias / /home/website/store/apache/django.wsgi
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
这也是wsgi文件:
import os, sys
#path to directory of the .wsgi file ('apache/')
wsgi_dir= os.path.abspath(os.path.dirname(__file__))
#path to project root directory (parent of 'apache/')
project_dir=os.path.dirname(wsgi_dir)
#add project directory to system's PATH
sys.path.append(project_dir)
project_settings=os.path.join(project_dir,'settings')
os.envision['DJANGO_SETTINGS_MODULE']='store.settings'
import django.core.handlers.wsgi
application=django.core.handlers.wsgi.WSGIHandler()
从内存中这是由于NameVirtualHost在Apache配置中的多个位置具有相同的值而引起的。 通常,在站点可用目录中的站点文件中不会包含该指令,因为Apache配置的单独部分中的端口80已经存在该指令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.