Apache fails to start a Django WEB Application using mod_wsgi and I am not able to figure out why.
Apache无法使用mod_wsgi启动Django WEB应用程序,我无法弄清楚原因。
The error in starting of apache is this
启动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
If i remove my vhosts.conf file though, it starts without this error . . . The vhosts conf file itself has the following contents
如果我删除了我的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>
Appreciate if someone could help.
感谢有人可以提供帮助。
1 个解决方案
#1
1
Problem seems to be the following line line(Either comment it out, or make sure mod_wsgi is loaded and working or use alias directive)
问题似乎是以下行行(要么注释掉,要么确保mod_wsgi已加载并正在工作或使用别名指令)
WSGIScriptAlias /pes "/root/pweb/django.wsgi"
To use the alias directive use following, but note, you probably want get mod_wsgi to work.
要使用别名指令,请使用以下内容,但请注意,您可能希望获得mod_wsgi。
Alias /pes "/root/pweb/django.wsgi"
To see if mod_wsgi is loaded, try this and look for the module name:
要查看mod_wsgi是否已加载,请尝试此操作并查找模块名称:
sudo /usr/sbin/apache2ctl -M
Background: You also want verify that the target directory/file exist and its health ll /root/pweb/django.wsgi
背景:您还需要验证目标目录/文件是否存在及其运行状况ll /root/pweb/django.wsgi
#1
1
Problem seems to be the following line line(Either comment it out, or make sure mod_wsgi is loaded and working or use alias directive)
问题似乎是以下行行(要么注释掉,要么确保mod_wsgi已加载并正在工作或使用别名指令)
WSGIScriptAlias /pes "/root/pweb/django.wsgi"
To use the alias directive use following, but note, you probably want get mod_wsgi to work.
要使用别名指令,请使用以下内容,但请注意,您可能希望获得mod_wsgi。
Alias /pes "/root/pweb/django.wsgi"
To see if mod_wsgi is loaded, try this and look for the module name:
要查看mod_wsgi是否已加载,请尝试此操作并查找模块名称:
sudo /usr/sbin/apache2ctl -M
Background: You also want verify that the target directory/file exist and its health ll /root/pweb/django.wsgi
背景:您还需要验证目标目录/文件是否存在及其运行状况ll /root/pweb/django.wsgi