Coders Tent

Server Admin's Diary

Author: coderstent (page 2 of 3)

Reset SSH config from WHM?

Scala Hosting

There is, login to WHM using the non-SSL port 2086 and then change the URL to:


It makes your SSH configuration default.

How to to know SSH port on the cPanel server?

Scala Hosting

Steps to know SSH port of cPanel server –

1. Login to WHM with your login details.
2. Go to restart servicees.
3. Restart SSH server. Once service get restart you will get below information –
Waiting for “sshd” to restart ………waiting for “sshd” to initialize ………finished.
Service Status
sshd (/usr/sbin/sshd) running as root with PID 904715 (process table check method)
Startup Log
Starting sshd: [ OK ]
Log Messages
Apr 6 05:48:40 server sshd[904715]: Server listening on :: port 8872.
Apr 6 05:48:40 server sshd[904715]: Server listening on port 8872.
Apr 6 05:48:39 server sshd[4031]: Received signal 15; terminating.
sshd restarted successfully.
That’s it!

In the above output, you can see 8872 is the SSH port.

Missing DEFMOD Config Line in /etc/wwwacct.conf

Scala Hosting

1. Login as root
2. Type “pico /etc/wwwact.conf”
3. Add the following line “DEFMOD Xskin” (replace Xskin with the default theme).



1. Login as root
2. Type nano /etc/wwwact.conf
3. Add the following line “DEFMOD Xskin” (replace Xskin with the default theme).

How to increase the PHP Max Input Vars

Scala Hosting

The PHP Max Input Vars is the maximum number of variables your server can use for a single function. To work properly with a modern WordPress theme set this value to 5000. Lower values can create problems such lost data in your Theme Options, Widgets disappear etc.

How to increase the PHP Max Input Vars

Like the other values above, you’ll need to access and modify either the php.ini or the .htaccess files. Most hosts won’t grant you full access to modify the PHP.ini file because it affects the whole server and all the websites hosted on it.Please contact your host first to find out if they can adjust it for you.

For advanced users who have their own server setups and full access to the php.ini file, please go ahead and try Method 1 first before the other method. For standard users, we encourage you to try Method 2 instead.

1. Method: edit the PHP.ini file

NOTE: many shared hosts prohibit you from having direct access to the PHP.ini file. Only do this method if you have direct access to your PHP.ini file or if you’re on your localhost.

  1. Locate your PHP.ini file. If you can’t find it, then you can create your own PHP.ini file in the root folder of your WordPress installation.
  2. If you find your existing PHP.ini, open the file and locate the following line of code (xx represents a number):max_input_vars = xx; And set it to your desired limit. For example, 5000.
  3. If you created your own PHP.ini file, then add the same code inside it:max_input_vars = 5000 Simply change the value to the recommended value. For example, 5000.
  4. Save your changes, and reboot your localhost or your server.

2. Method: edit the .HTACCESS file

NOTE: make sure to backup your .htaccess file before editing.

  1. Locate your .htaccess file which is usually in the root folder of your WordPress installation. If you can’t find it, it may be because it’s hidden. Here’s a tutorial for Windows and a tutorial for Mac on how to reveal hidden files on your computer.
  2. Open the .htaccess file with a text editor program (Notepad or TextEdit) and add the following line of code:php_value max_input_vars 5000. Simply change the value to the recommended value. For example, 300.
  3. Save the file and refresh your website.


This issue is less common, nowadays, but the issue can also occur due to a program called Suhosin which runs on your server. This is a known issue with WordPress and affects both the standard WordPress Menu System.

In most cases, the solution is as simple as asking your host to increase the max_vars variables in your php.ini. = 5000 
suhosin.request.max_vars = 5000  

Know Linux Name and Version

Scala Hosting

The procedure to find os name and version on Linux:

  1. Open the terminal application (bash shell)
  2. For remote server login using the ssh: ssh [email protected]
  3. Type any one of the following command to find os name and version in Linux:
    $cat /etc/os-release
    $lsb_release -a
  4. Type the following command to find Linux kernel version:
    $uname -r

/etc/issue file

Use more command/less command as follows:
$ cat /etc/issue
$ more /etc/issue
$ less /etc/issue

Getting help

You can also view the manual page on uname using the following command:
$ man hostnamectl
$ man uname
$ man cat

Transfer SSL certificate with cPanel/WHM

Scala Hosting

In this article, we are going to see how we can migrate SSL certificates from one server to another. Before we transfer, you should be aware of the components involved with SSL certificates and how it is stored. Let’s have a detailed look on it.

There will be a certificate file. It will have the extension (.crt). Also, there will be a key and it will have the extension (.key). There will also be a CA bundle. We need to copy the files to new server in order to migrate the SSL certificate.

Steps to transfer SSL certificate

1) Login to your WHM.

You could access the WHM with https://server.hostname.tld:2087. This will lead you to the home page of WHM interface.

Now locate the ‘SSL/TLS’ section in WHM and go to ‘SSL Storage Manager’ as shown in the figure.

You will be lead to the next page. There you could find the certificates and keys with the username. Please locate the certificate you wish to transfer.

2) Copy the key

Please refer to the attached screen shot for any clarification.

Now you need to copy the key and paste it on a text file. To view the full content, please click on the lens icon near the key. The key will be starting with —–BEGIN RSA PRIVATE KEY—– and will end up with —–END RSA PRIVATE KEY—–.

3) Copy the Certificate

Now you need to copy the certificate. This also can be done from the previous window. Please click on the lens icon next to the certificate so that you would be able to view and copy the certificate.

Please copy and paste the certificate on a text file. The certificate will be starting with —–BEGIN CERTIFICATE—– and ending with —–END CERTIFICATE—–.

Now you need to install the certificate on the new server. You could install it from the WHM interface and the cPanel interface.

4) Install the certificate on new server

To install the certificate from the WHM, please locate “Install an SSL Certificate on a Domain” under the “SSL/TLS”. Please refer to the screenshot below in case of any doubts.

You need to use the certificate and key copied and saved on the text files earlier. You also could install it from the cPanel interface. To see how to install SSL certificate from the cPanel interface, please follow the guide in the link below.

If you need any further assistance please contact Syed Ashik Mahmud

Install Let’s Encrypt SSL on Hostname in cPanel/WHM Server

Scala Hosting

The Let’s Encrypt allows you to install AutoSSL for the hostname. In this tutorial, I will show you how to install Let’s Encrypt SSL to the hostname. Here are the steps to install the same on hostname.

Install Let’s Encrypt Auto SSL Provider.

Run the following command to install Let’s Encrypt provider.


Once you have installed Let’s Encrypt provider, change auto SSL provider to Let’s Encrypt from Comodo.

Login to WHM >> Manage AutoSSL.

Install Self-Signed Certificate to Hostname.

1) Login to WHM as a root user.

2) Go to “Service Configuration”.

3) Then select the following services and click on “Browse Certificate”.

Calendar, cPanel, WebDisk, Webmail, and WHM Services

Dovecot Mail Server

Exim (SMTP) Server

FTP Server

4) Select hostname and click on “Use Certificates”.

5) Then click on “Install”.

Replace Self Signed Certificates with Valid Let’s Encrypt Certificates.

Once you have installed the self-signed certificate, run the following command to check SSL certificates


The Self signed SSL certificates will be replaced with a valid Let’s Encrypt certificate while running above command.

Once it is completed, you can access WHM with the hostname https://hostname:2087

If you need any further assistance please contact Syed Ashik Mahmud

How to upgrade MySQL via WHM panel

Scala Hosting

After you upgrade MySQL, there is no supported way to downgrade to the previous version. There will be downtime of the MySQL service during the upgrade process. You should take a backup of the existing database system before you proceed.

In order to upgrade MySQL version from WHM panel, you have to login as root in your WHM and type in the search bar: MySQL.

You will see MySQL Upgrade in the Software section.

After you click on this tab you will be able to review the current version of the MySQL and select the next version, which is available to upgrade. In the screenshot below for example, you can see that the current database version – 5.5 – can be upgraded to 5.6. The screen lists all the important features in the latest version giving you an overview that should help you decide if upgrading the database is worthwhile or not. You should click “Next”

At the next screen the system warns you that you should take a backup of the existing database system. Second, it instructs you that there is no way to downgrade a MySQL database framework from a higher version two a lower one. If this is acceptable for you, you have to tick off two checkboxes indicating that you fully understand the risks of upgrading your database and click continue as shown below:

The next step is information about the upgrade of apache and PHP. Not all MySQL upgrades require them to be rebuilt. In this test example, the system recommends a partial upgrade without an Apache/PHP rebuild – If you upgrade from MySQL 5.5 or 5.6, you do not need to rebuild Apache because the client libraries are compatible.

Once you have choose the proper option for you, you should click on continue and the process will begin. This can take quite a while. All the while, you can check the output in the box below to see the progress.

When the upgrade is done you will see a screen like the image below:

Source :

Configure Email Settings with Scala Hosting and Cloudflare

Scala Hosting

12 Critical Linux Log Files You Must be Monitoring

Scala Hosting

Log files are the records that Linux stores for administrators to keep track and monitor important events about the server, kernel, services, and applications running on it. In this post, we’ll go over the top Linux log files server administrators should monitor.

What are Linux log files

Log files are a set of records that Linux maintains for the administrators to keep track of important events. They contain messages about the server, including the kernel, services and applications running on it.

Linux provides a centralized repository of log files that can be located under the /var/log directory.

The log files generated in a Linux environment can typically be classified into four different categories:

  • Application Logs
  • Event Logs
  • Service Logs
  • System Logs

Why monitor Linux log files

Log management is an integral part of any server administrator’s responsibility.

By monitoring Linux log files, you can gain detailed insight on server performance, security, error messages and underlying issues by. If you want to take a proactive vs. a reactive approach to server management, regular log file analysis is 100% required.

In short, log files allow you to anticipate upcoming issues before they actually occur.

How to read log files by SSH

cat /var/log/messages

Which Linux log files to monitor

Monitoring and analyzing all of them can be a challenging task.

The sheer volume of logs can sometimes make it frustrating just to drill down and find the right file that contains the desired information.

To make it a little easier for you, we will introduce you to some of the most critical Linux log files that you must be monitoring.

1. /var/log/messages

What’s logged here?:
  • This log file contains generic system activity logs.
  • It is mainly used to store informational and non-critical system messages.
  • In Debian-based systems, /var/log/syslog directory serves the same purpose.
How can I use these logs?:
  • Here you can track non-kernel boot errors, application-related service errors and the messages that are logged during system startup.
  • This is the first log file that the Linux administrators should check if something goes wrong.
  • For example, you are facing some issues with the sound card. To check if something went wrong during the system startup process, you can have a look at the messages stored in this log file.

2. /var/log/auth.log

What’s logged here?
  • All authentication related events in Debian and Ubuntu server are logged here.
  • If you’re looking for anything involving the user authorization mechanism, you can find it in this log file.
How can I use these logs?:

Suspect that there might have been a security breach in your server? Notice a suspicious javascript file where it shouldn’t be? If so, then find this log file asap!

  • Investigate failed login attempts
  • Investigate brute-force attacks and other vulnerabilities related to user authorization mechanism.

3. /var/log/secure

What’s logged here?

RedHat and CentOS based systems use this log file instead of /var/log/auth.log.

  • It is mainly used to track the usage of authorization systems.
  • It stores all security related messages including authentication failures.
  • It also tracks sudo logins, SSH logins and other errors logged by system security services daemon.
How can I use these logs?:
  • All user authentication events are logged here.
  • This log file can provide detailed insight about unauthorized or failed login attempts
  • Can be very useful to detect possible hacking attempts.
  • It also stores information about successful logins and tracks the activities of valid users.

4. /var/log/boot.log

What’s logged here?
  • The system initialization script, /etc/init.d/, sends all bootup messages to this log file
  • This is the repository of booting related information and messages logged during system startup process.
How can I use these logs?:
  • You should analyze this log file to investigate issues related to improper shutdown, unplanned reboots or booting failures.
  • Can also be useful to determine the duration of system downtime caused by an unexpected shutdown.

5. /var/log/dmesg

What’s logged here?
  • This log file contains Kernel ring buffer messages.
  • Information related to hardware devices and their drivers are logged here.
  • As the kernel detects physical hardware devices associated with the server during the booting process, it captures the device status, hardware errors and other generic messages.
How can I use these logs?:
  • This log file is useful for dedicated server customers mostly.
  • If a certain hardware is functioning improperly or not getting detected, then you can rely on this log file to troubleshoot the issue.

6. /var/log/kern.log

What’s logged here?

This is a very important log file as it contains information logged by the kernel.

How can I use these logs?:
  • Perfect for troubleshooting kernel related errors and warnings.
  • Kernel logs can be helpful to troubleshoot a custom-built kernel.
  • Can also come handy in debugging hardware and connectivity issues.

7. /var/log/faillog

What’s logged here?

This file contains information on failed login attempts.

How can I use these logs?:

It can be a useful log file to find out any attempted security breaches involving username/password hacking and brute-force attacks.

8. /var/log/cron

What’s logged here?

This log file records information on cron jobs.

How can I use these logs
  • Whenever a cron job runs, this log file records all relevant information including successful execution and error messages in case of failures.
  • If you’re having problems with your scheduled cron, you need to check out this log file.

9. /var/log/yum.log

What’s logged here?

It contains the information that is logged when a new package is installed using the yum command.

How can I use these logs?:
  • Track the installation of system components and software packages.
  • Check the messages logged here to see whether a package was correctly installed or not.
  • Helps you troubleshoot issues related to software installations.

Suppose your server is behaving unusually and you suspect a recently installed software package to be the root cause for this issue. In such cases, you can check this log file to find out the packages that were installed recently and identify the malfunctioning program.

10. /var/log/maillog or /var/log/mail.log

What’s logged here?

All mail server related logs are stored here.

How can I use these logs?
  • Find information about postfix, smtpd, MailScanner, SpamAssassain or any other email related services running on the mail server.
  • Track all the emails that were sent or received during a particular period
  • Investigate failed mail delivery issues.
  • Get information about possible spamming attempts blocked by the mail server.
  • Trace the origin of an incoming email by scrutinizing this log file.

11. var/log/httpd/

What’s logged here?
  • This directory contains the logs recorded by the Apache server.
  • Apache server logging information are stored in two different log files – error_log and access_log.
How can I use these logs?:
  • The error_log contains messages related to httpd errors such as memory issues and other system related errors.
  • This is the place where Apache server writes events and error records encountered while processing httpd requests.
  • If something goes wrong with the Apache webserver, check this log for diagnostic information.
  • Besides the error-log file, Apache also maintains a separate list of access_log.
  • All access requests received over HTTP are stored in the access_log file.
  • Helps you keep track of every page served and every file loaded by Apache.
  • Logs the IP address and user ID of all clients that make connection requests to the server.
  • Stores information about the status of the access requests, – whether a response was sent successfully or the request resulted in a failure.

12. /var/log/mysqld.log or /var/log/mysql.log

What’s logged here?
  • As the name suggests, this is the MySQL log file.
  • All debug, failure and success messages related to the [mysqld] and [mysqld_safe] daemon are logged to this file.
  • RedHat, CentOS and Fedora stores MySQL logs under /var/log/mysqld.log, while Debian and Ubuntu maintains the log in /var/log/mysql.log directory.
How can I use this log?
  • Use this log to identify problems while starting, running, or stopping mysqld.
  • Get information about client connections to the MySQL data directory
  • You can also setup ‘long_query_time’ parameter to log information about query locks and slow running queries.

Final Speech

While monitoring and analyzing all the log files generated by the system can be a difficult task, you can make use of a centralized log monitoring tool to simplify the process.

Some of our customers take advantage of using Nagios Log Server to manage their server logs. There are many opensource options available if that’s out of the budget. Needless to say though, monitoring Linux logs manually is hard.

So if you want to take a truly proactive approach to server management, investing in a centralized log collection and analysis platform which allows you to view log data in real-time and set up alerts to notify you when potential threats arise.

Source :

EuroVPS Article.

« Older posts Newer posts »