服务器做网站用什么环境好,0元购怎么在网站做,怎么建设一个论坛网站,马蜂窝网站怎么做内容动态#xff0c;内容通过程序的执行结果返回。
通过编写脚本#xff0c;完成配置#xff0c;实现访问页面返回Hello World。
实现步骤#xff1a;
1、安装python模块 dnf install python3-mod_wsgi 2、编写脚本
在/var/www/cgi-bin/目录下编写脚本#xff1a; vim…内容动态内容通过程序的执行结果返回。
通过编写脚本完成配置实现访问页面返回Hello World。
实现步骤
1、安装python模块 dnf install python3-mod_wsgi 2、编写脚本
在/var/www/cgi-bin/目录下编写脚本 vim /var/www/cgi-bin/heihei.wsgi 脚本内容如下 def application(environ, start_response): status 200 OK output bHello World response_headers [(Content, text/plain),(Content-Length, str(len(output)))] start_response(status, response_headers) return [output] 3、配置文件
1、/etc/httpd/conf.d/目录下的vhost.conf文件 vim /etc/httpd/conf.d/vhost.conf 配置文件内容如下
directory /www allowoverride none require all granted /directory virtualhost 192.168.229.135:80 servername www.heihei.com WSGIScriptAlias / /var/www/cgi-bin/heihei.wsgi /virtualhost 2、本地解析文件 vim /etc/hosts 在文件中添加 192.168.229.135 www.heihei.com 3、windows的本地解析文件hosts
在文件中添加 192.168.229.135 www.heihei.com 4、重启httpd服务 systemctl restart httpd 5、测试结果