我为我的 django 网站设置了一个虚拟主机。
NameVirtualHost 74.181.105.228:80
<VirtualHost 74.181.105.228:80>
ServerAdmin admin@mydomain.com
ServerName mydomain.com
# Run the SLMCS Django application.
WSGIScriptAlias / /home/david/djangosites/mydomain/wsgi.py
WSGIScriptReloading On
Alias /static/ /home/david/staticFiles/
<Directory /home/david/djangosites/mydomain>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
</Virtualhost>
如果我将第二行更改为<VirtualHost *:80>
,则 Apache 在我重新启动时会发出警告:
[warn] NameVirtualHost 74.181.105.228:80 has no VirtualHosts
为什么?我不是刚设置了一个虚拟主机吗?如果我使用<VirtualHost 74.181.105.228:80>
.