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.
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.
Cpanel :: Exception :: Services :: StartError
(XID uykndd) The “httpd” service failed to start.
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:
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!
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!
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):