无效命令 WSGIDaemonProcess 在 CentOS 6.7 上部署 Django 应用程序 [英] Invalid command WSGIDaemonProcess Deploy Django application on CentOS 6.7

查看:40
本文介绍了无效命令 WSGIDaemonProcess 在 CentOS 6.7 上部署 Django 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CentOS 6.7 上使用 Django 1.8Apache 服务器版本:Apache/2.2.15 (Unix).

I am using Django 1.8 on CentOS 6.7 with Apache Server version: Apache/2.2.15 (Unix).

我已按照 如何在 CentOS 7 上使用 Apache 和 mod_wsgi 服务 Django 应用程序.但是在最后一步,当我使用命令启动 Apache 服务器时:service httpd start 而不是 systemctl start httpd 因为我有 Centos 6.7 而不是 CentOS 7根据教程.

I have followed the steps in How To Serve Django Applications with Apache and mod_wsgi on CentOS 7. But at last step when I start the Apache server with command : service httpd start instead of systemctl start httpd beacuse I have Centos 6.7 not CentOS 7 according to tutorial.

出现以下错误:

Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/django.conf:
Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module ot included in the server configuration

您可以在此处查看 django.conf:

you can check the django.conf here:

Alias /static /home/ftpispy/ispy/static
<Directory /home/ftpispy/ispy/static>
    Require all granted
</Directory>
<Directory /home/ftpispy/ispy/ispy>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>
WSGIDaemonProcess ispy python-path=/home/ftpispy/ispy:/home/ftpispy/ispy/venv/lib/python2.7/site-packages
WSGIProcessGroup ispy
WSGIScriptAlias / /home/ftpispy/ispy/ispy/wsgi.py

提前致谢.请建议使用 djnago 1.8CentOS 6.7 上部署的任何其他选项.

Thanks in advance.Please suggest any other option to deploy on CentOS 6.7 with djnago 1.8.

推荐答案

确保你已经安装了 wsgi 包,运行

make sure you have wsgi package installed, by running

sudo a2enmod wsgi

如果没有安装,请执行以下命令进行安装

if its not installed, execute below commands to install

对于python2

sudo apt-get install python-pip apache2 libapache2-mod-wsgi

对于python3

sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3

这篇关于无效命令 WSGIDaemonProcess 在 CentOS 6.7 上部署 Django 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆