- 将自己电脑上的Python脚本文件上传到虚拟机
/var/www/cgi-bin/
目录下
[root@localhost conf.d]# cd /var/www/cgi-bin/
[root@localhost cgi-bin]# rz -E
rz waiting to receive.
- 编辑
vhost.conf
配置文件
[root@localhost conf.d]# vim vhost.conf
<virtualhost 192.168.209.140:80>
WSGIScriptAlias / /var/www/cgi-bin/haha.wsgi
servername www.heihei.com
</virtualhost>
- 配置本地解析文件
[root@localhost conf.d]# vim /etc/hosts
- 安装python模块
[root@localhost conf.d]# dnf install python3-mod_wsgi -y
- 重启httpd服务
[root@localhost conf.d]# systemctl restart httpd
- 测试
[root@localhost conf.d]# curl www.heihei.com
Hello World