Monthly Archives: August 2017

How to enable/disable AutoSSL in WHM

AutoSSL is a cPanel utility that will automatically generate and renew(every three months) free cPanel SSL certificates (Powered by Comodo) for your users/domains.

The AutoSSL feature provides free SSL certificates for your users’ domains. The system will periodically inspect users’ installed certificates and replace those that are about to expire or that are insufficient to provide a baseline level of security.

Users who do not have the “autossl” feature will not receive the free certificates.

To enable/disable AutoSSL in WHM:

  1. Login to WHM as root
  2. Navigate to SSL/TLS >> Manage AutoSSL
    whm autossl 1
  3. Choose:
    – cPanel (powered by Comodo) – to enable it
    Disabled – to disable it
    whm autossl 2
  4. Click the Save button.

On the Manage AutoSSL WHM page you can check the logs, see the pending queue. You can also manage AutoSSL for individual users.

whm autossl 3

For each user you have three options:
– Enable AutoSSL 

Override the feature list setting and force AutoSSL to be enabled.

– Disable AutoSSL

Override the feature list setting and force AutoSSL to be disabled.

– Reset to Feature List Setting

Use setting established by the feature list “default” which is currently set to “enabled”.

Share this post:

WHM/cPanel – Unknown License File Version

You will get such an error when the system fails to get a new license. The cPanel message states:

Unknown License File Version (has = 27, needed = 28, length=2931). This means that the system failed to get a new license, or part of the update process failed.

It can also happen to get such a message after installing/uninstalling cPanel many times in a short period of time or when a cPanel update fails.

The message is displayed after you login to WHM and it looks like:

cpanel unknown license file

Usually, the solution is to run the suggested command /usr/local/cpanel/cpkeyclt . But many times, this will now work. Here is a an example:

root@web [~]# /usr/local/cpanel/cpkeyclt
Updating cPanel license...Done. Update Failed!
Error message:
The cPanel license server replied that the license has been activated on too many machines.
Please contact billing@cpanel.net

The exact message was: The license has been activated too many times on different machines. (162.255.110.110)!

Building global cache for cpanel...Done
root@web [~]#

So, the only solution is to contact cPanel billing department or your cPanel hosting provider. Tell them the error message. They will reissue the license.

Share this post:

How to change the hostname on a cPanel web server

You will probably not change the server hostname very often, but we will show you here how to do it.

Usually, on a Linux server you will use the command hostname server.domain.com , like:

root@web [~]# hostname
web.plothost.com
root@web [~]# hostname webnew.plothost.com
root@web [~]# hostname
webnew.plothost.com
root@web [~]#
This is not a recommended method on a cPanel server.

There some recommended methods by cPanel to change the hostname:

1. Via WHM >> Networking Setup >> Change Hostname
2. Via sethostname WHM API function.
3. Via the set_hostname cPanel utility.

The second method can be used in a third party site/application. Read the cPanel documentation for more details. We will detail the methods 1. and 3.

To change the hostname in WHM:

  1. Login as root to WHM
  2. Navigate to Networking Setup >> Change Hostname
  3. Enter the desired hostname in the New Hostname field.
    whm change hostname
  4. Click the Change button. After few seconds you will the message Changing hostname… …Done with other details.
  5. Scroll to the bottom of the page and click the Add an A entry for your hostname button
    whm add a entry hostname
  6. On the page that will open, click the Add Entry button.
    whm confirm a entry
  7. You will see a message Adding A Entry……Done
  8. That’s all. Your new hostname is ready to use.

Don’t forget to read the cPanel Instructions:

It is important to choose a hostname that you will not be using for any account. You should choose something that will be socially acceptable, as it will appear in all mail headers. Your hostname must be a FQDN. In English, a hostname should consist of a name and a domain name. All valid hostnames should have 2 dots in them. Hostnames should never begin with “www”. Hostnames should also not begin with a digit, nor end with a hyphen (“-”).

The movie tutorial for changing the server’s hostname in WHM:

We will show below how to change the server’s hostname via the set_hostname cPanel utility. First, the full command:

root@web [~]# /usr/local/cpanel/bin/set_hostname --help
/usr/local/cpanel/bin/set_hostname 

When run as root, this program changes this servers hostname, updating it in all of the relevant locations on your system.

Options:
    --help: this help
root@web [~]#

Now let’s change the hostname:

root@web [~]# /usr/local/cpanel/bin/set_hostname web11.plothost.com
Changing hostname to web11.plothost.com...Success!

Hostname set to: web11.plothost.com
Output during rename:

Stopping cPHulkd during hostname change
Waiting for “cphulkd” to stop ………finished.
Startup Log
        Aug 19 03:43:46 web systemd[1]: Starting cPanel brute force detector services...
        Aug 19 03:43:46 web systemd[1]: PID file /var/run/cphulkd_processor.pid not readable (yet?) after start.
        Aug 19 03:43:46 web systemd[1]: Started cPanel brute force detector services.
        Aug 19 03:47:18 web systemd[1]: Stopping cPanel brute force detector services...
cphulkd stopped successfully.
Stopping MySQL during hostname change
Changing hostname in kernel to web11.plothost.com
Altered hostname in /etc/sysconfig/network
Updating cPHulkd

hulkdsetup: database schema is up to date.

Starting cPHulkd

Waiting for “cphulkd” to start ……waiting for “cphulkd” to initialize ………finished.
Service Status
        cphulkd (cPhulkd - processor - dormant mode - acce --start) is running as root with PID 7633 (systemd check method).
Startup Log
        Aug 19 03:47:22 web systemd[1]: Starting cPanel brute force detector services...
        Aug 19 03:47:22 web systemd[1]: PID file /var/run/cphulkd_processor.pid not readable (yet?) after start.
        Aug 19 03:47:22 web systemd[1]: cphulkd.service: Supervising process 7633 which is not our child. We'll most likely not notice when it exits.
        Aug 19 03:47:22 web systemd[1]: Started cPanel brute force detector services.
cphulkd started successfully.
Restarting Exim

Waiting for “exim” to restart ………waiting for “exim” to initialize ………finished.
Service Status
        exim (/usr/sbin/exim -bd -q60m -oP /var/spool/exim/exim-daemon.pid) is running as mailnull with PID 7661 (systemd check method).
        exim (/usr/sbin/exim -qG) is running as root with PID 7662 (systemd check method).
        exim (/usr/sbin/exim -qG) is running as root with PID 7676 (systemd check method).
Startup Log
        Aug 19 03:47:23 web systemd[1]: Starting Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another....
        Aug 19 03:47:23 web systemd[1]: Started Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another..
Log Messages
        2017-08-19 03:47:23 exim 4.89 daemon started: pid=7661, -q1h, listening for SMTP on port 587 (IPv6 and IPv4) port 25 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)
exim restarted successfully.
Updating Apache configuration

Updating cPanel license...Done. Update succeeded.
Building global cache for cpanel...Done

The system has queued the hostname changes for the Horde and DAV services.
Users cannot access the Horde or DAV features that use these services until
the system has finished updates to the hostname. After the system adjusts a
specific user’s database, it restores their access to the Horde and DAV services.

You will receive a notification when the system completes the update for all users.

Waiting for “mysql” to start ……waiting for “mysql” to initialize ………finished.

Service Status
        mysql (/usr/sbin/mysqld) is running as mysql with PID 7576 (systemd check method).

Startup Log
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: Highest supported file format is Barracuda.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: 128 rollback segment(s) are active.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: Waiting for purge to start
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 113808666
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] Plugin 'FEEDBACK' is disabled.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846181975808 [Note] InnoDB: Dumping buffer pool(s) not yet started
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] Server socket created on IP: '::'.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] /usr/sbin/mysqld: ready for connections.
        Aug 19 03:47:21 web mysqld[7576]: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
        Aug 19 03:47:21 web systemd[1]: Started MariaDB database server.

Log Messages
        Aug 19 03:47:21 web mysqld: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
        Aug 19 03:47:21 web mysqld: 2017-08-19  3:47:21 139846925715712 [Note] /usr/sbin/mysqld: ready for connections.
        Aug 19 03:47:21 web mysqld[7576]: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server

mysql started successfully.
root@web [~]#
Share this post:

How to change the WHM/cPanel update tier

You can change the cPanel/WHM update tier in WHM>>Server Configuration>>Update Preferences. You will see there your cPanel installed version and the current tier.

whm cpanel update tier

Notice that once you update the system, you can’t return to an older version. For example from CURRENT tier – version 66.0.13 you can’t go to RELEASE tier – version 64.0.36

On this WHM page, you can also see descriptions for each tier. The Recommended tier is RELEASE. You can also use STABLE. The EDGE tier should only be used for testing purposes.

Tier Description
LTS Long Term Support
STABLE The last tier to receive changes
CURRENT General Availability – Recommended
RELEASE Release Candidate
EDGE Perpetual Development – Application development and testing only.

So, to change the cPanel/WHM tier:

  1. Log into WHM as root
  2. Go to Server Configuration>>Update Preferences
  3. Change the tier as desired. Click the Save button at the bottom of the page.
  4. You will see a message The system has saved your settings to the local server. Any changes will take effect when the next update runs. To update the local server now, click here.
  5. Click the here link from the message to apply the update immediately (if there is any).
You should allow daily cPanel automatic updates. Just check the Automatic option.

whm cpanel update daily

Share this post:

How to find when MySQL/MariaDB server was started

We will show you here how you can get the MySQL/MariaDB server started date on a CentOS server. This can be useful for server statistics etc.

1. Use the select now() – interval variable_value second from information_schema.global_status where variable_name=’Uptime’; command at the mysql prompt.

root@web [~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 54690
Server version: 10.1.25-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select now() - interval variable_value second as 'MySQL started on' from information_schema.global_status where variable_name='Uptime';
+----------------------------+
| MySQL started on           |
+----------------------------+
| 2017-08-12 02:14:21.000000 |
+----------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> quit
Bye
root@web [~]#

2. Use the mysqladmin utility with the command mysqladmin ver|grep Uptime

root@web [~]# mysqladmin ver|grep Uptime
Uptime:                 6 days 9 hours 54 min 5 sec
root@web [~]#

3. Use the operating system service command service mysqld status | grep running

root@web [~]# service mysqld status | grep running
Redirecting to /bin/systemctl status  mysqld.service
   Active: active (running) since Sat 2017-08-12 02:14:22 EDT; 6 days ago
root@web [~]#
Share this post:
Page 2 of 2
1 2