[英]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.