安装python模块
挂载 [root@www ~]# mount /dev/sr0 /mnt
mount: /mnt: /dev/sr0 already mounted on /run/media/root/RHEL-8-4-0-BaseOS-x86_64.
安装 [root@www ~]# dnf install python3-mod_wsgi -y
脚本内容
[root@www conf.d]cd /etc/httpd/conf.d/
[root@www conf.d]# vim /var/www/cgi-bin/hell.wsgi
写入
def application(environ,start_response):
status = '200 OK'
output = b'Hello World'
response_headers = [('Content-type','text/plain'),('Content-Length',str(len(output)))]
start_response(status,response_headers)
return [output]
配置文件内容
[root@www conf.d]# vim vhost.conf
重启服务
[root@www conf.d]# systemctl restart httpd
访问: