In AlmaLinux 9, memcached only listen on loop back interface IP address (127.0.0.1,::1). If your configuation don’t restrict memcache to listen to 127.0.0.1, change your options line as follows.
OPTIONS="-l 127.0.0.1 -U 0"
This will restrict memcached to listen on IP address 127.0.0.1 and -U 0 disable UDP. This is done to protect memcachd installation from attacks.
If the disk partition that stores MySQL data directory runs out of disk space, you may need to consider moving the MySQL data directory to another partition. Before you do the MySQL data directory change, make sure you take a backup of all your databases using mysqldump.
In this case, we have free disk space in /home partition so we will move the MySQL data directory to this partition. Create a directory to store MySQL data, and copy the MySQL files to it.
On CloudLinux server, when you install alt-nodejs packages, binary files get installed at
/opt/alt/alt-nodejs16/root/bin/node
When SSH into a user and run the command “node”, it won’t work. When deploying Node.js application with Cpanel, you will be given a command, that is used to switch to the environment with specific version of node.js the application is using.
If you want to make node.js available to all users by default, even with out a node.js application configured, you do the following
This will make “alt-nodejs16” as the default Node.js, if you need to use another version of Node.js default, change the paths as required. If you don’t have it installed, install it with
Ubuntu 18.04 is a long-term support release that was launched in April 2018. It will reach its end of life on April 30, 2023, which means that it will no longer receive security updates and bug fixes from Canonical. If you are still using Ubuntu 18.04, you might want to consider upgrading to a newer version to keep your system secure and up-to-date.
To upgrade Ubuntu 18.04, first install all software updates with following command
apt update & apt upgrade -y
apt dist-upgrade
After software upgrade, reboot the server so it boot with newer kernel.
reboot
To upgrade Ubuntu to next Long term supported release, run
do-release-upgrade
This will upgrade Ubuntu to version 20.04 LTS. This version is supported until Apr 2025. If you wanted to upgrade to Ubuntu 22.04, you can run above commands again, that will upgrade your server to Ubuntu 22.04.
When using Cloudflare, website visitors visit the Cloudflare CDN server configured as a reverse proxy server. Cloudflare CDN server fetches pages from your web server and caches them for a while, serving them to subsequent visitors. Your web application may report Cloudflare CDN server IP ad visitor IP as all requests to your website are coming from Cloudflare CDN. This can be a problem when you have an e-commerce website where you need to check visitor IPs to detect fraud signups/orders.
To restore the original visitor IP for visitors on cPanel Server running the Apache web server, you can use mod_remoteip. You can install mod_remoteip in WHM > EasyApache 4 > Apache Modules
You can also install mod_remoteip using command line
dnf install ea-apache24-mod_remoteip
Login to SSH as user root or WHM > Terminal, then edit the file
vi /etc/apache2/conf.modules.d/370_mod_remoteip.conf
CentOS Linux was discontinued at the end of 2021 in favor of CentOS Stream. CentoS 7 will continue to be supported through the remainder of the RHEL 7 life cycle, which will end on June 30, 2024. If you are using CentOS 7 server with cPanel, it is better to upgrade to AlmaLinux 8, which is a clone of RHEL 8 supported by cPanel.
cPanel provides an open-source script to upgrade your CentOS 7 installation to AlmaLinux.
Benchmarking a server helps to determine its performance score. By benchmarking a server, you can also compare its performance score with other servers. Benchmarking can also help identify any issues with the server that may be causing poor performance, such as faulty hardware or software.
To benchmark a Cpanel Server, I will use Geekbench 5.
What the script will do is stop MySQL, Apache and Cpanel, then run the greekbench. After benchmarking is completed Apache, MySQL and Cpanel will be started.
To start the benchmark, run following command.
benchmark.sh
IMPORTANT: when you run benchmark, web server stop serving websites, so only do this when you have less visitors like night time or during server setup.
After the benchmark is finished, scroll up, you will see benchmark result like the following
You can find server benchmarks results i have taken at
You can also use the search box in WHM, and search for “MariaDB upgrade”.
On this page, select the MySQL or MariaDB version you need. Then click on the “Continue” button.
It will show some warnings related to MySQL/MariaDB changes. You need to check all check boxes, then click on the “Continue” button.
On this page, you get 2 options “Unattended Upgrade” and “Interactive Upgrade”. You can select any of it and click the “Continue” button to do the upgrade.
mcrypt is a PHP module, that was DEPRECATED in PHP 7.1.0, and REMOVED in PHP 7.2.0. mcrypt is removed from PHP, now it is available as a PECL module at
Symlink attack exploits the way Linux operating systems handle symbolic links (symlinks). A symlink is a pointer to another file or directory that is used by the operating system to access the linked file or directory. In a symlink attack, an attacker creates a symbolic link that points to a file or directory that the attacker does not have permission to access. When the web server attempts to access the linked file or directory, the attacker can gain access to it.
Symlink attacks can be used to gain access to sensitive data. On a Cpanel Server, hackers usually create a symlink to common configuration files used by popular CMS on other hosting accounts on the same server. With this hackers can get database credentials of other websites hosted on the server. Many CMS store user credentials in the MySQL database, and they will be able to change passwords and gain access to websites.
Solution 1: CloudLinux CageFS (Paid)
The best way to prevent a symlink attack on the Cpanel server is to use CloudLinux CageFS, this isolates each site into its own isolated areas, so one website’s files won’t be able to another site.
Solution 2: mod_ruid2
If you are not using CloudLinux, you can use the following method to protect against the symlink attack. mod_ruid2 is an Apache module, that can be enabled in EasyApache 4.
In WHM > Software > EasyApache 4, enable mod_ruid2.
Under WHM > Server Configuration > Tweak Settings, enable jail Apache
Go to WHM > Security Center > Security Advisor, and install KernelCare’s Free Symlink Protection.
If you enable SSH access for cPanel accounts, make sure it is “jailed Shell” under WHM > Account Functions > Manage Shell Access