一、安装apache
1.环境,我的环境是centos7.4
2.检查是否有用yum安装的
rpm -qa |grep httpd 有的话用 yum remove 删除
3.用yum 安装依赖包
yum install -y gcc gcc-c++ apr-devel apr-util-devel openssl openssl-devel expat-devel libevent-devel pcre-devel
4.下载apache的tar 可以去官网下载 http://httpd.apache.org/download.cgi
cd /usr/local/src/ wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.35.tar.gz 之前的不行了,下载最新的 wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.37.tar.gz
解压 tar xvvf httpd-2.4.35.tar.gz
预编译
cd httpd-2.4.35 ./configure --prefix=/usr/local/apache24 --enable-so --enable-ssl --enable-cgi \ --enable-rewrite --enable-modules=most --with-zlib --with-pcre --with-apr=/usr \ --with-apr-util=/usr --enable-mpms-shared=all