Web logs for my domain?


#1

Hi all,

I have a domain with DH, and I’d like to look through the webserver logs to see what pages have been viewed, and by which IP addresses.

How can I do this?

Thanks for any help!


#2

The raw server logs can be found in the ‘logs’ directory within the home directory of the user that controls the domain. For example; the raw logs for example.com would be found in /logs/example.com/

You can use an FTP client or SSH to log-in and view the logs.

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#3

Thanks, Mark!

Worked great, but viewing in vi is not the most convenient thing imaginable.

Can you make a recommendation for an easy log viewer/formatter that allows me to see which page/which IP?

Thanks again


#4

Unfortunately no, When I have a need to view the raw log files, I generally just view them within my FTP client (FlashFXP), so I’ve never really had a need for a specialised application. Perhaps someone else here on the forum can recommend one.

Most of my sites make use of the TraceWatch realtime stats gathering package. It does require me to create a DB and add a single line of PHP to those pages I want to track, but I find it works very well.

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#5

Hi,

Thanks for the heads-up on TraceWatch- looks interesting. I tried to install in on a DH hosted site, but am getting the error they mention on their known issues page:

"Undefined index: HTTP_HOST in…
Warning: Invalid argument supplied for foreach()…

This happens only when installing TraceWatch on PHP5 with register_long_arrays set to Off in php configuration file.
A quick fix for now is to turn register_long_arrays on in php.ini or in an .htaccess file."

I have tried adding this line into the supplied .htaccess in twatch_include (made no difference) and creating a new .htaccess with the line in twatch (install.php failed to load at all) - did you have to do anything else to get this to work on DH?

Many thanks,

C*


#6

I have a question, I know is dumb but I really don’t have an idea. I want to look my logs but in the log directory I have nothing, is empty. Are those hidden files?


#7

Most of my domains are using PHP4, which doesn’t suffer from this issue, so TraceWatch worked fine.

However, I have installed TraceWatch on a domain using PHP5, but modifying register_long_arrays via the .htaccess file didn’t work for me. I had to create a local install of PHP5 by copying the PHP executable and PHP.INI files to my domain and configuring the .htaccess file (in the domain root) to use the local installation. This procedure is described in the following wiki article.

http://www.wiki.dreamhost.com/index.php/PHP.ini

After copying the files I modified the PHP.INI file to enable register_long_arrays. I didn’t bother with the cron part of the article, as I prefer to update PHP manually every so often by re-copying the files.

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#8

The /logs/ directory should contain a sub-directory for each domain or sub-domain under the control of the user you are currently logged in as. In these sub-directories you will find the logs.

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#9

Thank you Mark, I was looking in other directory.


#10

Thanks Mark-

That makes sense now.

Installing another copy of PHP sounded like it would be way beyond me, but that wiki page makes it sound easy. Think I’ll try it on a test site first to be on the safe side.

Cheers,

C*