目前我一直在尝试使用Apache2在Ubuntu上运行一个网站,但是我遇到了一个问题。 该网站被命名为Indivo,并有Python文件。
我已经按照说明设置了系统,但是在运行Apache时:
$ sudo service apache2 restart
我得到这一行,网站无法启动:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting [Wed Aug 04 13:12:01 2010] [warn] module wsgi_module is already loaded, skipping apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Apacheconfiguration文件(在/ etc / apache2 / sites-enabled / default中)是这样的:
<VirtualHost *:8000> ServerAdmin [email protected] ServerName www.indivo.dal.ca DocumentRoot /usr/indivo_server Alias /static/ /usr/indivo_server/static/ EnableMMAP On EnableSendfile On LogLevel warn <Directory /usr/indivo_server> Order deny,allow Allow from all </Directory> WSGIDaemonProcess indivo user=ehsan group=ehsan processes=1 maximum-requests=500 threads=10 WSGIScriptAlias / /usr/indivo_server/django.wsgi WSGIPassAuthorization On </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName www.indivo.dal.ca DocumentRoot /usr/indivo_ui_server Alias /static/ /usr/indivo_ui_server/ui/static/ EnableMMAP On EnableSendfile On LogLevel warn <Directory /usr/indivo_ui_server> Order deny,allow Allow from all </Directory> WSGIDaemonProcess indivo_ui user=ehsan group=ehsan processes=1 maximum-requests=500 threads=10 WSGIScriptAlias / /usr/indivo_ui_server/django.wsgi WSGIPassAuthorization On </VirtualHost>
你对这个问题有什么想法吗?
谢谢
伊赫桑
错误:
module wsgi_module is already loaded
是因为你有不止一次的wsgi_module的LoadModule行,或者它包含的snippet文件被包含了两次。
您的configuration在其他方面也是错误的。
首先,你错过了一个WSGIProcessGroup指令去WSGIDaemonProcess指令。 如果您没有WSGIProcessGroup,则WSGI应用程序仍将以embedded模式运行,并且不会被委派给守护进程。 确保你阅读官方文档,为什么你有套接字权限问题:
http://code.google.com/p/modwsgi/wiki/ConfigurationIssues
其次,不要使用'processes = 1',只需要closures该选项,因为它默认为一个进程,并且使用'进程'选项作为WSGI应用程序的任何值,这是一个多进程应用程序,不是因为您不是在具有相同应用程序的多个Apache服务器实例之间进行负载均衡。
最后,一般不build议设置最大请求,除非你有充分的理由并且明白你为什么要这样做。 如果你已经添加了它,因为你看到了别人的configuration,而不是因为你知道你真的需要它,那就把它拿出来。
顺便说一下,假设你有适当的NameVirtualHost设置,所以你的VirtualHost实际上正常工作。
至于域名parsing,如果您的网站工作,通常可以忽略。
请注意,您所引用的错误应该会阻止Apache启动。 build议你运行:
sudo /usr/sbin/apachectl -t
并看看当Apachevalidation你的configuration,并发布完整的输出作为除了你的问题之外,还会给出什么进一步的错误消息。
有关mod_wsgi的完整官方文档可以在以下urlfind:
确保你阅读它。
你跑步的时候会得到什么?
hostname --fqdn
检查/ etc / hosts中是否有适当的名称,例如www.indivo.dal.ca
你的Apacheconfiguration文件看起来对我来说,django.wsgi是什么样子?