在CentOS系统中更新Apache2(通常称为httpd)的方法如下:
sudo yum update
sudo systemctl start httpd
sudo systemctl status httpd
sudo systemctl enable httpd
sudo yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
注意:上述命令适用于CentOS 7。如果您使用的是CentOS 8,请使用以下命令:
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo yum-config-manager --enable remi-httpd
sudo yum update httpd
sudo yum --obsoletes update httpd
sudo systemctl restart httpd
sudo systemctl status httpd
现在,您已成功更新了CentOS系统中的Apache2。