Apache 編譯安裝

來源:互聯網
上載者:User

標籤:

# 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 編譯安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.