Debian 上 Apache 的最新版本与更新指南
当前稳定版对应关系
在 Debian 12 上更新 Apache
sudo apt update && sudo apt full-upgrade -ysudo systemctl restart apache2apache2 -vsudo apt install --only-upgrade apache2 -ysudo systemctl restart apache2apache2 -vsudo apt install --only-upgrade php libapache2-mod-php php-mysql -ysudo systemctl restart php*-fpm(将 * 替换为实际版本,如 8.2)从 Debian 12 升级到 Debian 13 以获取 Apache 2.4.64
sudo apt update && sudo apt full-upgrade -y && sudo rebootsudo apt full-upgrade -ysudo rebootapache2 -v(应为 2.4.64)升级后的检查与回滚建议
sudo systemctl status apache2(应为 active (running))ss -tlnp | grep ':80\|:443'apache2ctl -M | grep phpsudo apt install apache2=2.4.62-1~deb12u*(版本号以仓库实际为准)并重启服务;变更了配置则先备份 /etc/apache2 目录后再恢复。