標籤:
# wget http://www.apache.org/dist/httpd/httpd-2.2.9.tar.gz (此處我是直接用的下載好的包)
# tar -zxvf httpd-2.2.9.tar.gz
# cd httpd-2.2.9
# ./configure --prefix=/usr/local/httpd --enable-mods-shared=‘proxy proxy_ajpproxy_balancer‘
# make
報錯 make: *** 沒有指明目標並且找不到 makefile。 停止。
經網上尋找原因為 沒有安裝gcc
run yum -y install gcc
然後再運行(下面這三步已耗用時間比較長)
./configure --prefix=/usr/local/httpd --enable-mods-shared=‘proxy proxy_ajp proxy_balancer‘
make
make install
然後啟動apache : cd /usr/local/httpd/bin ->./apachectl start
報錯:Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName
解決:vi /usr/local/httpd/conf/httpd.conf
加入一句 ServerName localhost:80
再一次執行 cd /usr/local/httpd/bin ->./apachectl start
運行成功
但是輸入http://192.168.0.101 還是無法訪問
最後關閉防火牆:service iptables stop
在瀏覽器輸入http://192.168.0.101
小插曲:
最開始虛擬機器連不上網 沒辦法用yum 安裝make 採用rpm命令安裝的make命令
下載make-3.81-19.el6.i686.rpm
運行:rpm -ivh make-3.81-19.el6.i686.rpm
Apache 編譯安裝