Archives

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:

cPanel & WHM logs location

On a cPanel web server there are many logs. We made here a list of them:

cPanel, WHM and Webmail
Access logs and user actions /usr/local/cpanel/logs/access_log
Account transfers and misc. logs /var/cpanel/logs
Auditing log (account creations, deletions, etc) /var/cpanel/accounting.log
Backup logs /usr/local/cpanel/logs/cpbackup
Backup transport logs /usr/local/cpanel/logs/cpbackup_transporter.log
Boxtrapper log ~/mail/MAILDIR/boxtrapper/log
Brute force protection (cphulkd) log /usr/local/cpanel/logs/cphulkd.log
Brute force protection (cphulkd) error log /usr/local/cpanel/logs/cphulkd_errors.log
cPanel dnsadmin dns clustering daemon /usr/local/cpanel/logs/dnsadmin_log
cPanel taskqueue processing demon /usr/local/cpanel/logs/queueprocd.log
Dbmapping /usr/local/cpanel/logs/setupdbmap_log
EasuApache build logs /usr/local/cpanel/logs/easy/apache/
Error log /usr/local/cpanel/logs/error_log
Installation log /var/log/cpanel-install.log
License updates & errors /usr/local/cpanel/logs/license_log
Locale database modifications /usr/local/cpanel/logs/build_locale_databases_log
Login errors (cpsrvd) /usr/local/cpanel/logs/login_log
Logs for all incoming requests for cpsrvd /usr/local/cpanel/logs/incoming_http_requests.log
Horde Webmail /var/cpanel/horde/log/
RoundCube Webmail /var/cpanel/roundcube/log/
SquirrelMail Webmail /var/cpanel/squirrelmail/ (nothing logged)
MySQL upgrade log /var/cpanel/logs/mysql_upgrade.log
Panic log /usr/local/cpanel/logs/panic_log
Per-account bandwidth history – cached /var/cpanel/bandwidth.cache/{username}
Per-account bandwidth history human readable /var/cpanel/bandwidth/{username}
Service status logs /var/log/chkservd.log
Tailwatchd log /usr/local/cpanel/logs/tailwatch_log
Update analysis reporting /usr/local/cpanel/logs/update_analysis/{TIMESTAMP}.log
Update (upcp) log /var/cpanel/updatelogs/update.{TIMESTAMP}.log
Webdisk (cpdavd) log /usr/local/cpanel/logs/cpavd_error_log
Website statistics log /usr/local/cpanel/logs/stats_log
cPanel support access /var/cpanel/logs/supportauth/audit.log

 

FTP (Pure-FTPD,Pro-FTPD)
FTP transaction log /usr/local/apache/domlogs/
Log for FTP transfers /usr/local/apache/domlogs/ftpxferlog
Login attempts/general info /var/log/messages

 

Named (BIND), NSD, MyDNS, SSHD
Login attempts/general info /var/log/messages

 

Mail delivery (Exim)
Delivery & receipt log /var/log/exim_mainlog
Incoming mail queue /var/spool/exim/input/
Log of messages rejected based on ACLs or other policies /var/log/exim_rejectlog
Unexpected/fatal error log /var/log/exim_paniclog

 

Mail retrieval & Spam Protection (Courier, Dovecot, SpamAssassin)
IMAP/POP login attempts, transactions, fatal errors and spam scoring

/var/log/maillog

/var/log/messages

 

Mailman
Logs /usr/local/cpanel/3rdparty/mailman/logs

 

MySQL/MariaDB
General information and errors /var/lib/mysql/{HOSTNAME}.err

 

Munin
Log for munin /var/log/munin

 

Top Memory and CPU Consumers (dcpumon)
Top processes consuming CPU & Memory /var/log/dcpumon/{YEAR}/{MONTH}/{DAY}

 

Web Server (Apache/httpd)
Apache restarts done through cPanel/WHM /usr/local/cpanel/logs/safeapacherestart_log
Domain access logs /usr/local/apache/domlogs/{DOMAIN}
Mod Security /usr/local/apache/logs/modsec_audit.log
Processing of log splitting /usr/local/cpanel/logs/splitlogs_logs
Suexec audit log /usr/local/apache/logs/suexec_log
suPHP audit log /usr/local/apache/logs/suphp_log
Web server & CGI application error log /usr/local/apache/logs/error_log

References

http://go.cpanel.net/logposter

The cPanel Log Files

Share this post:

Set up an alternative SMTP port in WHM

Due to abusive users, many Internet Service Providers (ISPs) block SMTP port 25. So you may want to set up another port on your web server instead of the default 25.

SMTP is the acronym for Simple Mail Transfer Protocol, a protocol used to send emails. More info on the Wikipedia page.

We will show you here two ways on how to add another SMTP port in WHM.

Method 1

1.Log into WHM as root

2. Navigate to Service Configuration >> Service Manager

3.Look for Exim Mail Server (on another port) option. Check the two checkboxes – cPanel will enable and monitor this service. Add the desired port(s) in the right field. The notice states: Useful for providers that block port 25 (multiple comma-delimited ports may be added).  

cpanel smtp another port4. Scroll to the bottom of the page and click the Save button. 

 

Method 2

1.Log into WHM as root

2. Navigate to Service Configuration >> Exim Configuration Manager

3. The Exim configuration page will open. Click on the Advanced Editor top tab.

exim advanced editor tab

4.Look for daemon_smtp_ports option and add your desired port(s). cPanel notice for this option: This option specifies one or more default SMTP ports on which the Exim daemon listens.

daemon smtp ports

5. Scroll to the bottom of the page and click the Save button. 

Instead of adding another SMTP port you can instruct users to use Secure SMTP ports – 465 or 587. Usually these ports are not blocked by IPSs.
Don’t forget to add the new port(s) to the allowed ports in your firewall’s configuration.
Share this post:

How to check if disk quotas work properly

This KB article is intended for CentOS with cPanel servers.

You are selling shared hosting accounts and you want to be sure that your users don’t exceed their disk space quotas? You can easily find if the disk quotas work as expected.

Mainly, as root, you will create a big file size (that added to a user account will exceed (s)he’s quota) and attempt to assign it to a user.  Steps:

  1. Log in to the server as root
  2. Navigate to a user’s home directory (in this example the user is plothost) and create a file of 100M (or 1000M etc). In our test case the plothost‘s plan has 50M space – so, if everything works as expected, we will not be able to add a 100M file.
    root@web [~]# cd /home/plothost/
    root@web [/home/plothost]# 
    root@web [/home/plothost]# dd if=/dev/zero of=test_file bs=100M count=1
    1+0 records in
    1+0 records out
    104857600 bytes (105 MB) copied, 0.527468 s, 399 MB/s
    root@web [/home/plothost]#
  3. Check the ownership of the file
    root@web [/home/plothost]# ll test_file
    -rw-r--r-- 1 root root 104857600 Jan 23 11:25 test_file
    root@web [/home/plothost]#
  4. Now try to assign the test file to the user
    root@web [/home/plothost]# chown plothost:plothost test_file
    chown: changing ownership of 'test_file': Disk quota exceeded
    root@web [/home/plothost]#

    You see the message Disk quota exceeded – this means the disk quota is working fine.

If your disk quotas do not work as expected, please check these cPanel articles:

cPanel – Initial Quota Setup  |   cPanel – How to Fix Quotas

Share this post:

Migration to cPanel

cPanel is considered one of the best web hosting control panels. If you are using other control panels (like Odin Plesk, DirectAdmin, VestaCP etc) you may consider switching to cPanel.

cPanel offers free migration service. One limitation is that only few source control panels are supported. These are Odin Plesk(Parallels), DirectAdmin and Ensim.

For more details, visit the cPanel Migration Services and Guides

If you are a site owner, our suggestion is to contact your new host and ask for advice on moving to cPanel. Many hosts offer free migration to cPanel.

To switch yourself your site to cPanel there are mainly some steps:

  1. Copy the site’s files from the old server to the new server. You can use a program like FileZilla. Check our KB article Use FileZilla to connect via FTP to your web hosting account 
  2. Copy the MySQL/MariaDB database(s). Here you need to export the database(using a control panel utility or phpMyAdmin) and import it in cPanel. cPanel offers phpMyAdmin out-of-the-box.
  3. Setup any email accounts, email forwarders, email filters, email autoresponders etc.

For server administrators/web hosts, cPanel provides a guide on How to Manually Migrate Accounts to cPanel from Unsupported Control Panels 

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