1.yum安裝
須要包:apr apr-util pcreshell
(1).wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr- 1.7.0.tar.gz(下載apr) cd /usr/local/src/apr-1.7.0 ./configure --prefix=/usr/local/apr make make install
(2).wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz(下載apr-util)apache
cd /usr/local/src/apr-util-1.6.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make install
(3).wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz (下載pcre)ide
cd /usr/local/src/pcre... ./configure --prefix=/usr/local/pcre make make install
分別解壓到/usr/local/src得到源碼包tar -xvf 壓縮包 -C /usr/local操作系統
configure: 探測操做系統目標環境 檢查有沒有
cc或gcc configure是shell腳本 生成Makefile code
make : 編譯 (gcc)
make install : 安裝
/usr/local/src : 存放源碼包get
2.httpd安裝:
(1).cd /usr/local/src/apache-2.4...
./configure --prefix=/usr/local/apache24 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre源碼
make make install
(make 報錯, 解決問題,make clean
把生成 的中間文件刪掉 再 make)it
yum install expat-devel (XML解析)編譯