編譯安裝LAMP之安裝apache2

2021-09-11 03:55:42 字數 3463 閱讀 4848

這裡我選擇版本號為2.4.16的apache

請確保系統已經安裝了編譯工具

$ ./configure --enable-soerror:這裡你可能會遇到這樣的錯誤

checking for chosen layout... apache

checking for working mkdir -p... yes

checking for

grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -e

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure:

configure: configuring apache portable runtime library...

configure:

checking for apr... no

configure: error: apr not found. please read the documentation.

解決方法:

$ wget 

$ wget

$ tar -zxf apr-1.4.6.tar.gz

$ cd apr-1.4.6

$ ./configure --prefix=/usr/local/apr

$ make

$ sudo

make

install

完成後再去apache目錄執行

$ ./configure --enable-so
error:這裡你可能會遇到這樣的錯誤

checking for chosen layout... apache

checking for working mkdir -p... yes

checking for

grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -e

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure:

configure: configuring apache portable runtime library...

configure:

checking for apr... yes

setting cc to "gcc"

setting cpp to "gcc -e"

setting cflags to " -g -o2 -pthread"

setting cppflags to " -d_reentrant -d_gnu_source"

setting ldflags to " "

configure:

configure: configuring apache portable runtime utility library...

configure:

checking for apr-util... no

configure: error: apr-util not found. please read the documentation.

解決方法:

$ wget 

$ tar -zxf apr-util-1.6.1.tar.gz

$ cd apr-util-1.6.1

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

$ make

$ sudo

make

install

然後重複執行前面安裝apache的操作,根據錯誤提示安裝相應的依賴

還會提示沒有pcre的錯誤

解決方法:

$ wget 

$ tar -zxf pcre-8.42.tar.gz

$ cd pcre-8.42

$ ./configure --prefix=/usr/local/pcre

$ make

$ sudo

make

install

到這裡依賴就全部安裝好了。

$ sudo make install到這裡,apache算是編譯安裝成功了

$ sudo /usr/local/apache2/bin/apachectl start
ah00558: httpd: could not reliably determine the server's fully qualified domain name, using 255.255.255.0 set the 'servername' directive globally to suppress this message
在位址列輸入提示的ip即可檢視執行結果!

編譯安裝lamp

1,停止防火牆及不必要的服務 etc init.d rpcbind stop etc init.d cups stop etc init.d postfix stop etc init.d qpidd stop etc init.d nfslock stop chkconfig rpcbind of...

LAMP編譯安裝

1 準備安裝環境 yum install y gcc pcre devel openssl devel expat devel 2 解壓縮 3 以 with included apr方式安裝httpd 4 切換目錄 至此httpd編譯安裝完成,後續的善後工作處理 7 建立apache系統使用者,供h...

LAMP編譯安裝

lnmp環境 mysql至5.x之後編譯安裝需要使用cmake工具了,所以需要先安裝cmake cmake 3.3.1安裝 原始碼目錄 cd opt modules cmake 3.3.1 configure make make install mysql安裝 groupadd mysql user...