1. 安装Apache
安装apache2
apt-get install apache2
安装apache开发包
apt-get install apache2-dev
2. 安装配置mod_wsgi
安装mod_wsgi
apt-get install libapache2-mod-wsgi-py3
下载mod_wsgi源代码压缩包
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.7.1.tar.gz
解压缩指令
tar xvfz 4.7.1.tar.gz
配置源代码
./configure --with-apxs=/usr/bin/apxs --with-python3=/usr/lib/python3.8
--with-apxs=
后面的路径是apxs在服务中的路径, 可用whereis命令查看
(boboblog) root@iZuf64r7a771sbhalu4icqZ:/home# whereis apxs
apxs: /usr/bin/apxs /usr/share/man/man1/apxs.1.gz
同理可查看python3.8的路径
(boboblog) root@iZuf64r7a771sbhalu4icqZ:/home# whereis python3.8
pytho