tail and remote log files

I would like to be able to make a tail -f error.log of my remote httpd server. I said I would like because it doesn't work, it tails, but the tail is not refreshed.

I did the following:
- I went on Server Admin and change the Apache log directory to /Groups/Logs/httpd
- I Shared this dir
- I went on my remote machine, log onto the share dir and try from the console to tail -f /Volumes/...../error.log
- The same tail command is refreshed locally on the server itself but never on the remote machine even if I CTRL C the command and retype it.

Any ideas arround?

Thierry

Power Mac G5 Duo, Mac OS X (10.4.8), OS X Server

Posted on Oct 9, 2006 6:06 AM

Reply
4 replies

Oct 9, 2006 6:59 AM in response to Thierry Boufflet

one way to do this is to tail the log via ssh. if you don't want to ssh in, then tail the log, you can do it in one step:

ssh user@host.tld 'tail -f /var/log/httpd/access_log'

i don't recommend sharing the logs directory via AFP to do this, especially if you just have the AFP ports open to the whole world.

alternatively, you could configure a syslog server somewhere and direct apache to log to it. i'm not that familiar with doing this, so you'll have to do some homework first.

also, be sure when you say the "tail is not refreshed" that you're not just experiencing the log rollover that happens every day.

Oct 9, 2006 8:10 AM in response to Thierry Boufflet

I manage to do the job !!

Here is the trick for those who may encounter the same type of questions.

On the remote server type:
$>service ssh start

On the remote client:
$>ssh user@remotehost_address

That will that few seconds to setup the Key and you will be prompt for your password.
From that point a secure Console channel is established between the 2 machines. You can type the tail -f /var/log/httpd/access.log as if you are local.
Thats great!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

tail and remote log files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.