1.安裝準備
(1)下載apache安裝包
http://archive.apache.org/dist/httpd/
2.下載安裝 apache 依賴關聯包(共四個:apr,apr-iconv,apr-util,pcre)
http://archive.apache.org/dist/apr/
(1)安裝apr
# tar zxvf apr-1.4.6.tar.gz # cd apr-1.4.6 # ./configure # make # make install
(2)安裝apr-iconv
# tar -zxvf apr-iconv-1.2.1.tar.gz # cd apr-iconv-1.2.1 # ./configure --with-apr=/usr/local/apr # make # make install
(3)安裝apr-util
# tar -zxvf apr-util-1.5.4.tar.gz # cd apr-util-1.5.4 # ./configure --with-apr=/usr/local/apr # make # make install
(4)安裝pcre
http://sourceforge.net/projects/pcre
# tar -zxvf pcre-8.37.tar.gz # cd pcre-8.37 # ./configure # make # make install
3.安裝apache
# tar -zxvf httpd-2.4.9.tar.gz # cd httpd-2.4.9 # ./configure --prefix=/usr/local/apache2 # make # make install
啓動 apache
# /usr/local/web/apache/bin/apachectl start
關閉防火牆
# service iptables stop
在瀏覽器裏輸入:http://主機IP地址 就可以看到結果了
注意安裝相關依賴包,根據步驟查看執行結果是否有錯誤。