Update WHM/cPanel Hostname in Terminal

The Linux hostname command is not enough, as it won’t change HELLO for Exim, or reset the SSL certificates. The good hostname script is: /usr/local/cpanel/bin/set_hostname The hostname need to be FQDN, in the format, for example: /usr/local/cpanel/bin/set_hostname host.exampledomain.com

Bulk set email quota using cPanel API

List email accounts with uapi and grep uapi –user=cpanelusername Email list_pops | grep email Use find and replace in order to generate the bulk command replace “@domain.com” with “quota=2048 domain=domain.com” replace ” email:” with “uapi –user=cpanelusername Email edit_pop_quota email=” The final command will look like: uapi –user=cpanelusername Email edit_pop_quota email=user quota=0 domain=example.com

Check EXIM version in WHM/cPanel

There are multiple methods to check the EXIM SMTP server version in cPanel. If the current version doesn’t match the version reported by the SMTP connection, consider restarting the EXIM service. Method 1: via API command whmapi1 installed_versions packages=1|grep exim Method 2: in WHM Go in WHM > Server Status > Service status

Backup Website With WGET (Static HTML)

Here is how to use wget to backup a website static content: wget –recursive –no-clobber –page-requisites –html-extension –convert-links –restrict-file-names=windows –domains example.org –no-parent www.example.org/subfolder/ http://example.org/ Here is the explanation of the options: –recursive: download the entire Web site. –domains website.org: don’t follow links outside website.org. –no-parent: don’t follow links outside the directory tutorials/html/. –page-requisites: get all … Read more

Categories Web

Solar Winds Spam Experts Rejection Classification

Messages that are rejected without being quarantined Some messages are rejected immediately without being quarantined. This happens at SMTP level and the rejection is permanent. For example this will happen for Incoming messages in the following scenarios: Have an invalid recipient or domain Do not use TLS (if enforced on the incoming domain) Do not … Read more

Manual Certbot DNS challenge

Useful for servers behind residential internet, where port 80 is blocked, after the deprecation of TLS-SNI-01 challenge. certbot -d mydomain.com –manual –preferred-challenges dns certonly After you run this command, you need to add the domain control validation (DCV) DNS entry.

Using LFTP – ignore SSL certificates

Issue – connecting to a FTPS server with a shared SSL certificate, like cPanel. Here is the solution Create a file named rc in ~/.lftp and add the line: set ssl:verify-certificate no connect to FTPS server using lftp command lftp -u user hostname.example.com How to install lftp: sudo apt install lftp or yum install lftp … Read more

PureFTP cPanel restart error: Couldn’t load the DH parameters file

This is related to cPanel  [CPANEL-23772] Pure-FTPd Couldn’t load the DH parameters file issue. Here is how to fix: openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 /scripts/restartsrv_pureftpd Here are the default Cyphers for cPanel FTP server: HIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3

The cPanel checkallsslcerts Script

/usr/local/cpanel/bin/checkallsslcerts The system runs the /usr/local/cpanel/bin/checkallsslcerts script during the nightly cPanel & WHM update (upcp) process. This script performs the following actions: Installs a cPanel-signed hostname certificate on the server, if one does not exist. Updates the SSL certificate for all cPanel & WHM services. Issues a Comodo signed SSL certificate on any server with … Read more

.htaccess exceptions for AutoSSL and Let’s Encrypt

for Let’s Encrypt RewriteEngine On RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] for cPanel AutoSSL RewriteEngine On RewriteCond %{REQUEST_URI} !\.well-known/pki-validation RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

Fix cPanel account permissions script

How to use PeachFlame script to fix cPanel account permissions: To get the fixperms script, simply wget the file from GitHub and make sure it’s executable: wget https://raw.githubusercontent.com/PeachFlame/cPanel-fixperms/master/fixperms.sh chmod +x fixperms.sh Fixperms – for all of the users If you would like fix the permissions for every user on your cPanel server, simply use the … Read more

Retry time not reached for any host after a long failure period

Exim issue most likely due to a corrupt Exim db. Symptom: Bounced emails with the message: “retry time not reached for any host after a long failure period” Solution: For cPanel: cd /var/spool/exim/db rm -f retry retry.lockfile rm -f wait-remote_smtp wait-remote_smtp.lockfile service exim restart For Linux: /usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null /usr/sbin/exim_tidydb -t … Read more