一、下载Apache2 的所需的安装编译包
apr包下载:(/app/software)wget http://mirror.bit.edu.cn/apache//apr/apr-1.6.3.tar.gzarp-util包下载:(/app/software)http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gzhttpd-2.4.33包下载:(/app/software)wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
二、开始编译安装apache2
1、安装依赖包yum -y install expat-devel openssl pcre gcc2、创建apache2安装的指定目录[root@localhost software]# mkdir -p /app/apache23、编译安装apr[root@localhost software]# tar -zxvf apr-1.6.3.tar.gz[root@localhost apr-1.6.3]# ./configure --prefix=/app/apache2/apr/[root@localhost apr-1.6.3]# make[root@localhost apr-1.6.3]# make install4、编译安装apr-util[root@localhost software]# tar -zxvf apr-util-1.6.1.tar.gz[root@localhost apr-util-1.6.1]# ./configure --prefix=/app/apache2/apr-util/ --with-apr=/app/apache2/apr/[root@localhost apr-util-1.6.1]# make install5、解压httpd-2.4.33编译包[root@localhost software]# tar -zxvf httpd-2.4.33.tar.gz6、把apr-1.6.3与apr-util-1.6.1复制到httpd-2.4.33/srclib/目录下[root@localhost software]# mv apr-1.6.3 apr[root@localhost software]# mv apr-util-1.6.1 apr-util[root@localhost software]# cp -r apr httpd-2.4.33/srclib/[root@localhost software]# cp -r apr-util httpd-2.4.33/srclib/7、编译安装apache2[root@localhost httpd-2.4.33]# ./configure --prefix=/app/apache2/ --with-included-apr --enable-so --enable--deflate=shared --enable-expires=shared --enable-ssl --enable-rewrite=shared[root@localhost httpd-2.4.33]# make && make install8、修改apache2配置文件[root@localhost apache2]# vi conf/httpd.conf```# ServerAdmin: Your address, where problems with the server should be# e-mailed. ?This address appears on some server-generated pages, such# as error documents. ?e.g. admin@your-domain.com#ServerAdmin you@example.com```9、启动测试apache2[root@localhost apache2]# ./bin/apachectl start
三、Fpm 定制工具包
fpm -s dir -t rpm -n apache2 -v 2.4.33-d ‘pcre,expat-devel,openssl,openssl-devel‘ -f /app/apache2/
Fpm 之 Apache2 rpm 包定制
原文地址:http://blog.51cto.com/12965094/2130612