我想安装 htt2_module。按照 link 中列出的步骤全新安装 Ubuntu 14.04 后,我试图启用刚刚运行的http2_module
sudo a2enmod http2
但我得到:模块 http2 不存在!
安装的apache版本是:Apache/2.4.7
,然后作为一种解决方法,我尝试使用此 link添加以下存储库
sudo add-apt-repository ppa:ondrej/apache2
在使用 sudo apt-get update 刷新并再次运行命令来安装/启用 http2 后,我得到了同样的错误。模块 http2 不存在。
最佳答案
实际上,http2 模块在 apache 2.4.17 或更高版本上受支持(为了更好的稳定性,您应该至少使用 2.4.23)但 Ubuntu 16.04 或 14.04 的默认 apache 低于最低要求,因此为了升级您的 apache
请按照以下步骤操作:
$ sudo add-apt-repository -y ppa:ondrej/apache2
$ sudo apt-key update
$ sudo apt-get update
然后运行
$ sudo apt-get --only-upgrade install apache2 -y
在这里,您将被提示两次,例如:
*** apache2.conf (Y/I/N/O/D/Z) [default=N] ?
press Y both the times and proceed.
检查您的 mods-available 文件夹,您将看到 http2.load 文件
$ sudo a2enmod http2
你会得到以下输出
Enabling module http2. To activate the new configuration, you need to run: service apache2 restart
关于apache2 - 为什么 Ubuntu 16.04 上不存在 apache2 模块 http2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37103927/