Page 1 of 1

Realtime Apache Monitor

Posted: Tue Nov 18, 2003 5:05 am
by trixter
I am looking for a program that will automatically monitor the activity of my xbox's apache webserver and display the information on the xbox screen. This would be similar to what the "simple server" built into the home version displays. It would show things like the IP of who is currently on, what page they are accessing, etc.

Is anyone aware of such a package? If not, is there a simple way to make the apache access log automatically dump its contents to the screen? Thanks.

Posted: Tue Nov 18, 2003 11:07 am
by rocketeer
Answer to your 2nd question:

Code: Select all

tail -f /var/log/apache2/access_log
Use CTRL+C to quit the tail (substitute log path if yours is different).

Posted: Tue Nov 18, 2003 1:19 pm
by trixter
I found this on another site:

tail -f /var/log/apache2/access_log ¦ cut -d' ' -f1,7 ¦ grep -v .jpg ¦ grep -v .php ¦ grep -v .css ¦ grep -v .gif

Would this work? I tried it and the the cursor doesn't come back and nothing is displayed. I don't know much about linux, but what does this "grep" command do?

Posted: Wed Nov 19, 2003 2:33 pm
by rocketeer
Try

Code: Select all

man grep
The -v flag means inverted grep, ie lines that don't match. Basically it means that you'd not see the log lines with jpg, php, css and gif extensions. However, the -v option is not standard so it is distribution dependant.
The 'cut' command filters away the fields you don't want to see.