Check All Apache Virtual Host Logs on Ubuntu

Sometimes I need to check all my virtual hosts on my Apache server.

The best way to do it is with a cat command like this

/var/log/apache2# cat *.access.log

If I want to keep observing the log I use the command tail as follows

/var/log/apache2# tail -f *.access.log

But if I want to check something more specific I can use a grep too

/var/log/apache2# cat *.access.log | grep root

This is a quick way to verify my logs without having to check them one by one.

Load Averages on Ubuntu

Many times you check your Ubuntu server and you see high load averages.

First number is 1 minute average, second one is 5 minute average and third one is 15 minute average.

~/backup# uptime
11:09:31 up 40 days, 17:38, 2 users, load average: 1.01, 0.66, 0.47
~/backup# cat /proc/loadavg
0.40 0.54 0.44 1/255 30135

Some interpretations:

  • If the averages are 0.0, then your system is idle.
  • If the 1 minute average is higher than the 5 or 15 minute averages, then load is increasing.
  • If the 1 minute average is lower than the 5 or 15 minute averages, then load is decreasing.
  • If they are higher than your CPU count, then you might have a performance problem (it depends).

What it means on Linux or Ubuntu is this:

On Linux, load averages are (or try to be) “system load averages“, for theĀ  system as a whole, measuring the number of threads that are working and waiting to work (CPU, disk, uninterruptible locks). Put differently, it measures the number of threads that aren’t completely idle. Advantage: includes demand for different resources. Continue reading “Load Averages on Ubuntu”