记录一次django2.0的部署

  • apache2.4
  • django2.0
  • mod_wsgi4.2
  • centos 7

[安装python3.6]

安装virtualenv
pip3 install virtualenv
启用env等

安装dj、mod_wsgi等
pip install mod_wsgi django==2.0
报错:
MySQL config
安装MySQL devel可解决 yum install mysql-devel

安装apache2.4
yum install httpd

编译安装mod_wsgi:
下载安装
./configure --with-python=/usr/local/python3.6
make && make install

/etc/httpd/conf/httpd.conf文件添加
LoadModule wsgi_module modules/mod_wsgi.so

/etc/httpd/conf.d/下新建*.conf文件,文件内容如下
图片
重启apache

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×