Apache httpd 源码编译安装

源码编译安装Apache httpd 2.4.41

安装环境:centos7.8 + httpd2.4.41 + apr-1.7.0 + apr-util-1.6.1 + pcre-8.43

基础环境安装

yum -y install openssl-devel bzip2

1、下载编译apr1.7.0

下载地址:http://www.linuxfromscratch.org/blfs/view/svn/general/apr.html

$ wget https://archive.apache.org/dist/apr/apr-1.7.0.tar.bz2
$ tar -xvf apr-1.7.0.tar.bz2
$ cd apr-1.7.0/
$ ./configure --prefix=/opt/apr
$ make
$ make install

注:arm系统使用apr1.6.5

2、下载编译apr-util

下载地址:https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.bz2

$ tar -xvf apr-util-1.6.1.tar.bz2 
$ cd apr-util-1.6.1/
$ ./configure --prefix=/opt/apr-util --with-apr=/opt/apr
$ make
$ make install

编译apr-util需要指定:--with-apr 

注:在x86平台上可以使用最新的apr-util版本,因为在移植到arm平台的时候,使用较新的版本总是编译不过,所以使用apr-util-1.5.4这个版本

3、下载编译pcre8.43

下载地址:https://sourceforge.net/projects/pcre/files/pcre/8.43/

$ unzip pcre-8.43.zip 
$ ./configure --prefix=/opt/pcre
$ make
$ make install

4、源码编译Apache httpd

Apache httpd源码地址下载:http://archive.apache.org/dist/httpd/,搜索2.4.41版本

$ tar -xvf httpd-2.4.41.tar.gz 
$ cd httpd-2.4.41/
$ ./configure --prefix=/usr/local/httpd2.4.41 --with-pcre=/opt/pcre --with-apr=/opt/apr --with-apr-util=/opt/apr-util
$ make
$ make install

注:ARM编译使用/configure --prefix=/usr/local/apache2 --host=x86 --enable-cgi  --enable-rewrite --enable-mods-shared=all --with-pcre=/usr/local/pcre --with-includer-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

5、验证关闭

[root@baidu1 bin]# ./apachectl 
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe45:4e96%ens33. Set the 'ServerName' directive globally to suppress this message
[root@baidu1 bin]# ps -ef |grep httpd
root       7892      1  0 14:52 ?        00:00:00 /usr/local/httpd2.4.41/bin/httpd
daemon     7893   7892  0 14:52 ?        00:00:00 /usr/local/httpd2.4.41/bin/httpd
daemon     7894   7892  0 14:52 ?        00:00:00 /usr/local/httpd2.4.41/bin/httpd
daemon     7895   7892  0 14:52 ?        00:00:00 /usr/local/httpd2.4.41/bin/httpd
root       7978   5594  0 14:52 pts/4    00:00:00 grep --color=auto httpd

#关闭
[root@baidu1 bin]# killall httpd

搞定。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值