apache2.4.39编译安装

很多时候,yum安装apache满足不了需求,这时候需要编译安装
下文中所用到的所有文件可从此链接下载依赖包直达链接,提取码3gsj

版本:
apache:   2.4.39
apr-util:1.6.1
apr:     1.7.0
目录: /home---->根据实际情况,需要编译哪个路径就在哪个路径下编译

其中apr,apr-util是所需要的依赖,最新版的httpd2.4需要依赖apr-1.4以上版本和apr-1.5以上版本。
编译方法:

# tar vxf apr-1.7.0.tar.gz
# cd apr-1.7.0
# ./configure --prefix=/home/httpd/apr
# make
# make install

解压apr到/home/httpd下,并进行编译安装

# tar vxf apr-util-1.6.1.tar.gz
# cd apr-util-1.6.1
# ./configure --prefix=/home/httpd/apr-util --with-apr=/home/httpd/apr
# make
# make install

解压apr-util到/home/httpd下,编译安装

# tar vxf httpd-2.4.39.tar.bz2

# mv apr-1.7.0 httpd-2.4.39/srclib/apr
# mv apr-util-1.6.1 httpd-2.4.39/srclib/apr-util
# cd httpd-2.4.39
# ./configure --prefix=/home/httpd/apache --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
# make
# make install

最后进行httpd的编译,编译httpd之前把上一步解压出来的apr和apr-util文件复制到httpd-2.4.39/srclib/文件夹下,再进行httpd编译操作,至此完成。

发布了37 篇原创文章 · 获赞 83 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/tootsy_you/article/details/96177684
今日推荐