django项目配置apache

记录一下这两天自己部署django+apache遇到的一些问题

apache安装 yum install httpd -y
配置文件,启动 systemctl start httpd.service
Invalid command 'WSGIDaemonProcess' 遇到这个问题,应该就是mod_wsgi没有安装
然后需要安装mod_wsgi
有三种方法:

wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.14.tar.gz
tar xvfz mod_wsgi-4.5.14.tar.gz
make
make install
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.14.tar.gz
tar xvfz mod_wsgi-4.5.14.tar.gz
python setup.py install
pip install mod_wsgi
# 导出 apache 所需的 mod_wsgi 模块
mod_wsgi-express install-module

mod_wsgi安装完以后,还要在apache的配置文件中加载LoadModule wsgi_module modules/mod_wsgi.so

在安装mod_wsgi的过程中可能会遇到一些问题

  1. fatal error: Python.h: No such file or directory
    解决办法:sudo yum install python-devel
  2. apxs: command not found
    解决办法:yum install httpd-devel
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容