CentOS6.5下源码编译安装httpd2.4.23

前端之家收集整理的这篇文章主要介绍了CentOS6.5下源码编译安装httpd2.4.23前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、安装环境为CentOS6.5,64位

[root@mylinuxapp]#uname-r
2.6.32-504.30.3.el6.x86_64
[root@mylinuxapp]#cat/etc/redhat-release
CentOSrelease6.5(Final)
[root@mylinuxapp]#

2、官网上下载源码包

wgethttp://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.23.tar.gz

3、解压目录,进入进行configure配置操作,指定安装路径

./configure--prefix=/application/httpd
checkingforchosenlayout...Apache
checkingforworkingmkdir-p...yes
checkingforgrepthathandleslonglinesand-e.../bin/grep
checkingforegrep.../bin/grep-E
checkingbuildsystemtype...x86_64-unknown-linux-gnu
checkinghostsystemtype...x86_64-unknown-linux-gnu
checkingtargetsystemtype...x86_64-unknown-linux-gnu
configure:
configure:ConfiguringApachePortableRuntimelibrary...
configure:
checkingforAPR...no
configure:error:APRnotfound.Pleasereadthedocumentation.

4、当提示没有检测到APR时,我们需要到官网下载最新版apr包,解压安装。

wgethttp://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wgethttp://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
tar-xfapr-1.4.5.tar.gz
cdapr-1.4.5
./configure--prefix=/usr/local/apr
make&&makeinstall
tar-xfapr-util-1.5.4.tar.gz
cdapr-util-1.5.4
./configure--prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-config
make&&makeinstall

5、再次来安装httpd,此时指定apr

[root@mylinuxhttpd]#./configure--prefix=/application/httpd--with-apr=/usr/local/apr/bin/apr-1-config
............
Installingheaderfilesmkdir/application/httpd/includeInstallingbuildsystemfilesmkdir/application/httpd/buildInstallingmanpagesandonlinemanualmkdir/application/httpd/manmkdir/application/httpd/man/man1mkdir/application/httpd/man/man8mkdir/application/httpd/manualmake[1]:Leavingdirectory`/application/app/httpd-2.4.23'
[root@mylinuxhttpd]#make&&makeinstall

6、启动httpd,测试服务是否启动

[root@mylinuxhttpd]#/application/httpd/bin/httpd
[root@mylinuxhttpd]#lsof-i:80COMMANDPIDUSERFDTYPEDEVICESIZE/OFFNODENAMEhttpd5440root3uIPv4460886160t0TCP*:http(LISTEN)httpd5441daemon3uIPv4460886160t0TCP*:http(LISTEN)httpd5442daemon3uIPv4460886160t0TCP*:http(LISTEN)httpd5443daemon3uIPv4460886160t0TCP*:http(LISTEN)httpd5573daemon3uIPv4460886160t0TCP*:http(LISTEN)

wKiom1fEI2qCXZlEAAALXDqn3FA031.png-wh_50

7、添加man帮助文件

vim /etc/man.config
添加MANPATH /application/httpd/man

此时就可以使用man命令查看httpd的帮助文档了。

猜你在找的CentOS相关文章