在介绍Apache服务之前,先了解一下Web网络服务和其他两个服务。
配置文件
/etc/httpd/conf/httpd.conf 参数
部署Apache服务
[root@apache-server ~]# yum install httpd.x86_64 httpd-manual -y 安装服务
[root@apache-server ~]# systemctl start httpd 启动服务
[root@apache-server ~]# systemctl enable httpd.service 开机自启
[root@apache-server ~]# firewall-config 将服务加入防火墙策略,图形界面方法
[root@apache-server ~]# firewall-cmd --permanent --add-service=http 命令方法
[root@apache-server ~]# firewall-cmd --permanent --add-service=https
[root@apache-server ~]# firewall-cmd --reload
[root@apache-server ~]# systemctl restart httpd.service 重启服务,使设置生效
修改默认端口
[root@apache-server ~]# vim /etc/httpd/conf/httpd.conf
43 Listen 8080
[root@apache-server ~]# systemctl restart httpd.service selinux处于强制状态
[root@apache-server ~]# vim /etc/httpd/conf/httpd.conf
44 Listen 6666
[root@apache-server ~]#