编译最新的httpd 2.4.18
编译提示apr版本低于1.4 rpm repo源是1.39的
因此编译apr
下载
apr
apr-util
apr-iconv
[root@ansible-direc html]# ls
apr-1.5.2 apr-iconv-1.2.1 apr-util-1.5.4 axel-2.4 centos httpd-2.4.18.tar.gz nginx-1.9.11.tar.gz
apr-1.5.2.tar.bz2 apr-iconv-1.2.1.tar.gz apr-util-1.5.4.tar.gz axel-2.4.tar.gz httpd-2.4.18 nginx-1.9.11
查看三个包的./configure --help|grep apr 看到需要先安 apr 再按 iconv 再安装 util
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make
make install
cd ../apr-iconv-1.2.1
./configure --prefix=/usr/local/apr-icon --with-apr=/usr/local/apr/
make
make install
cd ../apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make
make install
cd ../httpd-2.4.18
rpm -e --nodeps httpd
./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd/httpd.conf --with-so --with-apr-util=/usr/local/apr-util/ #其他参数需要自选
make
make install
启动
[root@ansible-direc html]# /usr/local/apache/bin/apachectl stop
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@ansible-direc html]# lsof -i :80
[root@ansible-direc html]# /usr/local/apache/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@ansible-direc html]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 100033 root 4u IPv6 170557 0t0 TCP *:http (LISTEN)
httpd 100034 daemon 4u IPv6 170557 0t0 TCP *:http (LISTEN)
httpd 100035 daemon 4u IPv6 170557 0t0 TCP *:http (LISTEN)
httpd 100036 daemon 4u IPv6 170557 0t0 TCP *:http (LISTEN)
[root@ansible-direc html]# ip ro
192.168.186.0/24 dev eth0 proto kernel scope link src 192.168.186.132
192.168.92.0/24 dev eth1 proto kernel scope link src 192.168.92.134
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
default via 192.168.186.2 dev eth0
访问 http://192.168.92.134
二进制程序:
# vim /etc/profile.d/apache.sh
PATH=/usr/local/apache/bin:/usr/local/apache/sbin:$PATH
export PATH
头文件输出给系统:
# ln -sv /usr/local/apache/include /usr/include/httpd
库文件输出:
# vim /etc/ld.so.conf.d/httpd.conf
加入如下路径
/usr/local/apache/lib
让系统重新生成库文件路径缓存
# ldconfig
注意 加进去不会立即生效,因为我们当前系统上所有库文件,都会事先被加载缓存下来,
缓存到 /etc/ld.so.cache
但是新加的是找不到,
所以
要么重启系统
要么通知系统重新缓存
ldconfig 命令 通知系统重新缓存库文件
ldconfig -v 通知系统重新缓存库文件,-v显示过程
如下 只会去这些库里面找库文件,我们新装的httpd 后面带的库不会被加载
[root@ansible-direc html]# ldconfig -v |grep "^[^[:space:]]"
/usr/lib64/mysql:
/lib:
/lib64:
/usr/lib:
/usr/lib64:
/lib/i686: (hwcap: 0x0008000000000000)
/lib64/tls: (hwcap: 0x8000000000000000)
/usr/lib64/tls: (hwcap: 0x8000000000000000)
/usr/lib64/sse2: (hwcap: 0x0000000004000000)
/lib/i686/nosegneg: (hwcap: 0x0028000000000000)
导出man文件:
未导入的时候,我们man是不可以的。要我们在man.config最后面加入路径即可。
# vim /etc/man.config
MANPATH /usr/local/apache/man
# man httpd
或者不加如路径直接-M看
man -M /usr/local/apache/man httpd