MultiTail to monitor multiple logs

MultiTail allows tail multiple logs

SysAdmins and developers often need to access multiple log files at the same time during monitoring and control tasks. To achieve this, each log file is usually opened in a new shell. In the traditional wise way, i.e. tail -f /var/log/messages.

However, if you want to run tail logs in real time, MultiTail can be tail multiple logs pulled in.

Install MultiTail on Fedora

The EPEL repository must be added.

yum install epel-release

Install Multitail on Fedora or RHEL as follows.

yum install -y multitail

MultiTail for Debian and Ubuntu

Multitail is installed on Debian with apt-get.

sudo apt-get update
sudo apt-get install multitail

Using MultiTail commands

By default, multitail does the same as tail -f, the files are displayed in real time to open two different files in one window, the basic syntax is:

multitail /var/log/apache2/access.log /var/log/apache2/error.log

For Debian above, and for Red Hat as follows, in addition, netstat -t shows the active connections to the web server:

multitail -cS apache -R 2 -l "netstat -t" /home/www/*/web/logs/access_log

All access_log logs are opened in the logs directories. The Apache Color schema displays the active connections to the web server.

The same output, but the first 3 logfiles in 3 columns, here is an Apache web server on CentOS:

multitail -s 3 -cS apache -R 3 -l "netstat -t" /home/www/*/web/logs/access_log

Pressing the ‘b’ key will display a list of the open log files, which can be selected individually by cursor.

MultiTail allows tail multiple logs
multitail

To scroll through the log files, press ‘b’ and scroll up or down with the cursor keys. For help you press ‘h’ to output the available option in a list.

MultiTail advanced tail features

When scrolling, typing ‘G’ or ‘gg’ can get to the beginning or end of the log file, with ‘q’ you return and then leave multitail.

Postfix also has a color scheme, the syntax for /var/log/maillog as follows:

multitail -cS postfix -n 1000 /var/log/maillog

Many color schemes are defined in the /etc/multitail.conf configuration. For example for Asterisk, Bind, Samba, tcpdump and many more, new ones can be added, or the existing ones can be modified.

To prevent the multitail line with the parameters from having to be re-entered each time, the line can be executed from a script, the following lines can be easily inserted into a terminal:

cat <<EOF> /usr/bin/mtail
#!/bin/bash
multitail -cS apache -l "netstat -t" /home/www/*/web/logs/access_log
EOF

The script /usr/bin/mtail still needs to be made executable:

chmod +x /usr/bin/mtail

Here are just a few basic features of the multitail command. A complete list of options can be found in the multitail man page. With multitail -h the syntax help is output with a wide selection of possible parameters.

Change WordPress back from https to http

WP-Admin is locked after switching to HTTPS, WordPress can no longer be opened, go back to HTTP.

If something goes wrong during switching WordPress from HTTP to HTTPS, because the SSL certificate and web server configuration is not consistent, you may need to switch back to HTTP for further action, but you are locked out from WP-Admin.

Change WordPress back to HTTP

Remedy to change via phpMyAdmin in the SQL table wp_options and the field siteurl and home, with change the option_value to the desired URL.

WordPress back from https to http, Remedy to change via phpMyAdmin in the SQL table wp_options

The URL here corresponds to this one under Settings – Generally, WordPress-Address (URL) and Website-Address (URL).

WordPress back from https to http, WordPress Admin Settings

Check other WordPress settings

You may need to edit the wp-config.php configuration file to disable SSL.

define('FORCE_SSL_ADMIN', true);

Set the value to false, or comment out the line with a hash.

define('FORCE_SSL_ADMIN', false);

Check Apache RewriteRule

Also, it may be important to note that if Apache RewriteRule HTTPS is enabled, it can be reset.

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mydomain.com
RewriteRule ^https://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]

This could be in the .htaccess file, or in the web server configuration under VirtualHost of the appropriate domain.

WP-Admin-Dashboard

WP Admin is the classic WordPress dashboard, so to speak. If you look at WordPress tutorials online, you can often find images of this dashboard there. You can do almost anything in your main WordPress.com dashboard, but if you prefer you can use WP Admin instead.