標籤:httpd的安裝
1、安裝環境為CentOS6.5,64位
[[email protected] app]# uname -r2.6.32-504.30.3.el6.x86_64[[email protected] app]# cat /etc/redhat-release CentOS release 6.5 (Final)[[email protected] app]#
2、官網上下載源碼包
wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.23.tar.gz
3、解壓目錄,進入進行configure配置操作,指定安裝路徑
./configure --prefix=/application/httpdchecking for chosen layout... Apachechecking for working mkdir -p... yeschecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuconfigure: configure: Configuring Apache Portable Runtime library...configure: checking for APR... noconfigure: error: APR not found. Please read the documentation.
4、當提示沒有檢測到APR時,我們需要到官網下載最新版apr包,解壓安裝。
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gzwget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gztar -xf apr-1.4.5.tar.gz cd apr-1.4.5 ./configure --prefix=/usr/local/apr make && make install tar -xf apr-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
[[email protected] httpd]# ./configure --prefix=/application/httpd --with-apr=/usr/local/apr/bin/apr-1-config ............Installing header filesmkdir /application/httpd/includeInstalling build system filesmkdir /application/httpd/buildInstalling man pages and online manualmkdir /application/httpd/manmkdir /application/httpd/man/man1mkdir /application/httpd/man/man8mkdir /application/httpd/manualmake[1]: Leaving directory `/application/app/httpd-2.4.23‘[[email protected] httpd]# make && make install
6、啟動httpd,測試服務是否啟動
[[email protected] httpd]# /application/httpd/bin/httpd [[email protected] httpd]# lsof -i:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEhttpd 5440 root 3u IPv4 46088616 0t0 TCP *:http (LISTEN)httpd 5441 daemon 3u IPv4 46088616 0t0 TCP *:http (LISTEN)httpd 5442 daemon 3u IPv4 46088616 0t0 TCP *:http (LISTEN)httpd 5443 daemon 3u IPv4 46088616 0t0 TCP *:http (LISTEN)httpd 5573 daemon 3u IPv4 46088616 0t0 TCP *:http (LISTEN)
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/86/92/wKiom1fEI2qCXZlEAAALXDqn3FA031.png-wh_500x0-wm_3-wmp_4-s_1320069510.png" title="QQ20160829195500.png" alt="wKiom1fEI2qCXZlEAAALXDqn3FA031.png-wh_50" />
7、添加man協助檔案
vim /etc/man.config
添加MANPATH /application/httpd/man
此時就可以使用man命令查看httpd的協助文檔了。
本文出自 “隨風而飄” 部落格,請務必保留此出處http://yinsuifeng.blog.51cto.com/10173491/1844051
CentOS6.5下源碼編譯安裝httpd2.4.23