Linux安装Apache服务器tomcat启动后因防火墙无法访
<p>我们一般在linux上部署好的apache服务,启动了也没有报异常,但是访问不了,大部分就是防火墙没有开启你服务的端口,如果你端口是80,则需要修改下面配置 就可以解决 查询是否有打开80端口,如果没有可通过两种方式处理:</p><pre><code>/etc/init.d/iptables status </code></pre><p>1.修改vi /etc/sysconfig/iptables命令添加使防火墙开放80端口(推荐)</p><pre><code>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT </code></pre><p>2.关闭防火墙</p><pre><code>/etc/init.d/iptables stop
#start 开启
#restart 重启</code></pre><p>永久性关闭防火墙</p><pre><code>chkconfig --level 35 iptables off</code></pre><ol><li>3</li></ol><p>查看firewalld状态,如果是dead状态,即防火墙未开启</p><pre><code>systemctl status firewalld</code></pre><p><br>开启防火墙,没有任何提示即开启成功</p><pre><code>systemctl start firewalld</code></pre><p>重启</p><pre><code>systemctl restart firewalld</code></pre><p><br></p><ol><li>4</li></ol><p>再次通过systemctl status <strong>firewalld</strong>查看<strong>firewalld</strong>状态,显示<strong>running</strong>即已开启了。</p><ol><li>5</li></ol><p>如果要关闭防火墙设置,可能通过systemctl stop <strong>firewalld</strong>这条指令来关闭该功能。</p>
<p><br></p>
