Linux學習筆記 10(搭建apache服務器(一))

1. mkdir soft(創建一個software安裝文件夾(不是重要步驟))

2.cd soft

3.下載appache,我下載的是httpd-2.4.9,貌似2.4版本後開始是個大坑,安裝各種報錯,排坑ing

wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.g

4.解壓

tar zxf httpd-2.4.9.tar.gz

5. cd httpd-2.4.9

6. 開始第一次失敗嘗試安裝!!!!

yum install apr apr-util apr-util-devel    (httpd 2.4版本後貌似這個無效了!!!後續還是還是要繼續安裝....等等庫)

7.  ./configure --prefix=/usr/local/apache

configure: error: APR not found.  Please read the documentation.

報錯!!!我明明裝了APR呀!!!(絕望ing)

8. ./configure -help | grep apr     查看文檔,其實沒看出好歹來(氣呀),繼續baidu

9.貌似重新下載安裝apr,apr-util ,pcre (爲啥是pcre啊啊啊??)

APR

cd ..

wget http://archive.apache.org/dist/apr/apr-1.7.0.tar.g

tar zxf apr-1.7.0.tar.gz

cd apr-1.7.0

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

make

make install 

10.apr-util

cd ..

wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz

tar zxf apr-util-1.6.1.tar.gz

cd apr-util-1.6.1

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

報錯configure: error: APR could not be located. Please use the --with-apr option.

又報APR錯誤,方的呀,還好問題不大,主要是卻少了apr的配置路徑,加上去就好

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

make

又報錯~吐血三升

xml/apr_xml.c:35:19: 錯誤:expat.h:沒有那個文件或目錄

缺少expat.h庫

yum install expat-devel

make

make install 

剩下最後一個啊啊啊啊啊,prec,希望不要在出錯了,我已經沒有血可以吐了

11.pcre

cd..

wget http://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz

tar zxf pcre-8.43.tar.gz

cd pcre-8.43

./configure --prefix=/usr/local/prce

make

make install

12.最後最後了,結果還是崩潰了

cd..

cd httpd-2.4.9

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

make&&make install

報錯

make[2]: [htpasswd] 錯誤 1
make[2]: 離開目錄“/usr/local/src/httpd-2.4.27/support”
make[1]: [all-recursive] 錯誤 1
make[1]: 離開目錄“/usr/local/src/httpd-2.4.27/support”
make: *** [all-recursive] 錯誤 

make install

參考:https://blog.csdn.net/qq_41772936/article/details/80878635

cd /soft/
cp -r apr-1.7.0  /soft/httpd-2.4.9/srclib/apr
cd apr-1.7.0
./configure --prefix=/usr/local/apr
make && make install

cd..
cp -r apr-util-1.6.1  /soft/httpd-2.4.9/srclib/apr-util
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

cd..
cp -r pcre-8.43  /soft/httpd-2.4.9/srclib/pcre
cd /usr/pcre-8.43 
./configure --prefix=/usr/local/pcre
make && make install

cd..
cd httpd.2.4.9
./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make && make install

----------------------------------------------------------------------------------------------------------------------------------------------------------------

待續.......

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章