在安装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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Test Page for the Apache HTTP Server on CentOS</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ...
最后,让systemctl将Apache设置为开机自启动:
[root@crosp ~]# systemctl enable httpd
完成。
推荐教程:apache从入门到精通
以上就是centos7下升级apache至最新版本的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
更多相关阅读请进入《CentOS7》频道 >>