<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>
"); //-->

博客專(zhuān)欄

EEPW首頁(yè) > 博客 > httpd源碼編譯安裝

httpd源碼編譯安裝

發(fā)布人:電子禪石 時(shí)間:2021-10-21 來(lái)源:工程師 發(fā)布文章

httpd源碼編譯安裝

什么是編譯安裝——編譯:將源代碼變?yōu)闄C器可執行的代碼文件。安裝:將可執行文件安裝到操作系統里,才可以使用。

一、下載httpd源碼包

在官網(wǎng)上下載httpd源碼包http://httpd.apache.org,也可以在linux中輸入rpm -qi httpd查看到當前下載源碼httpd的****



下載到linux的data目錄下,然后進(jìn)行解壓:

1
2
3
[root@ansibledata]#rz
 
[root@ansibledata]#tar xf httpd-2.4.39

注意:一定要在解壓后的httpd目錄下安裝,下面的編譯需要用到httdp目錄下的腳本,所以我用cd httpd把目錄切換到httpd中去進(jìn)入cd httpd-2.4.27/

二、查看INSTALL、README 這些幫助信息

查詢(xún) cat INSTALL,里邊有簡(jiǎn)單的安裝過(guò)程,和一些例子

 

查詢(xún) cat README,(what is it ?)里邊有一些Apache 的功能介紹

三、configure腳本(檢測當前編譯環(huán)境)

(1)./configure --help 查詢(xún)這個(gè)腳本的用法,

--prefix=PREFIX  指定默認安裝總目錄, 默認為/usr/local/

--sysconfdir=/PATH 配置文件安裝位置,默認就安裝到指定安裝總目錄的下面

 Optional Features:  需要什么功能

--disable-FEATURE 關(guān)閉某些功能

--enable-FEATURE 開(kāi)啟某些功能

 

下面我們就來(lái)執行這個(gè)腳本,添加一些簡(jiǎn)單的設置

手工創(chuàng )建賬號:

1
[root@ansiblehttpd-2.4.39]#useradd -r -u 80 -d /var/www  -s /sbin/nologin httpd

(1)首先安裝development-tools包,因為沒(méi)有C編譯工具,缺少gcc,這時(shí)候,我們需要下一個(gè)包組development tools

yum -y groupinstall "Development Tools"

1
[root@ansiblehttpd-2.4.39]#yum groupinstall "development tools"

(2)首次安裝包,會(huì )有一些提示錯誤,第一次安裝沒(méi)有一些準備好的包,可以根據提示錯誤進(jìn)行安裝:

1
[root@ansiblehttpd-2.4.39]#./configure  --prefix=/app/httpd --sysconfdir=/etc/httpd24 --enable-ssl --disable-status

(3)我們只需按照提示的錯誤,把需要的都安裝上去(直到?jīng)]有提示錯誤)

先查詢(xún)缺少的 yum search apr-devel(一般關(guān)于開(kāi)發(fā)的都叫 devel)

再安裝 yum -y install apr-devel

1
[root@ansiblehttpd-2.4.39]#yum install apr-devel

 

(4)此時(shí)缺少apr-util包,按照提示錯誤來(lái)進(jìn)行下一步安裝:

1
[root@ansiblehttpd-2.4.39]#yum install apr-util-devel
1
[root@ansiblehttpd-2.4.39]#./configure  --prefix=/app/httpd --sysconfdir=/etc/httpd24 --enable-ssl --disable-status

 

 (5)根據提示錯誤繼續往下安裝,此時(shí)缺少pcre包,安裝pcre-devel包

1
[root@ansiblehttpd-2.4.39]#yum install pcre-devel

 繼續執行指定路徑的包安裝

1
[root@ansiblehttpd-2.4.39]#./configure  --prefix=/app/httpd --sysconfdir=/etc/httpd24 --enable-ssl --disable-status

(6)根據提示的錯誤,安裝openssl-devel包:

1
[root@ansiblehttpd-2.4.39]#yum install openssl-devel

(7)再執行指定路徑的包安裝,此時(shí)就已經(jīng)完成指定路徑包的安裝。

1
[root@ansiblehttpd-2.4.39]#./configure  --prefix=/app/httpd --sysconfdir=/etc/httpd24 --enable-ssl --disable-status

(8)configure腳本完全執行成功(多了一個(gè)Makefile)沒(méi)有Makefile 

 

四、make和make install編譯

(1)進(jìn)行make編譯,make 編譯后,多了很多.o .lo 文件 (二進(jìn)制文件),在此之前的工作,任何用戶(hù)都能做,并且都在httpd-2.4.27 這個(gè)目錄下進(jìn)行

1
[root@ansiblehttpd-2.4.39]#make

(2)make install 安裝到指定位置,只有root 能做,此時(shí)httpd的編譯完成。

1
[root@ansiblehttpd]#make install

(3)切換到/app/httpd/bin執行程序目錄下,此時(shí)去執行服務(wù)啟動(dòng),都必須是./apachectl start,不太方便,我們可以指定變量路徑

1
2
3
4
5
[root@ansiblehttpd]#cd /app/httpd/bin
[root@ansiblebin]#pwd
/app/httpd/bin
[root@ansiblebin]#echo 'PATH=/app/httpd/bin:$PATH'  > /etc/profile.d/httpd.sh 定義一個(gè)/app/httpd/bin的配置文件路徑
[root@ansiblebin]#apachectl start   啟動(dòng)當前編譯的httpd服務(wù)

此時(shí)在網(wǎng)上輸入本機的IP地址就可以訪(fǎng)問(wèn)信息:

 五、安裝后的配置

 導入幫助手冊man           

  vim /etc/man_db.conf

  加入一行 MANDATORY_MANPATH                       /app/httpd/man

 

 


*博客內容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀(guān)點(diǎn),如有侵權請聯(lián)系工作人員刪除。



關(guān)鍵詞: httpd

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>