Archives

WHM/cPanel ConfigServer plugins

ConfigServer WHM/cPanel plugins are developed by a UK company – Way to the Web Limited. They have free and paid plugins.

1. ConfigServer Security & Firewall (csf) – free

csf1

csf is a very powerful firewall. It has many options: you can check the server security, you can search log files, edit/add/remove IPs etc.

2. ConfigServer ModSecurity Control (cmc) – free

cmc1

cmc is a very useful plugin if you are using mod_security. It allows you to remove rules for specific accounts, to turn on/off mod_security for the server etc.

3. ConfigServer Explorer (cse) – free

cse1

Many times web hosting admins prefer to use the shell for file operations, but for beginners, this is a great tool. You can create/rename/delete/move both files and directories. You can also search the server for specific files.

4. ConfigServer Mail Queues (cmq) – free

cmq1

cmq is a tool to view the mail server queue. 

5. ConfigServer Mail Manage (cmm) – free

cmm1

With cmm you can manage user email accounts, create new accounts, set the hourly limit, manage forwarders etc.

6. ConfigServer eXploit Scanner (cXs) – $60/server

cXs is a tool that will scan your server files. It will scan files uploaded by users. A similar free product is maldet

7. Outgoing Spam Monitor (osm) – $40/server

A tool that will monitor email activities on the server. See more details on the product’s page.

Share this post:

Database only backups in WHM

 Some clients asked us if you can set up only database backups in WHM. For some, this will sound strange, but there are users who want such a feature. 

You can access WHM backup settings via WHM->Backup->Backup Configuration. Unfortunately, there is no option at this moment to backup only users’ databases.

whm database backup

As of September 25, 2018, this cPanel request is in “Open Discussion” status. You can comment and vote at cPanel Feature Requests Site

 

What solutions do you have? You can use bash commands. One command to backup all the databases on the server to a .gz archive is:

root@www [/backup]# mysqldump --all-databases | gzip > /backup/$(date +%Y-%h-%d)-alldatabases.sql.gz

This will create a backup with all MySQL/MariaDB databases on the server. The filename will include the current date. (e.g. 2018-Sep-25-alldatabases.sql.gz) You can modify the command per your needs. You can also create a cron job to run it at specific times.

Another possibility is to backup each database on the server individually. For this create a new file like backupdbs.sh  The content of the file is:

#!/bin/bash

mysql=/usr/bin/mysql
mysqldump=/usr/bin/mysqldump
date=$(date +%Y-%h-%d)

backupdir="/backup"
mkdir -p $backupdir/$date

databases=`$mysql -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema)"`
for db in $databases; do
echo $db
$mysqldump --opt --databases $db | gzip > "$backupdir/$date/$db.sql.gz"
done

To run the script:

root@www [/backup]# perl backupdbs.sh

As in the previous case, you can also adjust the script per your needs and create a cron job.

Share this post:

Where to find forwarders/autoresponders on a cPanel server

Many times while troubleshooting clients’ mail issues you will need to find out the forwarders/autoresponders they have. 

On a cPanel server, this information is kept in separate files for each domain(and subdomain) in the /etc/valiases/ directory – like /etc/valiases/domain123.com; /etc/valiases/homedomain.net etc.

After root login, look for the interested domain as:

root@www [~]# cd /etc/valiases/
root@www [/etc/valiases]# cat phdomain123.com
contact@plothost123.com: "|/home/phdomain123/pipe.php"
autoresponder@phdomain123.com: "|/usr/local/cpanel/bin/autorespond autoresponder@phdomain123.com /home/phdomain123/.autorespond"
postmaster@phdomain123.com: admin@phdomain123.com
*: ":fail: No such person at this address"
root@web [/etc/valiases]#

In our example:
– the first line is a forwarder to a file (a PHP script)
– the second line is an autoresponder for the email autoresponder@phdomain123.com
– the third line is a forwarder to an email address
– the fourth line is the default action for unrouted emails. In this case, the “No such person at this address” message will be sent back.

If you don’t like the command line, you can use a plugin for WHM called ConfigServer Mail Manage. After installation, access it from WHM->Plugins->ConfigServer Mail Manage; choose the domain from the list and click the Manage Mail Forwarders button. You will see something like:

cfs mail manage

You can also check forwarders/autoresponders by accessing the client’s cPanel account.

Related post: How to setup an Email Forwarder in cPanel

Share this post:

Backup all cPanel accounts of a reseller

Sometimes it can be very useful to create cpmove archives (backups) for all the accounts owned by a reseller. There is no way to do this via WHM. We will show a method here by using the cPanel pkgacct script and the WHM API listaccts function.

Below is the command to backup all accounts owned by reseller_username (replace reseller_username with your reseller username and specify the output directory):

for i in $(whmapi1 listaccts searchtype=owner search=reseller_username want=user | grep user: | awk '{print $2}'); do /scripts/pkgacct $i /backup/choose_directory; done
The output directory MUST exist. Otherwise, the backups will be created in /home directory. The backups will be created as cpmove-___.tar.gz files.

———————————————–

An example – reseller account max – it has one owned cPanel account – max1:

root@sweb [~]# for i in $(whmapi1 listaccts searchtype=owner search=max want=user | grep user: | awk '{print $2}'); do /scripts/pkgacct $i /backup/max; done
[2018-04-05 11:39:20 -0500] pkgacct started.
[2018-04-05 11:39:20 -0500] pkgacct version 10 - user : max1 - tarball: 1 - target mysql : default - split: 0 - incremental: 0 - homedir: 1 - mailman: 1 - backup: 0 - archive version: 4 - running with uid 0
[2018-04-05 11:39:20 -0500] pkgacct using '/usr/local/cpanel/3rdparty/bin/pigz -6 --processes 1 --blocksize 128 --rsyncable' to compress archives
[2018-04-05 11:39:20 -0500] pkgacct working dir : /backup/max/cpmove-max1
[2018-04-05 11:39:20 -0500] Copying Reseller Config...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Suspension Info (if needed)...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying installed SSL certificates and keys...[2018-04-05 11:39:20 -0500] Performing “ApacheTLS” component....
[2018-04-05 11:39:20 -0500] Completed “ApacheTLS” component.
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Storing SSL domain......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Domain Keys....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Counter Data....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Bandwidth Data....[2018-04-05 11:39:20 -0500] Performing “Bandwidth” component....
Summary databases … done!
[2018-04-05 11:39:20 -0500] Completed “Bandwidth” component.
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Dns Zones.......max1.com...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Mail files....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying proftpd file....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying www logs.......log file sizes [0 byte(s)]......max1.com...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copy userdata...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copy custom virtualhost templates...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying mailman lists and archives....[2018-04-05 11:39:20 -0500] Done copying mailman lists and archives.
[2018-04-05 11:39:20 -0500] Copying homedir.............
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Fixing up EA4 .htaccess blocks: Done.
[2018-04-05 11:39:20 -0500] Performing “Postgresql” component....
[2018-04-05 11:39:20 -0500] Completed “Postgresql” component.
[2018-04-05 11:39:20 -0500] Performing “Mysql” component....
[2018-04-05 11:39:20 -0500] Determining mysql dbs...[2018-04-05 11:39:20 -0500] ...mysqldump version: 10.1.32...[2018-04-05 11:39:20 -0500] ...mysql version: 10.1...[2018-04-05 11:39:20 -0500] Saving mysql privs...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] ...Done
[2018-04-05 11:39:20 -0500] Storing mysql dbs...[2018-04-05 11:39:20 -0500] ...Done
[2018-04-05 11:39:20 -0500] Completed “Mysql” component.
[2018-04-05 11:39:20 -0500] Copying cpuser file.......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying crontab file.......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Performing “Quota” component....
[2018-04-05 11:39:20 -0500] Completed “Quota” component.
[2018-04-05 11:39:20 -0500] Performing “Integration” component....
[2018-04-05 11:39:20 -0500] Completed “Integration” component.
[2018-04-05 11:39:20 -0500] Performing “AuthnLinks” component....
[2018-04-05 11:39:20 -0500] Completed “AuthnLinks” component.
[2018-04-05 11:39:20 -0500] Performing “APITokens” component....
[2018-04-05 11:39:20 -0500] Completed “APITokens” component.
[2018-04-05 11:39:20 -0500] Performing “AutoSSL” component....
[2018-04-05 11:39:20 -0500] Completed “AutoSSL” component.
[2018-04-05 11:39:20 -0500] Storing Subdomains....
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Storing Parked Domains....
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Storing Addon Domains....
[2018-04-05 11:39:20 -0500] Copying password.......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying shell.......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Performing “PublicContact” component....
[2018-04-05 11:39:20 -0500] Completed “PublicContact” component.
[2018-04-05 11:39:20 -0500] Creating Archive ....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] pkgacctfile is: /backup/max/cpmove-max1.tar.gz
[2018-04-05 11:39:20 -0500] md5sum is: 14b564a6740f515a05573d1678a0a0b8
[2018-04-05 11:39:20 -0500]
[2018-04-05 11:39:20 -0500] size is: 63125
[2018-04-05 11:39:20 -0500]
[2018-04-05 11:39:20 -0500] homesize is: 167936
[2018-04-05 11:39:20 -0500]
[2018-04-05 11:39:20 -0500] homefiles is: 54
[2018-04-05 11:39:20 -0500] pkgacct completed
[2018-04-05 11:39:20 -0500] pkgacct started.
[2018-04-05 11:39:20 -0500] pkgacct version 10 - user : max - tarball: 1 - target mysql : default - split: 0 - incremental: 0 - homedir: 1 - mailman: 1 - backup: 0 - archive version: 4 - running with uid 0
[2018-04-05 11:39:20 -0500] pkgacct using '/usr/local/cpanel/3rdparty/bin/pigz -6 --processes 1 --blocksize 128 --rsyncable' to compress archives
[2018-04-05 11:39:20 -0500] pkgacct working dir : /backup/max/cpmove-max
[2018-04-05 11:39:20 -0500] Copying Reseller Config...[2018-04-05 11:39:20 -0500]
[2018-04-05 11:39:20 -0500] Copying Reseller Packages and Features ...
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Suspension Info (if needed)...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying installed SSL certificates and keys...[2018-04-05 11:39:20 -0500] Performing “ApacheTLS” component....
[2018-04-05 11:39:20 -0500] Completed “ApacheTLS” component.
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Storing SSL domain......[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Domain Keys....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Counter Data....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Bandwidth Data....[2018-04-05 11:39:20 -0500] Performing “Bandwidth” component....
Summary databases … done!
[2018-04-05 11:39:20 -0500] Completed “Bandwidth” component.
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Dns Zones.......max.com...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying Mail files....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying proftpd file....[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying www logs.......log file sizes [0 byte(s)]......max.com...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copy userdata...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copy custom virtualhost templates...[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:20 -0500] Copying mailman lists and archives....[2018-04-05 11:39:20 -0500] Done copying mailman lists and archives.
[2018-04-05 11:39:20 -0500] Copying homedir.............
[2018-04-05 11:39:20 -0500] Done
[2018-04-05 11:39:21 -0500] Fixing up EA4 .htaccess blocks: Done.
[2018-04-05 11:39:21 -0500] Performing “Postgresql” component....
[2018-04-05 11:39:21 -0500] Completed “Postgresql” component.
[2018-04-05 11:39:21 -0500] Performing “Mysql” component....
[2018-04-05 11:39:21 -0500] Determining mysql dbs...[2018-04-05 11:39:21 -0500] ...mysqldump version: 10.1.32...[2018-04-05 11:39:21 -0500] ...mysql version: 10.1...[2018-04-05 11:39:21 -0500] Saving mysql privs...[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] ...Done
[2018-04-05 11:39:21 -0500] Storing mysql dbs...[2018-04-05 11:39:21 -0500] ...Done
[2018-04-05 11:39:21 -0500] Completed “Mysql” component.
[2018-04-05 11:39:21 -0500] Copying cpuser file.......[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Copying crontab file.......[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Performing “Quota” component....
[2018-04-05 11:39:21 -0500] Completed “Quota” component.
[2018-04-05 11:39:21 -0500] Performing “Integration” component....
[2018-04-05 11:39:21 -0500] Completed “Integration” component.
[2018-04-05 11:39:21 -0500] Performing “AuthnLinks” component....
[2018-04-05 11:39:21 -0500] Completed “AuthnLinks” component.
[2018-04-05 11:39:21 -0500] Performing “APITokens” component....
[2018-04-05 11:39:21 -0500] Completed “APITokens” component.
[2018-04-05 11:39:21 -0500] Performing “AutoSSL” component....
[2018-04-05 11:39:21 -0500] Completed “AutoSSL” component.
[2018-04-05 11:39:21 -0500] Storing Subdomains....
[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Storing Parked Domains....
[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Storing Addon Domains....
[2018-04-05 11:39:21 -0500] Copying password.......[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Copying shell.......[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] Performing “PublicContact” component....
[2018-04-05 11:39:21 -0500] Completed “PublicContact” component.
[2018-04-05 11:39:21 -0500] Creating Archive ....[2018-04-05 11:39:21 -0500] Done
[2018-04-05 11:39:21 -0500] pkgacctfile is: /backup/max/cpmove-max.tar.gz
[2018-04-05 11:39:21 -0500] md5sum is: 6165782f02dffdfdb62892a5e4669f27
[2018-04-05 11:39:21 -0500]
[2018-04-05 11:39:21 -0500] size is: 63383
[2018-04-05 11:39:21 -0500]
[2018-04-05 11:39:21 -0500] homesize is: 1949696
[2018-04-05 11:39:21 -0500]
[2018-04-05 11:39:21 -0500] homefiles is: 58
[2018-04-05 11:39:21 -0500] pkgacct completed
root@web [~]# ls /backup/max
./  ../  cpmove-max.tar.gz  cpmove-max1.tar.gz
root@web [~]#

Share this post:

Brotli support in cPanel/EasyApache 4

Brotli is a data format specification for data streams compressed with a specific combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd order context modelling.

You can get into Brotli details on the Wikipedia page at https://en.wikipedia.org/wiki/Brotli

In simple terms, Brotli is similar to the gzip web compression. It was developed by Google. As of the present date, Brotli is supported by all major web browsers – Microsoft Edge, Google Chrome, Mozilla Firefox, Opera and Safari.
Also, Brotli is supported by web servers – Apache HTTP Server (w/ mod_brotli module), nginx (w/ ngx_brotli module), LiteSpeed Web Server, Node.js (w/ shrink-ray community module) .
cURL supports Brotli since version 7.57 (November 2017).

ea4 mod_brotli

To enable Brotli on your cPanel/WHM server:

  1. Log in to your WHM panel as root.
  2. Navigate to Software->EasyApache 4
  3. Click the Customize button
  4. Now on the Apache Modules tab, search and select mod_brotli.
  5. Click the Next button few times and in the end click Provision button.
  6. You will see the confirmation message The provision process is complete.

You can also add support for Brotli via the command line:

root@web [~]# yum install ea-apache24-mod_brotli.x86_64

 

Check if your site uses Brotli at https://tools.keycdn.com/brotli-test In our case the result is:

brotli test

The Content-encoding header will be:

Content-Encoding: br

Share this post:
Page 3 of 9
1 2 3 4 5 9