探索,發現,愛好、學習,記錄,分享。
學海無涯,天涯若比鄰,三人行,必有我師。

Installing mod_cloudflare on cPanel

Installing mod_cloudflare on cPanel

Here you’ll find an installer script that adds mod_cloudflare to your EasyApache build system included with cPanel servers. The CloudFlare module automatically translates visitor IP addresses to reflect the visitor’s original IP address rather than the IP address of the CloudFlare proxy servers.

Short Version For The Impatient
You can install mod_cloudflare on your cPanel server by running the following command:

perl <(GET https://raw.github.com/tylerl/util/master/easyapache/cloudflare.pl) install # or if that doesn't work... wget https://raw.github.com/tylerl/util/master/easyapache/cloudflare.pl
perl cloudflare.pl install

Then run EasyApache installer, and check the box marked “Mod CloudFlare”. Hit Save and Build and you’re done.

Why do I need this?

The EasyApache build utility included with cPanel can greatly simplify managing your server installation, but also makes it tricky to install modules that aren’t bundled with the utility. You can build and install them manually using the the standard apxs method, but if you do so you may find yourself in a mess next time you upgrade your PHP/Apache installation. Since EasyApache starts out with a fresh, clean source tree for every build, you’ll find that your module is no longer included and your websites may end up broken.

So if you’re installing a custom module for Apache, your best bet is to do so though the EasyApache build system, which ensures that your changes will persist through future upgrades.

How does it work

When you run the installer script, it downloads the latest version of the mod_cloudflare.c source code from the official distribution point and packages it up with a simple description file that tells EasyApache what to do with it. Then you have two options: you can either save the resulting package to upload to a server elsewhere, or, if you’re running this on the server itself, you can simply install it directly through the script.

To run the install script on your server, download this script here: https://raw.github.com/tylerl/util/master/easyapache/cloudflare.pl

Then run it using the following command:

perl cloudflare.pl install

Once you’ve installed the EasyApache component, re-run the EasyApache build script, either through the WHM web interface or by running /scripts/easyapache to complete the installation. Select “Mod CloudFlare” from the build menu to enable the Apache module, or deselect it to disable the module, and then run your build. It’s pretty simple.

Alternately, you can build a package using this command:

perl cloudflare.pl build

You can check out the official documentation from cpanel to see what to do with the package that gets built. If all you’re looking for is the pre-built package, then grab the file here: https://raw.github.com/tylerl/util/master/easyapache/bin/custom_opt_mod-mod_cloudflare.tar.gz

版權聲明:本文采用知識共享 署名4.0國際許可協議 [BY-NC-SA] 進行授權
轉載事宜:如需轉載需徵得應允,轉載必須注明來源於本站的信息。
文章名称:《Installing mod_cloudflare on cPanel》
文章链接:https://www.thefreesky.com/blog/25459.html
本站資源僅供個人學習交流,請於下載後24小時內刪除,不允許用於商業用途,否則法律問題自行承擔。

評論 抢沙发