CentOS下安裝Apache 2.2.24 步驟

來源:互聯網
上載者:User

1、解壓安裝包:tar -zxvf httpd-2.2.24.tar.gz
2、進入解壓後的安裝包:cd httpd-2.2.24
3、配置編譯安裝路徑及參數:./configure --prefix=/opt/httpd/ --enable-so --enable-ssl --enable-rewrite --with-zlib
4、編譯安裝:make && make install
5、清除編譯快取檔案:make clean
6、配置啟動項:cp /opt/httpd/bin/apachectl /etc/rc.d/init.d/httpd
7、賦予執行許可權:chmod +x /etc/rc.d/init.d/httpd
8、修改本地名稱:

vim /opt/httpd/conf/httpd.conf(:set nu | :98)

ServerName 127.0.0.1:80
9、解決 service httpd does not support chkconfig 問題:

vim /etc/rc.d/init.d/httpd
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server

10、加入系統啟動項:chkconfig --add httpd
11、開機啟動:chkconfig httpd on
12、啟動Apache服務:service httpd start


安裝apache過程中遇到的問題以及解決方案:

1.[warn] module php5_module is already loaded, skipping  -->是在apache安裝目錄conf下httpd.conf裡重複了一行LoadModule php5_module modules/libphp5.so,重複資料刪除的行就行。

2.Cannot load /…/libphp5.so into server: /…/libphp5.so: undefined symbol: _efree        -->此錯誤是由於重裝php時,沒有關閉apache。解決方案:調轉到php安裝目錄,執行"make clean",然後從新安裝php,記得安裝之前關閉apache。

3.從源碼安裝apache2,遇到錯誤:cannot install `libaprutil-1.la'   -->由於configure過一次,沒有清理乾淨,需要清理。可以刪除掉源碼目錄,重新解壓源碼,重新安裝,或者make clean.

4.apache啟動報錯(98)Address already in use: make_sock: could not bind to address [::]:80

-->     #netstat -lnp|grep 80

#ps 連接埠號碼為80的進程

#kill -9 連接埠號碼為80的進程(可能進程不止一個)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.