LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-13-2007, 02:55 PM   #1
NewBudda
LQ Newbie
 
Registered: Mar 2007
Distribution: Suse
Posts: 21

Rep: Reputation: 15
Question Reading the web log?


Hi,
I would like to easily access and read my servers web logs on a Suse 9.xx server.
I am trying to determine how many people read 1 image in particular and thus would like to check the web log to see how many times it was loaded.
How would I go about this? I have full putty access...
So far I have found /var/log but I could not make sense of the logs in there...

Thank you for your help in advance!

Edit*: I also checked the /var/log/apache2/access_log file but although it looked like it recorded any requests for my file.

PS: Is there a way to change the output of those log files to a "cleaner" look? You know, timestamp on the left and record on the right?

Last edited by NewBudda; 04-13-2007 at 03:23 PM.
 
Old 04-13-2007, 03:44 PM   #2
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
for image: your_image.gif

view all time access:
cat /var/log/apache2/access_log | grep 'your_image.gif'

access for today
cat /var/log/apache2/access_log | grep 'your_image.gif' | grep '13/Apr/2007'

...
 
Old 04-13-2007, 03:51 PM   #3
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
or even

cut -f 7,4 -d ' ' /var/log/apache2/access.log | grep 'your_image.gif' | grep '13/Apr/2007'
 
Old 04-13-2007, 04:12 PM   #4
NewBudda
LQ Newbie
 
Registered: Mar 2007
Distribution: Suse
Posts: 21

Original Poster
Rep: Reputation: 15
Thank you, I tried that but with the grep command simply nothing happens. Thats for both the image and the date.
I downloaded the whole access_log and search in it using notepad but couldn't find a reference to the image ((Try it here).
Does this log really record all acces?
 
Old 04-13-2007, 04:33 PM   #5
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
open this in putty
# tail -f /var/log/apache2/access.log

and try to open this image directly inside browser:
http://yourhost.net/.../yourimage.gif

putty output should updates
if not then maybe this image was cached with your browser. Clean cache and try again ...
 
Old 04-13-2007, 05:21 PM   #6
haxpor
Member
 
Registered: Dec 2006
Distribution: Ubuntu 9.10
Posts: 86

Rep: Reputation: 15
It should be 2 case to check for this.
First, if it is the only web site you host check following line in your httpd.conf, is it point to the correct log file?

Quote:
CustomLog logs/access_log combined
Second case, if you do virtual host and your site is one of it, check <VirtualHost> directive in your httpd.conf again, is it pointing to the correct log file as you look for?

Quote:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
 
Old 04-14-2007, 02:20 PM   #7
NewBudda
LQ Newbie
 
Registered: Mar 2007
Distribution: Suse
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
It should be 2 case to check for this.
First, if it is the only web site you host check following line in your httpd.conf, is it point to the correct log file?
Iam unable to find the httpd.conf. the find command does not get me anywhere...

Quote:
and try to open this image directly inside browser:
http://yourhost.net/.../yourimage.gif
For the purposes of sending this picture in emails it would be impossible to display it directly in the browser. Should I do this just to test this or would I always have to do that?

Thanks for your help!
 
  


Reply

Tags
log, server, suse, web


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading the log files using Java sboothman Programming 3 11-16-2006 06:32 AM
Opennms Logs - where are web.log, web_rtc.log and webauth.log referenced? not_much_of_a_guru Linux - Networking 0 07-12-2006 10:28 AM
log reading basics GNewbie MEPIS 3 01-28-2006 10:26 PM
Debian not reading .xinitrc on log in esteeven Debian 1 02-23-2004 09:49 AM
Log file reading Garak Linux - General 5 07-08-2003 06:55 PM


All times are GMT -5. The time now is 04:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration