linux下源碼包安裝apache方法見解

準(zhǔn)備工作:去apache官方網(wǎng)站下載apache源碼包

1.首先需要將apache源碼包移動到linux服務(wù)器下

2.記性解壓縮 命令一半 使用tar -zxvf ?[壓縮包名稱](你下載到apache源碼包名)

3.進入壓縮之后的源碼包文件夾

4.進入之后進行檢測操作

?./configure --prefix=/usr/local/apache2/ --sysconfdir=/usr/local/apache2/etc/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared

分解上面命令作用:

./configure ? ? ? #檢查編譯環(huán)境 執(zhí)行后將生成MakeFile文件

--prefix=/usr/local/apache2/?#指定安裝路徑

--sysconfdir=/usr/local/apache2/etc/?#指定在單個機器上使用的只讀數(shù)據(jù)的安裝位置.

--with? ?#with選項來指定具體的軟件包地址,通過without選項來指定不使用指定的軟件包。

-included-apr#指定C頭文件的安裝位置.其他語言如C++的頭文件也可以使用此選項

--enable#當(dāng)你想開啟某個文件的的時候可以使用它

5.檢測完成之后進行

make 進行編譯操作

6.編譯完成之后進行安裝操作

make install

7.安裝完成測試?

?啟動Apache測試:

????????/usr/local/apache2/bin/apachectl start

ps?aux | grep httpd ?檢測進行

netstat -tlun |grep :80 檢測80端口

如果存在則apache安裝完成

特別注意:

? ? ?安裝apache 的時候經(jīng)常容易出現(xiàn)一些錯誤,如果出現(xiàn) 如下錯誤我們應(yīng)如何調(diào)整

? 1.configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.? ??

解決方法:

? ??tar -zxvf??apr-1.4.6.tar.gz

? ? tar -zxvf??apr-util-1.4.1.tar.gz?

????cp?-r??/lamp/apr-1.4.6??/lamp/httpd-2.4.7/srclib/apr

????cp?-r??/lamp/apr-util-1.4.1??/lamp/httpd-2.4.7/srclib/apr-util

?2.configure: error: pcre-config for libpcre not found. PCRE is required and available from

解決方法:

? ??tar zxvf pcre-8.34.tar.gz

? ?cd /lamp/pcre-8.34?

? ./configure && make && make install

3.checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures

解決方法:

? ? ?yum install openssl-devel

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容