如何升级 Apache CentOS、Redhat Linux 中的版本

[ad_1]

更新很重要 Apache 定期获取新功能和安全更新。 升级非常容易 Apache 网络服务器到 CentOS 中的最新版本。 以下是升级方法 Apache CentOS、Redhat linux 版本。 您也可以使用这些步骤进行升级 Apache 2.2 到 2.4 甚至更新 Apache 到最新版本。

如何升级 Apache CentOS、Redhat Linux 中的版本

以下是升级步骤 Apache CentOS 6、7、Redhat等Linux系统版本。

1.检查 Apache 版本号

首先,打开终端并运行以下命令进行检查 Apache 版本号

# yum info httpd
or
# httpd -v

Server version: Apache/2.4.16 (Unix)

奖励阅读:如何在中启用 KeepAlive Apache

2. 备份 Apache 配置文件

升级之前 Apache CentOS 中的版本,请备份您的 Apache 配置文件。 它位于以下位置之一,具体取决于您的安装

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf
  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf
$sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd-backup.conf

3.安装EPEL

接下来你需要在 CentOS 上安装 EPEL 仓库

# yum install -y epel-release

奖励阅读:如何更改端口号 Apache

4.启用EPEL存储库

运行以下命令为 CentOS 7 启用 EPEL 存储库。您可以在以下位置获取所有 CentOS 7 存储库 https://mirror.centos.org/centos/7/

# cd /etc/yum.repos.d && wget https://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

5.升级 Apache CentOS 中的版本

更新 Apache 在 CentOS 中,我们必须完全安装最新版本的 httpd (Apache 服务器)

# yum install httpd

奖励阅读:如何升级 Apache Ubuntu 中的版本

6.重启 Apache 服务器

打开您的配置文件以检查您的配置文件是否已更改。 如果它已被覆盖,则从您在第 2 步中创建的备份中恢复它。最后,开始 Apache 服务器

# service httpd start
or
# systemctl start httpd

就是这样! 您已升级 Apache CentOS、Redhat Linux 中的 web 服务器版本。

CodePre 可以在几分钟内轻松可视化数据,并在实时仪表板中进行监控。 今天就试试吧!

[ad_2]

Related Posts