checking for APR... no
configure: error: APR not found. Please read the documentation.
cd /tmp/52lamp
tar -zxvf apr-1.4.2.tar.gz
cd apr-1.4.2
./configure && make && make installtar -zxvf apr-util-1.3.9.tar.gz
cd apr-util-1.3.9
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
若出現 pcre-config for libpcre not found,續下一步。
unzip -o pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install./configure --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
# 其他參數如 --prefix 等自行添加
echo $? # 輸出 0 表示配置成功
make && make installcp /usr/local/httpd/bin/apachectl /sbin/apachectl start/etc/rc.d/rc.local 加入 /sbin/apachectl startcp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd#chkconfig: 345 85 15#description: httpd for 52lamp 20101016 21:54chmod a+x /etc/rc.d/init.d/httpdchkconfig --add httpdntsysv 即可看到服務。ps -e | grep httpdvi /etc/sysconfig/iptables 新增 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPTservice iptables restartApache 配置不檢查參數正確性,錯誤參數會被靜默忽略。用 echo $? 檢查返回碼(0 為成功)。