Help installing mod_cloudflare

mod_cloudflare

#1

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:


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?


#2

Have you read this article?

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.


#3

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


#4

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?)


#5

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.


#6

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.


#7

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


#8

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!


#9

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


#10

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…


#11

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


#12

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