Help installing mod_cloudflare

Hello, I am trying to install mod_Cloudflare, but I can not install it, I communicate with cpanel and it said this.

Hello,

Apologies, it seems that those instructions are for the installation of EasyApache 3.

Please see the following:
Https://www.cloudflare.com/technical-resources/#cpanel

You may want to contact Cloudflare directly for additional support.
Mod_Cloudflare is not developed or supported by cPanel, so the assistance and experience I can offer is limited.

I did the same steps as before to put Apache back online.

Could you help me install mod_Cloudflare please?

1 Like

Have you read this article?
https://www.cloudflare.com/technical-resources/#mod_Cloudflare

It mentions a Cloudflare cPanel plugin that includes mod_Cloudflare. May I ask what hosting provider you are going through? I think you will need SSH access to your server.

I have SSH access, try the guide you sent me but it gives me error.

Can you provide a little more info regarding the process youā€™re performing and where the error is occurring? (and also what the error is?)

Perform the process Option 2: Installation on cPanel Servers

cPanel uses a system known as EasyApache to rebuild Apache httpd during updates or certain configuration changes. The below instructions will integrate mod_Cloudflare support into EasyApache so that it can be easily included from the cPanel web interface and remain activated in Apache httpd after rebuilds.

Note: credit for this perl script goes to Tyler Larson at tltech.com.

wget https://raw.githubusercontent.com/Cloudflare/mod_Cloudflare/master/EasyApache/installer.sh

bash installer.sh

Alternatively, you can run this instead:

bash <(curl -s https://raw.githubusercontent.com/Cloudflare/mod_Cloudflare/master/EasyApache/installer.sh)

Next, you can use EasyApache, choose to customize your profile, then, on the ā€˜Short Options Listā€™ screen, checkbox the ā€˜Mod Cloudflareā€™ feature, and click ā€˜Save and Buildā€™.

But when compiling with easyapache, it gives me error and does not finish compiling. My pages are left offline and I have to revert changes.

Thank you for the information.

Whatā€™s the error? Unfortunately I donā€™t have a dev environment with cPanel, so I canā€™t troubleshoot the issue along-side with you.

CPanel told me this:
Hello,

Apache was down and failing to start due to a syntax error in the configuration.

====================
[14:59:11 server root @ 8600163 ~] cPs # / scripts / restartsrv_httpd --status
(XID hetjhh) The ā€œhttpdā€ service is down.

====================
[15:00:02 server root @ 8600163 ~] cPs # / scripts / restartsrv_httpd
Waiting for ā€œhttpdā€ to start ā€¦ info [restartsrv_httpd] The service ā€˜httpdā€™ failed to restart at least three times. The system will now rebuild the httpd.conf file.
ā€¦ failed.

Cpanel :: Exception :: Services :: StartError
Service Error
(XID uykndd) The ā€œhttpdā€ service failed to start.

Startup Log
Httpd: Syntax error on line 225 of /etc/apache2/conf/httpd.conf: Syntax error on line 1 of /etc/apache2/conf.d/Cloudflare.conf: Can not load / usr / lib64 / apache2 / modules / mod_Cloudflare .so into server: /usr/lib64/apache2/modules/mod_Cloudflare.so: undefined symbol: ap_log_rerror

To solve the issue, I moved the problematic Cloudflare.conf file aside:

====================
[15:01:28 server root @ 8600163 ~] cPs # mkdir / root / cptechs
[15:01:41 server root @ 8600163 ~] cPs # mv /etc/apache2/conf.d/Cloudflare.conf / root / cptechs /

Then rebuilt httpd.conf and restarted Apache:

====================
[15:01:46 server root @ 8600163 ~] cPs # / scripts / rebuildhttpdconf && / scripts / restartsrv_httpd
Built /etc/apache2/conf/httpd.conf OK

Thank you for the detailed reply! I unfortunately havenā€™t used Apache in quite some time, and donā€™t have any experience with EasyApache or installing things into cPanel - so I have a few more questions for you so that others with more experience in those realms may have additional information in order to assist you. Donā€™t worry though, Iā€™m not giving up! :grin:

  • Who is your hosting provider? (possibly not relevant but who knows)
  • What distribution are you running? (Ubuntu, CentOS, etc.)

Iā€™ve googled some of those error messages and there seem to be solutions out there. Knowing the answers to the above will help further troubleshoot this issue. Thanks!

Thanks, I have a dedicated server and I have virtualized a vm with Centos, there install CPanel

Ok cool, so it sounds like you have total control of your VM - some folks use shared hosting so their options are limited.

Are you running CentOS 7?

I found this which may be helpful, however you would need to switch to the option 3 I think and try manual installation instead of through cPanel, which Iā€™m not sure if youā€™re willing to try.

Iā€™m a bit out of my depth here at this point so Iā€™m hoping someone else will chime in, as Iā€™m sure thereā€™s something obvious that Iā€™m missingā€¦

I have tried to use this script:

https://raw.githubusercontent.com/Cloudflare/mod_Cloudflare/master/EasyApache/installer.sh

While intended for both CentOS6 and CentOS7, this script works correctly for me on 7, but not on 6:

Starting httpd: httpd: Syntax error on line 230 of /etc/apache2/conf/httpd.conf: Syntax error on line 1 of /etc/apache2/conf.d/Cloudflare.conf: Cannot load /usr/lib64/apache2/modules/mod_Cloudflare.so into server: /usr/lib64/apache2/modules/mod_Cloudflare.so: undefined symbol: ap_log_rerror

Subsequently I tried downloading and compiling (after installing the apache devel package for the OS, and that worked on CentOS6 (and one RHEL6 I tried, although that required subscribing to the ā€œoptionalā€ channel for the development packages):

wget https://www.cloudflare.com/static/misc/mod_Cloudflare/mod_Cloudflare.c
apxs -a -i -c mod_Cloudflare.c