Apache无法使用mod_wsgi启动Django WEB应用程序,我无法找出原因。
启动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 j@j.com
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>
感谢有人可以提供帮助。
答案 0 :(得分:1)
问题似乎是以下行行(要么注释掉,要么确保mod_wsgi已加载并正在使用或使用别名指令)
WSGIScriptAlias /pes "/root/pweb/django.wsgi"
要使用alias指令,请使用以下内容,但请注意,您可能希望让mod_wsgi正常工作。
Alias /pes "/root/pweb/django.wsgi"
要查看mod_wsgi是否已加载,请尝试此操作并查找模块名称:
sudo /usr/sbin/apache2ctl -M
背景: 您还需要验证目标目录/文件是否存在及其运行状况 ll /root/pweb/django.wsgi