在centos6编译安装httpd-2.4

来源:互联网 发布:小区网络布线 编辑:程序博客网 时间:2024/05/23 12:33
安装httpd-2.4依赖于apr-1.4+, apr-util-1.4+,apr: apache portable runtime,解决跨平台实现CentOS 6:默认:apr-1.3.9, apr-util-1.3.9安装前准备开发包:开发环境包组:Development Tools,Server相关包:pcre-devel,openssl-devel expat-devel下载源代码并解压缩:httpd-2.4.27.tar.bz2apr-1.6.2.tar.bz2apr-util-1.6.0.tar.bz2----------centos6 编译安装httpd-2.4方法一1、安装apr-1.4+cd apr-1.6.2./configure --prefix=/app/aprmake && make install2、安装apr-util-1.4+cd ../apr-util-1.6.0./configure --prefix=/app/apr-util --with-apr=/app/apr/make -j 2 && make install3、编译安装httpd-2.4cd ../httpd-2.4.27./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/app/apr/ --with-aprutil=/app/apr-util/ --enable-modules=most --enablempms-shared=all --with-mpm=preforkmake -j 4 && make install----------centos6 编译安装httpd-2.4方法二1、cp -av apr-util-1.6.0 httpd-2.4.27/srclib/apr-util2、cp -av apr-1.6.2 httpd-2.4.27/srclib/apr3、cd httpd-2.4.27/./configure --prefix=/usr/local/httpd24 --enable-so  --enable-ssl  --enable-cgi  --enable-rewrite   --with-zlib  --with-pcre  --with-included-apr  --enable-modules=most   --enable-mpms-shared=all  --with-mpm=prefork4、make && make installHttpd编译过程:/usr/local/apache24/build/config.nice        自带的服务控制脚本:/usr/local/httpd24/bin/apachectl5、在centos6 编译安装httpd-2.4vim /etc/profile.d/httpd24.shexport PATH=/app/http24/bin:$PATHvim /etc/man.configMANPATH /usr/local/apache24/man6、自定义启动脚本(参考httpd-2.2的服务脚本)cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24vim /etc/rc.d/init.d/httpd24apachectl=/usr/local/httpd24/bin/apachectlhttpd=$ { HTTPD-/usr/local/httpd24/bin/httpd }pidfile=$ { PIDFILE -/usr/local/httpd24/logs/httpd.pid }lockfile=${LOCKFILE-/var/lock/subsys/httpd24}chkconfig –add httpd24 ;chkconfig –list httpd24
原创粉丝点击