csf - CSF: Check if IP address is blocked on the firewall

CSF: Check if IP address is blocked on the firewall

Here are different methods to check if an IP address is blocked in Config Server Firewall (CSF). Check if an IP is blocked in CSF from the WHM WHM > Config Server Firewall > Search for IP 2. Check if an IP is blocked in CSF from the terminal:...

image 12 - Display the last modified file in directory in cPanel ☑️

Display the last modified file in directory in cPanel ☑️

From the terminal (SSH): grep -Ril "find /home/username/public_html/ -type f -mtime -2" From a .php file: <?php $last=shell_exec('grep -Ril "find /home/username/public_html/ -type f -mtime -2"'); echo "<pre>$last</pre>"; ?> The...

tmpwatch remove emails - Delete all emails older than 6 months with Cronjob in cPanel

Delete all emails older than 6 months with Cronjob in cPanel

Here is how to delete all emails older than 6 months from cPanel using a cronjob. First, we need to know the exact location where emails are stored. On cPanel, emails are stored in 3 folders: new – incoming emails are received in this...

csp error - Improve web applications security with the Content Security Policy

Improve web applications security with the Content Security Policy

Content Security Policy (CSP)  is a security layer that can help you detect and mitigate Cross Site Scripting (XSS) and data injection attacks. If your web application displays and stores custom HTML/CSS from user input, then you most...

image 8 - Set default Timezone via htaccess in cPanel

Set default Timezone via htaccess in cPanel

Here in how to change the default Time Zone permanently in cPanel using the .htaccess file Step 1. First, check you current time yone settings using a simple .php script like this: <?php echo "Today is " . date("Y/m/d") . "<br>"; echo "The...

open ports php - PHP Script to check for open ports

PHP Script to check for open ports

Here is a simple PHP script that you can use to test if a port is open on the server or not. <?php $host = $_SERVER['SERVER_ADDR']; $ports = array(21, 25, 80, 81, 110, 443, 3306); foreach ($ports as $port) { $connection = @fsockopen($host...

before edits - How to Whitelist a domain name in CSF

How to Whitelist a domain name in CSF

If you use dynamic DNS privately and need to whitelist a hostname or domain name in cPanel/WHM, you can use the DYNDNS feature of ConfigServer Security and Firewall plugin. csf.dyndns is a file that is specifically used for allowing hostnames in CSF...