linux之centos升级httpd

*、why

用户对操作系统进行漏洞扫描后,发现当前httpd版本较低,漏洞较多,故提出升级的需求

 

*、前提

什么是httpd,它能用来干嘛?
若停止或删除该服务会如何?
升级后,旧版本如何处理呢?
最终:
如何升级?
建议先在自己的机器上运行出一套可行的升级指令后,再在正式服务器上操作。

 

*、最后的结果

 

#切换到root用户

#下载软件包:
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz

#可能会需要的系统环境工具,其他自己安装过程中提示缺失的补上即可
yum install gcc gcc-c++
#系统环境不同,上面的工具缺失也不同,因人而异,这都是小问题
#安装apr
tar xf apr-1.6.3.tar.gz 
cd apr-1.6.3/
./configure
make
make install

#安装apr-util:
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
#若遇到xml/apr_xml.c:
centos6.*:yum install expat-devel
other:sudo apt-get install libexpat1-dev

wget http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.gz --no-check-certificate

#安装pcre
tar xf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/usr/local/pcre
make && make install

#安裝httpd
 ./configure  --prefix=/usr/local/httpd24  --sysconfdir=/etc/httpd24  --enable-so  --enable-ssl  --enable-cgi  --enable-rewrite  --with-zlib  --with-pcre  --with-mpm=prefork  --enable-modules=most  --enable-mpms-shared=all --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr
 make && make install
 
#若想将新安装的替换掉旧版本,记得备份原有httpd文件
cp /usr/local/httpd24/bin/httpd /usr/sbin/httpd覆盖即可,记得备份原有httpd版本
#以上流程及其文件版本没有问题,亲测可行
#启动和关闭
apachectl start
apachectl stop
 

 

*、至于后续将其修改为启动服务等操作,google或baidu吧,O(∩_∩)O哈哈~

     

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值