Glances – a cross-platform system monitoring tool for Ubuntu Server

Glances is a free software (licensed under LGPL) to monitor your GNU/Linux or BSD operating system from a text interface.

Installation:

screenshot-wide

Secure your Ubuntu Server

First thing to do when setting up a Ubuntu Server is to make sure it’s secure.┬áInstall fail2ban to make sure you block IP-addresses that try to break in, and log everything with logwatch.

Update the system.

 

Install fail2ban.

 

Copy the configuration file.

 

Edit the file.

 

Change the ban time from 600 (10 minutes) to 604800 (7 days) and CTRL + O to save and CTRL + X to exit.

 

Install logwatch.

 

Edit logwatch daily cron to email you the log.

 

Add this line at the bottom and replace the example email with your own. Save with CTRL + O and exit with CTRL + X.

 

Automatically start MySQL if apache kills the process or sacrifice children on Ubuntu Server

There are several ways to solve the problem of Apache running wild and killing MySQL. It the problem occurs very┬áinfrequently, there’s a easy way of restarting MySQL with the use of the crontab. The script even sends a notification email so you know what just happened.

First, SSH into your server:

Create a script file:

Paste the following:

Press CTRL + O to save, and CTRL + X to exit.

Give execute permission to your script:

Edit the Crontab:

Paste the following:

Press CTRL + O to save, and CTRL + X to exit.

To see if it works, type the following:

In case the service doesn’t start, just start it manually with the following: