Centos7 安装Apache http server实战笔记

下载所需源码安装包:
[root@centos7 ~]# wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.33.tar.gz
[root@centos7 ~]# wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.3.tar.gz
[root@centos7 ~]# wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
[root@centos7 ~]# wget https://ftp.pcre.org/pub/pcre/pcre-8.12.tar.gz

解压源码安装包:
[root@centos7 ~]# tar -xzvf apr-1.6.3.tar.gz
[root@centos7 ~]# tar -xzvf apr-util-1.6.1.tar.gz
[root@centos7 ~]# tar -xzvf pcre-8.12.tar.gz
[root@centos7 ~]# tar -xzvf httpd-2.4.33.tar.gz

安装apr源码包:
[root@centos7 ~]# cd apr-1.6.3/
[root@centos7 apr-1.6.3]# ./configure --prefix=/usr/local/apr
[root@centos7 apr-1.6.3]# make&&make install

安装apr-util源码包:
[root@centos7 ~]# cd apr-util-1.6.1/
[root@centos7 apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util
configure: error: APR could not be located. Please use the --with-apr option.

[root@centos7 apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@centos7 apr-util-1.6.1]# make&&make install

安装pcre源码包:
[root@centos7 ~]# cd /pcre-8.12/
[root@centos7 pcre-8.12]# ./configure --prefix=/usr/local/pcre
[root@centos7 pcre-8.12]# make&&make install

安装apache httpd server
[root@centos7 ~]# cp -r apr-1.6.3 httpd-2.4.33/srclib/apr
[root@centos7 ~]# cp -r apr-util-1.6.1 httpd-2.4.33/srclib/apr-util
[root@centos7 ~]# cd httpd-2.4.33/
[root@centos7 httpd-2.4.33]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=most --enable-proxy-http=shared --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-included-apr
[root@centos7 httpd-2.4.33]# make
[root@centos7 httpd-2.4.33]# make install
[root@centos7 httpd-2.4.33]# cd /usr/local/apache2/bin
[root@centos7 bin]# ./apachectl -v
Server version: Apache/2.4.33 (Unix)
Server built: May 27 2018 16:56:09

猜你喜欢

转载自blog.51cto.com/3364897/2120818