环境需要安装openssl、apache的mod_ssl扩展,iptables中开放443的访问。
同时配置好httpd支持mod_ssl模块。
在目录/etc/httpd/conf打开httpd.conf。
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"。
会看到cgi访问目录,也可以把这个目录改为自定义目录。
在cgi目录下添加a.cgi
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "Hello World"
改动后重启httpd
/etc/init.d/httpd restart
然后在页面访问80或者443就可以看到hello world