对于cgi表单
mkdir -p /var/www/html/cgi
semaneger fcontent -a -t httpd_sys_script_exec_t '/var/www/html/cgi(/.*)?'
restorecon -Rvvf /var/www/html/cgi/
vim /var/www/html/cgi/index.cgi
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print `date`;
此处的反向单引号是键盘感叹号左边的
chmod +x /var/www/html/cgi/index.cgi
/var/www/html/cgi/index.cgi 直接执行下脚本
cd /etc/httpd/conf.d/
vim a_default.conf
<Directory "/var/www/html/cgi">
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>
重启服务