1. 程式人生 > >CentOS 7.4編譯安裝Apache 2.4.29

CentOS 7.4編譯安裝Apache 2.4.29

Apache2.4.29依賴包:

apr-1.6.3.tar.gz    下載:wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.3.tar.gz apr-util-1.6.1.tar.gz  下載:wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz pcre-8.41.tar.gz    下載:wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz apache2.4.29  下載:wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.29.tar.gz

安裝apr:

tar -zxvf apr-1.6.3.tar.gz cd apr-1.6.3 ./configure --prefix=/usr/local/apache/apr make make install

安裝apr-util:

tar -zxvf apr-util-1.6.1.tar.gz cd apr-util-1.6.1 ./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr make make install

安裝pcre:

tar -zxvf pcre-8.41.tar.gz cd  pcre-8.41 ./configure --prefix=/usr/local/apache/pcre make make install

安裝apache2.4.29:

tar -zxvf httpd-2.4.29.tar.gz cd httpd-2.4.29 ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apache/apr --with-apr-util=/usr/local/apache/apr-util/ --with-pcre=/usr/local/apache/pcre make make install

vi /usr/local/apache/conf/httpd.conf   在“#ServerName www.example.com:80”下面新增一行如下:   ServerName localhost:80  

啟動服務: /usr/local/apache/bin/apachectl start