centos7中升级apache版本的方法-创新互联

这篇文章给大家分享的是centos7中升级apache版本的方法,相信大部分人都还没学会这个技能,为了让大家学会,给大家总结了以下内容,话不多说,一起往下看吧。

10年积累的成都网站设计、做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先做网站设计后付款的网站建设流程,更有阿坝州免费网站建设让你可以放心的选择与我们合作。

第一步:找出默认软件库上的Apache版本

为了查找Centos上软件库里的Apache版本,在命令行下输入以下指令:

yum info httpd

如果你的centos保持着默认的配置的话,你很可能会按到类似的结果:

[root@crosp ~]# yum info httpd
Loaded plugins: fastestmirror
epel/x86_64/metalink                                     |  19 kB     00:00
epel                                                     | 4.3 kB     00:00
(1/3): epel/x86_64/group_gz                                | 170 kB   00:00
(2/3): epel/x86_64/primary_db                              | 4.6 MB   00:00
(3/3): epel/x86_64/updateinfo                              | 780 kB   00:00
Loading mirror speeds from cached hostfile
 * base: mirrors.ircam.fr
 * epel: mirrors.ircam.fr
 * extras: centos.mirror.fr.planethoster.net
 * updates: centos.mirror.fr.planethoster.net
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.4.6
Release     : 45.el7.centos.4
Size        : 2.7 M
Repo        : updates/7/x86_64
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

正如你从上面的输出结果中看到,默认软件库中只有2.4.6版本的apache。

注意:

Centos使用 向后修复安全实践 来将新的软件修复应用到更早期的版本。所以,默认库中的早期版本软件不意味着就更脆弱。不过对于我来说,并不算是个满足需求的更新。

你可以使用changelog来查看版本更新:

sudo yum install yum-changelog
yum changelog httpd

第二步:安装CodeIT库

CodeIT的人提供了一个很好的自定义库。这个库提供了最新版本的服务器软件(Apache & Nginx)。

在安装CodeIT库之前,你需要开启 EPEL 。EPEL提供了CodeIT库需要的依赖。

sudo yum install -y epel-release

最后,我们来安装CodeIT库

cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

接下来,我们再次确认Apache的包版本,你应该会看到类似下面的输出

[root@crosp ~]# yum info httpd
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.crazyfrogs.org
 * epel: mirror.23media.de
 * extras: mirrors.ircam.fr
 * updates: centos.mirror.fr.planethoster.net
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.4.25
Release     : 3.el7.codeit
Size        : 1.4 M
Repo        : CodeIT/x86_64
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

第三步:安装Apache

现在你应该有了安装最新版apache所需要的所有东西:

yum install httpd

一旦Apache安装好,我们就可以测试apache是否正常工作:

[root@crosp ~]# systemctl start httpd

输出应该是类似下图:

[root@crosp ~]# curl localhost

 


Test Page for the Apache HTTP Server on CentOS

                ...

最后,让systemctl将Apache设置为开机自启动:

[root@crosp ~]# systemctl enable httpd

以上就是centos7中升级apache版本的方法,详细使用情况还需要大家自己亲自动手使用过才能领会。如果想了解更多相关内容,欢迎关注创新互联成都网站设计公司行业资讯频道!

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享标题:centos7中升级apache版本的方法-创新互联
网站地址:http://bzwzjz.com/article/dgseie.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 四川成都网站建设 企业网站设计 四川成都网站制作 网站建设 专业网站设计 盐亭网站设计 自适应网站建设 成都商城网站建设 营销型网站建设 网站制作报价 成都网站建设 营销网站建设 重庆网站建设 成都网站建设 网站制作 网站设计制作 阿坝网站设计 成都网站建设推广 成都网站建设 成都企业网站制作 成都网站设计制作公司 商城网站建设