在具有虚拟主机和mod_wsgi的RHEL 7上重新启动Apache时出错

时间:2018-10-17 17:10:44

标签: django apache mod-wsgi rhel

我正在尝试在RHEL 7服务器上的Apache上运行Django应用程序。 我的httpd.conf如下

LoadModule wsgi_module modules/mod_wsgi.so

<VirtualHost *:8000>
    ServerAdmin admin@XH_Toolkit.com
    ServerName www.XH_Toolkit.com
    ServerAlias XH_Toolkit.com
    Alias /style.css /var/www/html/XH_Toolkit/home/static/home/style.css

    Alias /static/ /var/www/html/XH_Toolkit/home/static/

    <Directory /var/www/html/XH_Toolkit/home/static>
    Require all granted
    </Directory>


    WSGIDaemonProcess www.XH_Toolkit.com display-name=XH_Toolkit user=myuser group=myuser processes=2 threads=15

    WSGIScriptAlias / /var/www/html/XH_Toolkit/XH_Toolkit.wsgi
    WSGIProcessGroup www.XH_Toolkit.com
    ErrorLog "/var/www/html/XH_Toolkit/logs/error_log"
    CustomLog "/var/www/html/XH_Toolkit/logs/access_log" common
</VirtualHost>

当我尝试重新启动Apache时,输出如下

sudo service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

当我运行systemctl状态httpd.server

systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2018-10-17 16:43:13 UTC; 3min 53s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 6236 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 32418 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=1/FAILURE)
 Main PID: 6413 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─6413 /usr/sbin/httpd -DFOREGROUND
           ├─6415 /usr/sbin/httpd -DFOREGROUND
           ├─6416 /usr/sbin/httpd -DFOREGROUND
           ├─6417 /usr/sbin/httpd -DFOREGROUND
           ├─6418 /usr/sbin/httpd -DFOREGROUND
           └─6419 /usr/sbin/httpd -DFOREGROUND

当我注释掉虚拟主机的这一部分时,Apache可以重新启动并应用更改完全正常

    #WSGIDaemonProcess www.XH_Toolkit.com display-name=XH_Toolkit user=myuser group=myuser processes=2 threads=15


    #WSGIScriptAlias / /var/www/html/XH_Toolkit/XH_Toolkit.wsgi
    #WSGIProcessGroup www.XH_Toolkit.com
    #ErrorLog "/var/www/html/XH_Toolkit/logs/error_log"
    #CustomLog "/var/www/html/XH_Toolkit/logs/access_log" common

0 个答案:

没有答案