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
checking
for
chosenlayout...Apache
checking
for
working
mkdir
-p...
yes
checking
for
grep
thathandleslonglinesand-e...
/bin/grep
checking
for
egrep
...
/bin/grep
-E
checkingbuildsystem
type
...x86_64-unknown-linux-gnu
checkinghostsystem
type
...x86_64-unknown-linux-gnu
checkingtargetsystem
type
...x86_64-unknown-linux-gnu
configure:
configure:ConfiguringApachePortableRuntimelibrary...
configure:
checking
for
APR...no
configure:error:APRnotfound.Please
read
thedocumentation.
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
cd
apr-1.4.5
.
/configure
--prefix=
/usr/local/apr
make
&&
make
install
tar
-xfapr-util-1.5.4.
tar
.gz
cd
apr-util-1.5.4
.
/configure
--prefix=
/usr/local/apr-util
-with-apr=
/usr/local/apr/bin/apr-1-config
make
&&
make
install
5、再次來安裝httpd,此時指定apr
[root@mylinuxhttpd]
#./configure--prefix=/application/httpd--with-apr=/usr/local/apr/bin/apr-1-config
............
Installingheaderfilesmkdir
/application/httpd/includeInstalling
buildsystemfilesmkdir
/application/httpd/buildInstalling
man
pagesandonlinemanualmkdir
/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)
7、添加man幫助文件
vim /etc/man.config
添加MANPATH /application/httpd/man
此時就可以使用man命令查看httpd的幫助文檔了。
http://xxxxxx/Linuxjc/1156004.html TechArticle