$ wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.37.tar.gz$ wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.5.tar.gz$ wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
第二步: 安装apr
$ tar -zxvf apr-1.6.5.tar.gz$ cd apr-1.6.5$ ./configure --prefix=/usr/local/apr-1.6.5$ make && make install
> 错误:rm: cannot remove `libtoolT‘: No such file or directory
> 解决方式:
><br/>> $ yum install -y libtool<br/>> $ sed -i ?s/"RM=‘\$RM‘"/"RM=‘\$RM -f‘"/ configure<br/>>
第三步:安装apr-utils
$ tar -zxvf apr-util-1.6.1.tar.gz$ cd apr-util-1.6.1$ ./configure --prefix=/usr/local/apr-util-1.6.1 --with-apr=/usr/local/apr-1.6.5$ make && make install
第四步: 安装httpd
$ tar -zxvf httpd-2.4.35.tar.gz$ ./configure --prefix=/usr/local/httpd-2.4.35 ??????????????--with-apr=/usr/local/apr-1.6.5 ??????????????--with-apr-util=/usr/local/apr-util-1.6.1 ??????????????--enable-so ??????????????--enable-ssl ??????????????--enable-cgi ??????????????--enable-rewrite ??????????????--with-pcre ??????????????--with-zlib ??????????????--with-mpm=event ??????????????--enable-modules=most ??????????????--enable-mpms-shared=all$ make && make install
选项说明
--enable-so
: 启用模块动态卸载--enable-ssl
: 开启SSL支持--enable-cgi
: 开启cgi支持--enablre-rewirte
: 支持URL重写--with-pcre
: 开启正则支持--with-zlib
: 开启数据压缩支持--enable-modules=most
: 尽可能多的启用模块--enable-mpms-shared=all
: 以共享的方式编译所有mpm模块--with-mpm=event
: 指定httpd工作模型为event
第五步: 启动Apache
$ cd /usr/local/httpd-2.4.35$ ./bin/apachectl start
记录依赖
- wget
- gcc
- libtool
- expat-devel
- pcre-devel
- openssl-devel
- libxml2-devel
Apache安装
原文地址:http://blog.51cto.com/idweb/2322075