Centos7 編譯安裝apache
centos7 編譯安裝apache
一,需要軟體:
1.apr-1.5.2.tar.gz
http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz
2.apr-util-1.5.4.tar.gz
http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz
3.pcre-8.38.tar.gz
http://exim.mirror.fr/pcre/pcre-8.38.tar.gz
4.httpd-2.4.37.tar.gz
http://apache.fayea.com//httpd/httpd-2.4.37.tar.gz
一。安裝依賴
1.安裝apr
yum install gcc libtools -y
tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/data/server/apr
make && make install
2.安裝apr-util
tar -zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/data/server/apr-util --with-apr=/data/server/apr
make && make install
3.安裝pcre
yum install gcc-c++ -y
tar zxf pcre-8.38.tar.gz
cd pcre-8.38
./configure --prefix=/data/server/pcre
make && make install
4.安裝apache伺服器
tar zxf httpd-2.4.37.tar.gz
cd httpd-2.4.37
./configure --prefix=/data/server/apache2 --with-apr=/data/server/apr --with-apr-util=/data/server/apr-util --with-pcre=/data/server/pcre
make && make install
5.修改配置