Question: I am hosting quite a lot of virtual hosts using Apache in a basic LAMP set up with the help of Webmin/Virtualmin. I am looking for a top-like tool in which I can monitor current connections. The virtual hosting part seems to be giving me trouble here. Here's what I've tried:

* `netstat` - I can see the connections, but they show me as if they're all using my primary domain, e.g. `mydomain.com:www`.
* `iftop` - I like it a lot, but similar downside as `netstat`: does not show the virtual host.
* `apachetop` - seems to be showing not information for all my virtual hosts. I'm logging to separate custom log files, which I'm suspecting is the cause for why it doesn't work.
* `ntop`, `darkstat`, `MRTG`, `bwm-ng`, `IPTraf` - not working either.

So, basically, I'm looking for something similar to the current output of `netstat`, but to include the virtual host the request is for, e.g.: `avirtualsite.com:www`.

Answer: 
You can check all ips connected on port 80 with this bash

```
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head

```

**Note:** if you want to see other port, change 80

**OUTPUT:**

```
 19 x.174.143.1
 13 x.175.135.1
  9 x.68.135.1
  8 x.144.87.1
  7 x.68.150.1
  6 x.92.4.1
  6 x.188.23.1
  5 x.190.164.1
  4 x.189.156.1

```
You can check this with:

```
netstat -na | grep 'ESTA'

```