Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there a way to monitor the activity of a web server via the command line.

I have seen in many movies webmasters watching a command line screen in which data is continuously moving up, seems to me more like a web server activity monitor. Like as seen in this video at 1.48.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The video that you have linked does not look like real time monitering it just looks like SSH and they are preforming SSH commands such as GREP and CURL, or they are viewing files that contain scripts and just scrolling down.

It's worth mentioning that generally when news companies make videos they want the IT guys to look super smart and super geeky.. Its unlikely they will be using such command lines on a daily basis and will be using GUI's via an web application to view things such as this. Anyway onto the actual answer we go...

You can view the current concurrent users within SSH using:

netstat -plan | grep :80 | wc -l

And for Real Time Monitoring use:

httpd status

And for even more information within the httpd status use:

httpd fullstatus

Cpanel users can use (not tested this myself)

/usr/bin/lynx -dump -width 500 http://127.0.0.1/whm-server-status

Another alternative would be to use 'GoAccess'

If you use NGinx or Apache and just want more detail on the screen then you could install GoAccess which should do the job nicely.

To install in Ubuntu/Debian do sudo apt-get install goaccess

And to run sudo goaccess /var/log/apache2/your-log-file.log

share|improve this answer
add comment

In addition to the commands that bybe mentioned, you can simply use this command to see all the hits to the webserver in the apache log file in real time as they happen:

tail -F /var/log/apache2/access_log

Then you can use <ctrl>-c to stop.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.