编译安装apache之前,先考虑两个问题:
1、防火墙和selinux是否关闭:
查看防火墙状态:systemctl status firewalld.service
关闭防火墙:systemctl stop firewalld.service
查看selinux状态:(1)cd /etc/selinux
(2)vi cofig #编辑config文件 将SELINUX= enforcing->改为disiabled
(3)保存后在命令行执行:setenforce 0
2、解决apache安装包依赖关系,需要先安装apr、apr-util和pcre;
(1)挂载光驱:cd /mnt ; mount /dev/cdrom /mnt/rom; 挂载完成后:cd /mnt/Packages
rpm -ivh vsftpd-3.0..........tab键补全;
查看是否安装完vsftpd:rpm -qa | grep vsftpd;
systemctl start vsftpd.service 激活vsftpd
systemctl status vsftpd.service 查看vsftpd状态
yum install make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel pcre-devel kernel keynel keyutils patch perl autoconf # yum 安装这些依赖包
(2)编译安装apr(apr-1.5.2.tar.gz)
下载地址:http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gz
[root@localhost lamp]# tar zxvf apr-1.5.2.tar.gz
[root@localhost lamp]# cd apr-1.5.2
[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root @localhost apr-1.5.2]# make && make install