/var/cpanel/secdatadir/ip.pag file massive

Source: https://forums.cpanel.net/threads/var-cpanel-secdatadir-ip-pag-file-massive.565591/

This can add to server load and slow loading times as it gets scanned every page load.

You also might want to disable mod_unique_id for modsec too. It will prevent that file from growing and being scanned.

Clear the file
yum install ea-modsec-sdbm-util
Should also help keep that file in check if he chooses not to disable it

How To Install cPanel on a Virtual Server Running Centos

First we need to make sure that Perl is installed on the server


# sudo yum install perl

After installing perl we need to take one more preliminary step. cPanel is very picky about making sure that server that it is installed on has a Fully Qualified Domain Name. To that effect, we need to provide it with a valid hostname. Skipping this step will inevitably get you the following, very common, error.


2012-11-01 16:00:54  461 (ERROR): Your hostname () is not set properly. Please
2012-11-01 16:00:54  462 (ERROR): change your hostname to a fully qualified domain name,
2012-11-01 16:00:54  463 (ERROR): and re-run this installer.

Luckily this error has a very easy solution. If you have a FQDN, you can type it in with the command:


# hostname your FQDN

Otherwise, if you want to proceed with the cPanel installation but do still lack the hostname, you can input a temporary one. Once cPanel is installed, you will be able to change the hostname to the correct one on one of the first setup pages.


# hostname  host.example.com

Install cPanel

Although the cPanel installation only has several steps, the installation does take a long time. Although using program “screen” is not necessary in order to install cPanel, it can be a very helpful addition to the installation process. It can be especially useful if you know that you may have issues with intermittent internet or that you will need to pause the lengthy install process.

To start off, go ahead and install screen and wget:


# sudo yum install screen wget

Once screen is installed, start a new session running:


# screen

After opening screen, you can proceed to install cPanel with WHM or a DNS only version of cPanel.

Use this this command to install cPanel with WHM:


# wget -N http://httpupdate.cPanel.net/latest

Use this command to install the DNS only version of cPanel:


# wget -N http://httpupdate.cPanel.net/latest-dnsonly

With the requested package downloaded, we can go ahead and start the script running:


# sh latest

Then close out of screen. The script, which may take one to two hours to complete will continue running while in the background—even if you close out the of server.

In order to detach screen type:


Cntrl-a-d

To reattach to your screen you can use the command:


# screen -r

Once cPanel finally installs, you can access the login by going to your ip address:2087 (eg. 12.34.45.678:2087l) or domain (example.com:2087)

Your login will be:


username: your_server_user
password: your_password

From there, you can create your cpanel user and finally login in at ipaddress/cpanel or domain/cpanel

cPanel Error for Install for OWASP ModSecurity Core Rule Set V3.0

Recently encountered an error. going to Home >> Security Center >> ModSecurity >> Vendors and clicking Install. However I’m getting the following error messages:

Error:The system experienced the following error when it attempted to install the ?OWASP ModSecurity Core Rule Set V3.0? vendor: API failure: The system could not validate the new Apache configuration because httpd exited with a nonzero value. 

Fix:

Backup the /var/cpanel/modsec_cpanel_conf_datastore file.

Manually edit /var/cpanel/modsec_cpanel_conf_datastore file with your favorite editor. Removed all active configs, active vendors, disabled rules, and updates. Just keep disabled rule. Save the file.

Login to WHM >> Home >> Security Center >> Modsecurity Vendors >> Manage Vendors >> OWASP ModSecurity Core Rule Set >> click +install

Modsecurity rules will should be installed without any issue.

Other links:
https://forums.cpanel.net/threads/mod_security-and-easyapache-4.501871/

How to Edit Your php.ini File on cPanel

On systems that run EasyApache 3, the /usr/local/lib/ directory contains your server’s php.ini file.
On systems that run EasyApache 4, multiple php.ini and local.ini files manage your system’s PHP. Each version of PHP on your systems uses its own php.ini and local.ini file. You must make changes to each file separately.

On systems that run EasyApache 3, we strongly recommend that you only edit this file with WHM’s PHP Configuration Editor interface (Home >> Service Configuration >> PHP Configuration Editor).

On systems that run EasyApache 4, we strongly recommend that you only edit these files with WHM’s MultiPHP INI Editor interface (Home >> Software >> MultiPHP INI Editor). This ensures that an operable version of PHP exists on the system.

Resource: https://documentation.cpanel.net/display/CKB/How+to+Edit+Your+php.ini+File

Warning: cPanel is unable to verify that this server is an authoritative nameserver

When trying to add DKIM and SPF records to my domain and I’m getting the error “Warning: cPanel is unable to verify that this server is an authoritative nameserver for domain.com”

Warning: cPanel is unable to verify that this server is an authoritative nameserver

That message typically indicates the use of external name servers for the domain name associated with the account. So since the domain domain.com is using outside server nameservers you would actually just need to copy the DKIM and SPF records and add them in the DNS zone where DNS is hosted.

How to enable Xcache in cPanel

How to enable Xcache in cPanel to speed up website?
Xcache can be enabled in cPanel by using Easy Apache.

Log into your cPanel server. After you login, search for “EasyApache” in left column and click on the link. Select “Previously Saved Config” and click on “start customizing”. For both Apache and PHP, click on “next step” button. Look for “xcache for php” and check the box. Click on “save and build”. Allow the build process to finish.

To enable xcache, you will need to make changes to php.ini before it can be used by your scripts.

# nano  /usr/local/lib/php.ini

Here is recommended settings for xcache in cPanel —

xcache.admin.pass=””
xcache.admin.user=”mOo”
xcache.cacher=”On”
xcache.coredump_directory=””
xcache.count=”1″
xcache.coveragedump_directory=”/tmp/pcov/”
xcache.coverager=”Off”
xcache.gc_interval=”300″
xcache.mmap_path=”/dev/zero”
xcache.optimizer=”On”
xcache.readonly_protection=”Off”
xcache.size=”50M”
xcache.slots=”8K”
xcache.test=”Off”
xcache.ttl=”3600″
xcache.var_count=”2″
xcache.var_gc_interval=”300″
xcache.var_maxttl=”7200″
xcache.var_size=”16M”
xcache.var_slots=”8K”
xcache.var_ttl=”3600″

Make necessary changes and save. Aftererwards you will need to restart Apache in WHM for changes to take affect

# service http restart

Cpanel on Cloudflare looks weird

The issue is that cpanel from the https://domain.com:2083 looks like its missing css or files…

Symptom:
You try to access your cPanel behind CloudFlare and are finding that on the first page load that no images (or stylesheets or javascript) load – and, when trying to navigate to any link, you are immediately logged out. The experience is as if cPanel were broken in some way.

Cause:
cPanel has an option called “Cookie IP Validation”. This setting checks that the IP address that the visitor originally came from matches their IP address on subsequent requests. With CloudFlare, the IP address for requests to your server can variably come from any IP address in the list at https://www.cloudflare.com/ips

Resolution:
To resolve this issue, in your WHM, navigate to “Tweak Settings” -> “Security” -> “Cookie IP Validation”. On this screen, set the value for “Cookie IP Validation” to “disabled”. After this, loading your cPanel WHM interface through CloudFlare should work as expected.

Other resources:

https://support.cloudflare.com/hc/en-us/articles/200063289-My-cPanel-won-t-load-or-keeps-logging-me-out-after-enabling-CloudFlare

https://forums.cpanel.net/threads/cpanel-looks-stupid-when-i-log-in.266321/

https://support.cloudflare.com/hc/en-us/articles/200169276-How-do-I-use-cPanel-with-CloudFlare-

Php 4 on cpanel

Here are a few articles that mention it:

https://documentation.cpanel.net/display/EA/Custom+Modules
https://forums.cpanel.net/threads/how-to-easy-php4-php5-side-by-side-after-removal-of-php4-from-easyapache.304942/
http://www.liquidweb.com/kb/the-end-of-php-4/

How to switch to a different PHP version?

You can set the handler for the site using a .htaccess file in the domains webroot with the following contents:
Code:
AddHandler application/x-httpd-php4 .php .php4 .php3