Forum Moderators: phranque

Message Too Old, No Replies

filtering localhost hits in apache 2.xx log file

apache for windoz

         

teddyearp

2:45 am on Jul 11, 2008 (gmt 0)

10+ Year Member



OK, it's about time I joined this site. I have been running apache 2.xx under windoz xp pro for about a year now, and used to use static editors for my webpages. Now I'm using Joomla! for my personal website.

BUT, whenever I go to edit my site my apache log file fills up very quickly with all the 'hits' from 'localhost' (i.e.127.0.0.1) So, I have searched how to filter the 'localhost' requests out of my log file and so far all I've done to my httpd.conf file is add this line: SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog. But obviously I haven't figured out the rest of this env variable. So, give a new guy a break, what more do I need to do?

Many thanks in advance,

The new guy.

jdMorgan

11:13 pm on Jul 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your SetEnvIf seems sufficient, although you might also want to add 'SetEnvIf Host "localhost" dontlog' as well.

Take a look at the description of conditional logging in Apache mod_log_config for info on how to use your "dontlog" variable to control logging.

Jim

teddyearp

1:29 am on Jul 12, 2008 (gmt 0)

10+ Year Member



Yeah, I thought so too, but actually I am not totally as intensly knowledgeable about the ins and outs of apache as I probably should be. I have been basically plugging along by the seat of my pants.

So, that being the case, I did add the line you suggested, and then logging into my site and still filled up my log file with hits from 127.0.0.1. Now be nice to the new guy, please.

Thanks in advance

jdMorgan

2:51 pm on Jul 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Be nice to the new guy:

OK, it's time for 'tough love,' then...

You cannot expect to be successful and avoid major problems by "plugging along by the seat of your pants." While you may get away with it for awhile, and think yourself successful, somewhere down the line, a major problem cause by a lack of knowledge is likely to take a huge bite out of the back of those pants. Read some of the threads here about dynamic URL ranking problems, canonical domain problems causing duplicate-content issues, incorrectly-coded ErrorDocument declarations destroying search listings, rewriterule ordering errors 'exposing' internal script URLs to search engines (that last one just today).

So, being 'nice,' I'd say, "Go to the Apache site, print out all of the documentation related to all of the directives you find in your server config files and .htaccess files, and read it -- all of it." I have kept a copy of this documentation adjacent to a certain "porcelain seat" in a small room in my house, and I open it to a random page and re-read it very often. After years, I still find newly-meaningful information...

In this case, a review of mod_log_config is in order.

(Reading the documentation is akin to reading Scientific American and similar journals -- At first, it may make little sense, but after awhile, things start to tie together and you get much more out of it.)

Avoid torpedoing your own success by trying to take shortcuts. The Web is *not* simple, creating and administrating successful sites is *not* easy, and servers are *not* something you can simply 'set and forget' -- all of the 'Free and easy Website creator' programs notwithstanding... It is possible to make a very good living simply fixing the common errors that destroy otherwise good Web sites. ;)

And that is the "nice" answer.

Jim

teddyearp

12:58 am on Jul 13, 2008 (gmt 0)

10+ Year Member



Thank you Jim for the nice answer. I did find that although I had set the variable properly like you said in your first reply, I had not yet applied said variable at all in my CustomLog directive. So, if I can find a way to mark this thread as 'Solved' I will.

Also, I will take your advise about printing out all of the Apache documentation as you have for future reference. I have only been running this little server of mine for less than a year and realize that my knowledge is probably light years behind anyone else here, so thank you for being nice to me, or giving me the tough love.

I will now respectfully close and do the above things and probably not ask any more questions here until I can get my knowledge more up to par with this site.

Thanks again,

Ted

p.s. Maybe plugging along using 'baby steps' would have been more appropriate that 'seat of my pants'.

jdMorgan

1:17 am on Jul 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> and probably not ask any more questions here until I can get my knowledge more up to par with this site.

Ask all you want if you can't find the answer in the docs -- but don't think we have all the answers. It seems to me that everyone here is an expert in something, but not everything. I think of the phrase, "Experience is what allows you to recognize a mistake... when you make it again." ;)

Jim