Httpd-2.4.4源码编译
【所需安装包】
apr-1.4.5.tar.gz
apr-util-1.3.12.tar.gz
pcre-8.21.tar.bz2
httpd-2.4.4.tar.bz2
【Apache编译过程出现的问题】
1.解决apr not found问题。
①tar -zxvf apr-1.4.5.tar.gz -C /usr/local/src/
② ./configure --prefix=/usr/local/src/apr
③make
④make install
2.解决APR-util not found问题
①tar -zxvf apr-util-1.3.12.tar.gz -C /usr/local/src/
②./configure--prefix=/usr/local/src/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
③make
④make install
3.再次在httpd的解压缩目录中执行
./configure --with-apr=/usr/local/apr/bin/apr-1-config 后出现
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
4.下载:pcre-8.21.tar.bz2
①tar -jxvf apr-util-1.3.12.tar.gz -C /usr/local/src/
cd pcre-8.21
②./configure --prefix=/usr/local/src/pcre
③make
④make install
5.编译Apache
①tar -jxvf httpd-2.4.4.tar.bz2 -C /usr/local/src/
②./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config
③ make
④make install
【功能扩展】
①编写bash脚本实现可由service 来对httpd服务的
start、stop、restart、status等行为的操作。
②修改编写的bash脚本,实现httpd可接受chkconfig的
管理,实现3,5级下的开机自动启动。
<1> 在编写的脚本上面加入两行。
<2>将httpd服务加入到chkconfig的管理中。