linux's docs

21.7.0: LAMP-iptables/selinux


0. 启动服务

# /usr/local/apache2/bin/apachectl start

1. 配置防火墙

vim /etc/sysconfig/iptables
************************************
## 开放80端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
************************************

# 重启iptables
service iptables start

2. 配置selinux

semanage fcontext -a -t httpd_sys_content_t '/usr/local/apache2/htdocs(/.*)?'
restorecon -vFR /usr/local/apache2/htdocs

3. 检查结果

# vim /usr/local/apache2/htdocs/index.php
************************************
<?php
phpinfo()
?>
************************************

Contents