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