fbpx

CentOS 5.5 安裝 Apache 2.2.x (教學筆記)

Cent 5.5 安裝 Apache 2.2.x,首先移除現有的版本

[root@centos ~]# rpm -qa | grep httpd
[root@centos ~]# yum remove httpd

下載 Apache 2.2.x (這裡用2.2.17做測試)
http://httpd.apache.org/download.cgi#apache22

安裝步驟如下:
1. 解壓縮 httpd-2.2.17.tar.gz

[root@centos ~]# tar zxvf httpd-2.2.17.tar.gz
[root@centos ~]# cd httpd-2.2.17

2. 執行 .configure 進行設定

[root@centos ~]# ./configure \
> --prefix=/usr/local/apache2 \
> --enable-so \
> --enable-headers \
> --enable-expires \
> --enable-rewrite \
> --enable-ssl \
> --disable-actions \
> --disable-asis \
> --disable-cgi \
> --disable-env \
> --disable-negotiation \
> --disable-status \
> --disable-userdir

第一次進行設定得時候發生錯誤,因此無法產生 makefile,錯誤訊息如下:

"configure: error: ...No recognized SSL/TLS toolkit detected"

因為我們在設定中選擇使用 "--enable-ssl" 但是找不到可用的 header 進行編譯,可透過安裝 SSL 套件來解決問題。

[root@centos ~]# yum install openssl-devel

重新執行上一個步驟 .configure 產生 makefile

3. 進行編譯與安裝

[root@centos ~]# make
[root@centos ~]# make install

完成!!

  2 comments for “CentOS 5.5 安裝 Apache 2.2.x (教學筆記)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料