我正在尝试在 cPanel 服务器上使用 easyapache 4 安装 mod_cloudflare for Apache。我运行的是 CentOS 7.2。
我已经按照选项 2 here 下的说明安装了 EasyApache4 的 mod_cloudflare 。运行安装程序后,它显示“完成。请重新启动 EasyApache 4”。然后我进入 WHM -> EasyApache 4 并尝试查找服务器模块,但找不到。我单击“运行系统更新”按钮并再次尝试,但无济于事。有没有需要通过命令行重启的easyapache服务?
我不是托管提供商,因此我还没有尝试过 CPanel 的 Cloudflare 插件。
* 编辑 2019 年 4 月 9 日 * 将接受的答案更改为 EasyCo 的答案,因为原始解决方案不再有效。
最佳答案
我想我会使用 Centos 6.9 和 WHM/cPanel 来混合我的解决方案。
bash <(curl -s https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/installer.sh)
wget https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/mod_cloudflare.c
yum install ea-apache24-devel
apxs -a -i -c mod_cloudflare.c
rm /etc/apache2/conf.modules.d/mod_cloudflare.conf
service httpd restart
发生了什么事?
- 我们正在使用 cPanel
installer.sh
按照 Cloudflare 的建议,但编译后的mod_cloudflare.so
如果您随后运行service httpd restart
则会引发错误。让我们解决这个问题。 - 下载源代码
mod_cloudflare
文件。 - 确保我们拥有正确的 EasyApache4 开发人员工具来构建
mod_cloudflare
模块。 - 构建并安装扩展模块。
- 删除新的
mod_cloudfare.conf
文件,因为我们更喜欢在步骤 1 中生成并安装的文件。 - 重新启动 Apache。
注意:mod_cloudflare
模块不会在 EasyApache4 中显示。您可以通过运行 httpd -M | grep cloudflare
看到它已启用。你应该看到类似 cloudflare_module (shared)
的内容.
引用文献:
关于apache - 如何为 easyapache 4 安装 mod_cloudflare,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40091309/