Apache2的是作为一个CentOS的软件包,因此我们可以直接用下面命令安装它:

    yum install httpd

  现在配置系统在引导时启动Apache

    chkconfig --levels 235 httpd on

  并启动Apache

    /etc/init.d/httpd start

 

 之后,到/etc/sysconfig/iptables (防火墙)中添加下面内容:

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

然后重新启动防火墙/网关:

    service iptables restart

 

  现在,您的浏览器到http://192.168.0.100,你应该看到Apache2的测试页:


centos 安装apache
Apache 2测试网页

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-06-09
  • 2022-03-01
  • 2022-02-16
猜你喜欢
  • 2021-05-31
  • 2022-12-23
  • 2021-05-18
  • 2021-07-14
  • 2021-07-16
相关资源
相似解决方案