根據http://jasonpowell42.wordpress.com/2013/04/05/install-apache-2-4-4-on-centos-6-4/ ,但是安裝時要注意configure
cd /usr/src/
wget http://ftp.tc.edu.tw/pub/Apache//httpd/httpd-2.4.9.tar.gz
tar xzvf httpd-2.4.9.tar.gz
cd httpd-2.4.9
./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr --mandir=/usr/share/man --sysconfdir=/etc/httpd
make; make install
cd /etc/httpd
rm httpd.conf
ln -s conf/httpd.conf httpd.conf
yum -y install libxml2 libxml2-devel
cd /usr/src/
wget http://tw2.php.net/get/php-5.3.28.tar.gz/from/this/mirror
tar xzvf php-5.5.13.tar.gz
cd /usr/src/php-5.5.13
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-config-file-path=/etc
make
make install
libtool --finish /usr/src/php-5.5.13/libs
ln -s /usr/local/apache2/modules /etc/httpd/modules
修改/etc/init.d/httpd,將內容改為以下
apachectl=/usr/local/apache2/bin/apachectl
httpd=${HTTPD-usr/local/apache2/bin/httpd}
存檔離開。
接著 service httpd start就可以了。
請記住,若有設定過httpd.conf的話,請注意這一篇的提醒事項。
參考資料
- [Linux] 重新編譯 PHP 時出現錯誤的解決方式
- Upgrading to 2.4 from 2.2
- How to Install Apache2.4 PHP5 and MySQL from Source on Debian Linux
- Apache 2.4 Configure
- Install Apache 2.4.4 on CentOS 6.4
- Linux Commands For Shared Library Management & Debugging Problem
- How install Apache 2.4 PHP 5.4 and MySQL 5.5.21 on Windows 7
- [Apache] Apache 從 2.2 換至 2.4 httpd.conf 的調整筆記 (windows 環境)
- Apache Module mod_slotmem_shm
- Apache Module mod_access_compat
- Apache Module mod_unixd
- Linux Tutorial: How to Build Apache, PHP5 and MySQL From Source ( the Hard Way)
- Linux: Set OR Change The Library Path
- Installing Apache 2.4 and PHP 5.4 from source
沒有留言:
張貼留言