linux下手動安裝apache

2022-03-18 23:09:12 字數 2075 閱讀 9143

下面是官方文件的要求,必須安裝apr、apr-util、pcre,gcc-c++等包,文件url位址

所以,沒有這些支援的需要提前安裝好不然會出現個各種錯誤。

tar -zxvf apr-util-1.6.1.tar.gz

cd apr-util-1.6.1

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

執行編譯

make

make install

在編譯安裝階段可能會報以錯誤

xml/apr_xml.c:35:10: fatal error: expat.h: 沒有那個檔案或目錄

#include

^~~~~~~~~

compilation terminated.

make[1]: *** [/usr/local/apr-util/apr-util-1.6.1/build/rules.mk:206:xml/apr_xml.lo] 錯誤 1

make[1]: 離開目錄「/usr/local/apr-util/apr-util-1.6.1」

make: *** [/usr/local/apr-util/apr-util-1.6.1/build/rules.mk:118:all-recursive] 錯誤 1

在安裝 apache 相關的依賴軟體 apr-util 時可能會報這個錯誤,這是因為系統缺失 expat 庫。centos下(我這裡的環境是centos 7)root超級管理員使用者執行以下命令,非root超級管理員前面加上 sudo 用以獲取許可權執行:

yum install -y expat-devel

安裝 expat 庫解決該問題。

命令用不了,還得自己找

,最後在找到了expat_2.0.1.orig.tar.gz包

解壓後進入解壓目錄

./configure

make

make install

然後回到apr-util-1.6.1目錄

./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

make

make install

成功注意,一定要重新./configure –prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

解決之後再次執行

./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

---make

出現錯誤:

解決如下:

進入 apache 的安裝目錄。(視個人安裝情況而不同)

cd /usr/local/apache2.4/conf/

編輯 httpd.conf 檔案,搜尋 「#servername」 ,新增 servername localhost:80。

再重新啟動 apache 即可。

/usr/local/apache2.4/bin/apachectl restart

然後瀏覽器訪問 localhost

至此, apache 伺服器編譯安裝完成。

Linux下手動安裝screen

簡單說來就是自己用screen原始碼編譯安裝 now please check the pathnames in the makefile and inthe user configuration section in config.h.then type make to make screen.g...

linux下手動安裝nginx

yum install y gcc c yum install y pcre pcre devel yum install y zlib zlib devel yum install y openssl openssl devel linux系統不同可能這些命令會有所差異。因為配置不高,也沒伺服器,...

linux下手動安裝git教程

git是乙個開源的分布式版本控制系統,可以有效 高速的處理從很小到非常大的專案版本管理。而國外的github和國內的coding都是專案的託管平台。但是在使用git工具的時候,第一步要學會如何安裝git,本教程就手把手教大家如何手動編譯安裝git。1 介紹 使用coding管理專案,上面要求使用的g...