网站众筹该怎么做百度网站关键词优化
内容动态,内容通过程序的执行结果返回。
通过编写脚本,完成配置,实现访问页面返回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 = b'Hello 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、测试结果