httpd的升级

本文主要介绍了如何对httpd服务器进行升级操作,包括升级的重要性和步骤,帮助用户确保服务器的安全和性能。

httpd的升级

//先安装旧版本 我这里为2.4.37版本
[root@server ~]# apachectl -v
Server version: Apache/2.4.37 (Unix)
Server built:   Nov 11 2019 09:07:35
//下载新版本
[root@server ~]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.41.tar.bz2
--2019-11-11 09:17:13--  https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.41.tar.bz2
正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
正在连接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:7072373 (6.7M) [application/octet-stream]
正在保存至: “httpd-2.4.41.tar.bz2”

100%[=================================>] 7,072,373   64.4KB/s 用时 68s    

2019-11-11 09:18:22 (101 KB/s) - 已保存 “httpd-2.4.41.tar.bz2” [7072373/7072373])

[root@server ~]# ls
httpd-2.4.41.tar.bz2
//解压新版本
[root@server ~]# tar xf httpd-2.4.41.tar.bz2 
[root@server ~]# ls
httpd-2.4.41  httpd-2.4.41.tar.bz2
//备份旧版本的主程序和配置文件
[root@server ~]# cd /usr/local/apache/
[root@server apache]# cp -r bin/  /tmp
[root@server apache]# ls /tmp
bin
systemd-private-55e25075dbcd4fdd898a15227b0deba8-chronyd.service-GEUtay
systemd-private-55e25075dbcd4fdd898a15227b0deba8-vgauthd.service-Q3WsQv
systemd-private-55e25075dbcd4fdd898a15227b0deba8-vmtoolsd.service-wTlsDt
[root@server apache]# ls /tmp/bin/
ab         checkgid   envvars-std   htdbm     httpd       rotatelogs
apachectl  dbmmanage  fcgistarter   htdigest  httxt2dbm
apxs       envvars    htcacheclean  htpasswd  logresolve
[root@server apache]# ls bin/
ab         checkgid   envvars-std   htdbm     httpd       rotatelogs
apachectl  dbmmanage  fcgistarter   htdigest  httxt2dbm
apxs       envvars    htcacheclean  htpasswd  logresolve
[root@server ~]# cd /etc/
[root@server etc]# ls httpd24/
extra  httpd.conf  magic  mime.types  original
[root@server etc]# cp -r httpd24/   /tmp
[root@server etc]# ls /tmp/httpd24/
extra  httpd.conf  magic  mime.types  original
// 编译新版本(不要执行安装)编译时使用的命令在httpd.nice中
[root@server httpd-2.4.41]# ./configure --prefix=/opt/apache \
> --sysconfdir=/etc/httpd24 \
> --enable-so \
> --enable-ssl \
> --enable-cgi \
> --enable-rewrite \
> --with-zlib \
> --with-pcre \
> --with-apr=/usr/local/apr \
> --with-apr-util=/usr/local/apr-util/ \
> --enable-modules=most \
> --enable-mpms-shared=all \
> --with-mpm=prefork
[root@server httpd-2.4.41]# make
// 将编译目录中的httpd复制到旧版本目录中
[root@server httpd-2.4.41]# ls
ABOUT_APACHE     config.log     InstallBin.dsp  NWGNUmakefile
acinclude.m4     config.nice    LAYOUT          os
Apache-apr2.dsw  config.status  libhttpd.dep    README
Apache.dsw       configure      libhttpd.dsp    README.cmake
apache_probes.d  configure.in   libhttpd.mak    README.platforms
ap.d             docs           LICENSE         ROADMAP
build            emacs-style    Makefile        server
BuildAll.dsp     httpd          Makefile.in     srclib
BuildBin.dsp     httpd.dep      Makefile.win    support
buildconf        httpd.dsp      modules         test
buildmark.o      httpd.mak      modules.c       VERSIONING
CHANGES          httpd.spec     modules.lo
CMakeLists.txt   include        modules.o
config.layout    INSTALL        NOTICE
[root@server httpd-2.4.41]# cp httpd /usr/local/apache/bin/
cp:是否覆盖"/usr/local/apache/bin/httpd"? y
// 检查新版本
[root@server httpd-2.4.41]# apachectl -v
Server version: Apache/2.4.41 (Unix)
Server built:   Nov 11 2019 09:28:10
```:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值