cPanel: cPHulk Service Failure

On a cPanel system with cPHulk, you may run into an error like so:

(XID e22d2d) The “cphulkd” service failed because it cannot find the “/var/run/cphulkd_db.sock” socket.

The subprocess “/usr/local/cpanel/scripts/restartsrv_cphulkd” reported error number 255 when it ended.

The system could not provide log messages for “cphulkd” because it failed to read all of the potential log files with the following errors: Error while attempting to open “/var/log/secure”: “No such file or directory”, Error while attempting to open “/var/log/maillog”: “No such file or directory”, Error while attempting to open “/var/log/messages”: “No such file or directory”

This typically indicates that the rsyslogd service is not installed and/or not running, which is responsible for maintaining files such as /var/log/secure, /var/log/messages, etc.

# /scripts/restartsrv_rsyslogd
(XID bx88f7) The “rsyslog” service is disabled.

To resolve this, simply install the rsyslog RPM:

# yum install rsyslog

You then need to start the service, and configure it to start on boot:

# systemctl start rsyslog
# systemctl enable rsyslog

You’re now all done! The missing log files should now exist, and cPHulk should no longer return an error message about missing files.

cPanel MySQL/MariaBB error: adminbin Cpanel/cpmysql/DBCACHE: exit 11 [SOLVED]

Many cPanel users are experiencing the above error within the cPanel interface recently; The error appears within cPanel, giving the impression that MariaDB/ MySQL is not working. Infect the error is a false positive, MariaDB/MySQL is infect working perfectly fine.

 

 The MySQL server is currently offline.
 adminbin Cpanel/cpmysql/DBCACHE: exit 1

First Check Log in cPanel

/usr/local/cpanel/logs/error_log

You May Get Something Like That

cpanel::cpanel::cptt_exectag("/usr/local/cpanel/base/frontend/paper_lantern/sql/index.html.tt", 1) called at cpanel.pl line 4637
cpanel::cpanel::run_standard_mode() called at cpanel.pl line 929
cpanel::cpanel::script("cpanel::cpanel", "./frontend/paper_lantern/sql/index.html.tt") called at cpanel.pl line 325
[2021-10-26 05:47:41 +0000] info [] The cacheid for the user “thetechp” was reset because it was in the future: Tue Nov 9 08:12:02 2021
[2021-10-26 05:47:41 +0000] info [] The cacheid for the user “thetechp” was reset because it was in the future: Tue Nov 9 08:12:06 2021
[2021-10-26 05:47:41 +0000] info [] The cacheid for the user “agunmyid” was reset because it was in the future: Tue Nov 9 08:06:37 2021

To Fix This Issue

mysqldump MySQL > /root/mysql-backup.sql
Then Go to WHM Click Jetbackup & Restore Old Backup To That User which one is affected   & Get Fix 
/scripts/restartsrv_mysql
Have a Good Day 🙂 

Installing pdftk on Centos 7

PDFtk is a toolkit for manipulating Portable Document Format documents. It runs on Linux, Windows and MacOS. It comes in three versions: PDFtk Server, PDFtk Free and PDFtk Pro. It is able to concatenate, shuffle, split and rotate PDF files. It can also show and update metadata .

How to Install ?
i search in google but no luck also in pdftk official document don’t have instruction for centos 7 🙁  so here is solution for public

Step 1 : Login Your Server / VPN

Step 2: Open Terminal
Step 3 :  Now  Copy & Past this Code

    copy robert-gcj-epel-7.repo to /etc/yum.repos.d folder

wget https://copr.fedorainfracloud.org/coprs/robert/gcj/repo/epel-7/robert-gcj-epel-7.repo -P /etc/yum.repos.d

robert-pdftk-epel-7.repo to /etc/yum.repos.d folder

wget https://copr.fedorainfracloud.org/coprs/robert/pdftk/repo/epel-7/robert-pdftk-epel-7.repo -P /etc/yum.repos.d

yum install pdftk

Before run all First Check link active or not 

ping copr.fedorainfracloud.org

 

 

Have a Good Day !!!

How to Install the PHP Suhosin Extension

What is Suhosin?

Suhosin (pronounced ‘su-ho-shin’) is an advanced protection system for PHP 5 installations. It is designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core. Suhosin comes in two independent parts, that can be used separately or in combination. The first part is a small patch against the PHP core, that implements a few low-level protections against buffer overflows or format string vulnerabilities and the second part is a powerful PHP extension that implements numerous other protections.

Why Suhosin?

The most important question for new users of Suhosin is, why they should use Suhosin at all, if it is really necessary and what they gain by using the patch, the extension or a combination of both.

The answer to this question depends on what your usage of PHP is. If you are using PHP only for your own server and only for your own scripts and applications, then you can judge for yourself, if you trust your code enough. In that case you most probably don’t need the Suhosin extension. Because most of it’s features are meant to protect servers against vulnerable programming techniques. However PHP is a very complex programming language with a lot of pitfalls that are often overseen during the development of applications. Even PHP core programmers are writing insecure code from time to time, because they did not know about a PHP pitfall. Therefore it is always a good idea to have Suhosin as your safety net. The Suhosin-Patch on the other hand comes with Zend Engine Protection features that protect your server from possible buffer overflows and related vulnerabilities in the Zend Engine. History has shown that several of these bugs have always existed in previous PHP versions.

If you are not only running your own PHP scripts but are also hosting 3rd party PHP applications for yourself or even for possible customers, then you cannot trust the code quality of the PHP applications you use. Unfortunately, it is a fact that the pitfalls of the PHP language are not widely known among programmers. Many of these pitfalls are also not documented in the PHP-Security books that have been released during the last year. This is mainly caused by the fact, that the books were written in a hurry to be the first in market and because most of these books were not written by security professionals but by PHP programmers. The worst of these books is the one by Oreilly which contains examples that might fix the problem described but introduces more dangerous vulnerabilities into your application.

Another common error in these books is that they spread the urban legend that the most dangerous problem within PHP “remote code inclusion vulnerabilities” can be fixed by disabling allow_url_fopen in the configuration (or allow_url_include in PHP 5.2.x). This information is simply wrong, because these configuration directives do NOT protect against attacks through php://input or data:// URLs. Our Suhosin and the former Hardening-Patch are the only available protections that close all URL include attacks.

Summed up, it is your free choice to use Suhosin. If you want additional protection for your servers and your business, we can only recommend strongly that you use the extension and the patch. Always keep in mind that you are not only protecting yourself and your users, but also other people on the internet, that might get attacked by your server after it has been turned into a (Spam-/DDOS-)attack drone.

Installing Suhosin on PHP 7.0 or 7.1

To install on PHP 7.X, SSH into your server as root and install the packages required to build the Suhosin extension.

sudo apt-get -y install gcc make autoconf libc-dev pkg-config

Next, run the following commands on your server:

git clone https://github.com/sektioneins/suhosin7
cd suhosin7
/opt/sp/php7.X/bin/phpize
PATH=/opt/sp/php7.X/bin:$PATH ./configure
make
sudo make install
sudo bash -c "echo extension=suhosin.so > /etc/php7.X-sp/conf.d/suhosin.ini"
sudo service php7.X-fpm-sp restart

Installing Suhosin on PHP 5.4, 5.5, or 5.6

To install on PHP 7.X, SSH into your server as root and install the packages required to build the Suhosin extension.

sudo apt-get -y install gcc make autoconf libc-dev pkg-config

Next Download Suhosin
wget https://download.suhosin.org/suhosin-0.9.38.tar.gz
tar xzf suhosin-0.9.38.tar.gz
cd suhosin-0.9.38

Now, compile, install, and restart PHP. To install for multiple PHP versions, repeat the steps below for each PHP version.

/opt/sp/php5.X/bin/phpize
PATH=/opt/sp/php5.X/bin:$PATH ./configure
make
sudo make install
sudo bash -c "echo extension=suhosin.so > /etc/php5.X-sp/conf.d/suhosin.ini"
sudo service php5.X-fpm-sp restart

Verifying the Installation

You can verify Suhosin is installed correctly by running the command:

phpX.Y-sp -i | grep suhosin

You should see the following output:

/etc/phpX.Y-sp/conf.d/suhosin.ini,
suhosin
suhosin.apc_bug_workaround => Off => Off
suhosin.cookie.checkraddr => 0 => 0
suhosin.cookie.cryptdocroot => On => On
suhosin.cookie.cryptkey => [ protected ] => [ protected ]
suhosin.cookie.cryptlist => no value => no value
suhosin.cookie.cryptraddr => 0 => 0
suhosin.cookie.cryptua => On => On
suhosin.cookie.disallow_nul => 1 => 1
suhosin.cookie.disallow_ws => 1 => 1
suhosin.cookie.encrypt => Off => Off