How to monitor your Apache web server logs with log.io

Автор: | 02.05.2018

http://it.ru.net/wordpress/wp-content/uploads/2018/05/how-to-monitor-your-apache-web-server-logs-with-log-io.com

As a web server admin, one of your most important tasks is being able to easily monitor logs in real time. Having this ability can mean the difference between knowing what’s going right or wrong with your web servers, and how to resolve issues quickly. But for some admins, having to SSH into a server and then view various log files, via the terminal window, can be an exercise in frustration. Fortunately, there are plenty of tools that allow you to make this so much easier. One such tool is log.io. Log.io allows you to monitor real-time log files, for your Apache web server, through the convenience of a web browser. I want to show you how to install this incredibly helpful tool on a Ubuntu LAMP (Linux Apache MySQL PHP) server.

What you’ll need

I’ll assume you already have your LAMP server up and running. You’ll also need access to an account that has sudo rights. With all of that in place, it’s time to install.

Installation

Installing log.io is handled completely through the command line. The first thing you should do is update/upgrade. Remember, should the upgrade include the kernel, you’ll need to reboot your system. So it’s always best to do the upgrade during off hours. The update/upgrade is handled with the following two commands:

sudo apt update
sudo apt upgrade

Once these are complete and should the server not require a reboot, you’re ready to go.

The first thing we must do is install both node.js and NPM. These can be installed with a single command:

sudo apt install nodejs npm

Type your sudo password and okay the installation. When that installation completes, you’re ready to continue.

We’re going to be viewing log.io over http (and not https). Because of this, we need to silence an SSL certificate error with the command:

sudo npm config set strict-ssl false

Now we install log.io with the command:

sudo npm install -g log.io --user "root"

Configuration

The installation will create a new directory in /root, called .log.io. In order to change into that directory, you need to first issue the command sudo -s. Once you’ve successfully authenticated with your sudo password, change into the new directory with the command:

cd /root/.log.io

There are three files in that directory:

  • harvester.conf
  • log_server.conf
  • web_server.conf

Open harvester.conf with the command nano harvester.conf and make sure the nodeName line is:

nodeName: "Webserver",

Save and close that file. Open web_server.conf. In that file you’ll see this section:

  restrictHTTP: [
    "192.168.1.162",
    "10.0.*"
  ]

If you want to restrict log.io to specific IP addresses, do so there. Save and close that file.

It’s time to start the log.io services. This is done with the following two commands:

log.io-server &
log.io-harvester &

Viewing the logs

On a desktop machine that has access to your log.io webserver IP address, point your default web browser to http://SERVER_IP:28778 (where SERVER_IP is the IP address of the log.io server). You should see the main page for log.io (Figure A), already spitting out real time log entries for your Apache web server. If you see nothing, make sure to select both Apache and Webserver from the left navigation (click one and both will automatically select).

Figure A

Figure A

If the entries get to be too much to view, you can always hover your cursor in the upper right corner of the window to reveal the search bar (Figure B).

Figure B

Figure B

Filtering your logs makes them easier to view.

Welcome to easy, real-time Apache logs

Every Apache web admin should consider log.io a must-have, especially if you don’t want to have to comb through text files in a terminal window. To get easy, real-time Apache logs, you need look no further than log.io. Give log.io a try and see if it doesn’t wind up your default Apache web server log monitor.

Also See

Source

Добавить комментарий