在CentOS7下安装APACHE2.4.6
安装步骤如下:
首先检查系统是否安装有APACHE、APR、APR-UTIL以及GCC
#rpm -qa|grep http
#rpm -qa|grep apr
#rpm -qa|grep gcc
然后挂载光盘镜像:
#mount /dev/cdrom /mnt
依次安装APR、APR-UTIL、GCC、HTTPD
#rpm -ivh gcc-4.8.5-11.el7.x86_64.rpm
#rpm -ivh apr-1.4.8-3.el7.x86_64.rpm
#rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm
#rpm -ivh httpd-2.4.6-45.el7.centos.x86_64.rpm
安装完成启动APACHE
#systemctl start httpd
查看端口是否启动
# netstat -tnul |grep ":80"
设置APACHE服务开机启动
#systemctl enable httpd
设置WWW目录为APACHE属主跟属组
#chown apache:apache /var/www
检查防火墙设置
#firewall-cmd --list-ports
添加80端口并永久开放
#firewall-cmd --permanent --zone=public --add-port=80/tcp
#firewall-cmd --reload
设置APACHE配置文件
#vi /etc/httpd/conf/httpd.conf
将Require all denied全部改为Require all granted
在浏览器中访问https://localhost