1
Apache無法使用mod_wsgi啓動Django WEB應用程序,我無法找出原因。Apache無法在openSUSE 12.3上啓動Django應用程序(mod_wsgi)
在Apache中的啓動錯誤是這樣
linux-ua6r:/etc/apache2/vhosts.d # /etc/init.d/apache2 start
redirecting to systemctl start apache2
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -n' for details.
linux-ua6r:/etc/apache2/vhosts.d # systemctl status apache2.service
apache2.service - apache
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: exit-code) since Tue, 2013-05-28 04:13:12 PDT; 15s ago
Process: 8953 ExecStop=/usr/sbin/httpd2 -D SYSTEMD -k stop (code=exited, status=0/SUCCESS)
Process: 8991 ExecStart=/usr/sbin/start_apache2 -D SYSTEMD -k start (code=exited, status=1/FAILURE)
Main PID: 8918 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/apache2.service
May 28 04:13:12 linux-ua6r.site systemd[1]: Failed to start apache.
May 28 04:13:12 linux-ua6r.site systemd[1]: Unit apache2.service entered failed state
如果我雖然刪除我vhosts.conf文件,啓動時沒有這個錯誤。 。 。 vhosts conf文件本身具有以下內容
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.Services.pes.com
ErrorLog server-logs/pes_error_log
CustomLog server-logs/pes_access_log common
WSGIScriptAlias /pes "/root/pweb/django.wsgi"
<Directory "/root/pweb/">
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
感謝有人能幫助。
使用Alias指令不等同於使用WSGIScriptAlias,並且不會產生相同的結果。很可能是mod_wsgi模塊未啓用Apache安裝,但擺脫WSGIScriptAlias不是解決方案。 –
看看這裏:http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives –
我應該看什麼。我寫了你提到的那個文件。如果您只想將WSGIScriptAlias更改爲Alias,則Alias指令不等同。如果您要使用Alias,則還必須使用SetHandler或AddHandler指令將.wsgi映射到mod_wsgi,併爲該目錄啓用ExecCGI。你的解決方案沒有提到任何有關這方面的內容,因此本身並不相同。請參閱http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive –