LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Reading the web log? (https://www.linuxquestions.org/questions/linux-server-73/reading-the-web-log-545846/)

NewBudda 04-13-2007 02:55 PM

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?

TefoZi 04-13-2007 03:44 PM

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'

...

TefoZi 04-13-2007 03:51 PM

or even

cut -f 7,4 -d ' ' /var/log/apache2/access.log | grep 'your_image.gif' | grep '13/Apr/2007'

NewBudda 04-13-2007 04:12 PM

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?

TefoZi 04-13-2007 04:33 PM

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 ...

haxpor 04-13-2007 05:21 PM

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>

NewBudda 04-14-2007 02:20 PM

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!


All times are GMT -5. The time now is 02:05 AM.