多语言展示
当前在线:353今日阅读:193今日分享:47

centos 7 安装Apache

centos 7改变比较大,刚刚接触的时候可以安装Apache服务进行练手下,熟悉下安装软件的一些步骤。
工具/原料
1

centos7

2

Apache

方法/步骤
1

添加Google的DNS和更新下sed -i '1a nameserver 8.8.8.8' /etc/resolv.confyum makecache fastyum  -y  update

2

安装Apache服务yum -y install httpd httpd-devel gcc gcc-c++ libstdc++-devel autoconf automake libtool

3

开启Apache服务加入启动项systemctl start  httpd.servicesystemctl enable httpd.service

4

防火墙允许Apache服务firewall-cmd --add-service=http --permanentsystemctl restart firewalld.service

5

访问测试http://ip

注意事项
1

Apache的服务,安装的时候是httpd;

2

firewall-cmd --add-service=http --permanent 需要加入参数permanent,永久的意思才不会重启失效。

推荐信息