Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old October 3rd, 2001, 12:27 AM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Changing log file location on shared host

Hi,

Is it possible for me to change the location of the apache access log files on a shared host (ie using .htaccess files perhaps?)?

We're using a host that doesn't backup it's log files til they reach 10MB(!) and attempting to read / check the files on a regular basis gets ridiculous after 1mb (I'm on a 56k link - no telnet access either).

Ideally I'd like to use a PHP script I use on another server to read the log files in a browser, but this just isn't possible because of the size of the log.

Thanks in advance,
Jez

Reply With Quote
  #2  
Old October 3rd, 2001, 12:43 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Is it possible for me to change the location....

No and it's impossible within .htaccess.

>> We're using a host that doesn't backup it's log files til they reach 10MB

Then just don't use that log file. Resource and bandwith is not a problem since you are not running your own server. So write a script and do your own logging.

Reply With Quote
  #3  
Old October 3rd, 2001, 12:57 AM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Cheers freebsd,

You say write a script - you mean the type I could do in php to log all relevant info to db/file?

ahhh (light goes on) ok I'll contemplate it in PHP.

Any pointers/tips/experiences to share?

Reply With Quote
  #4  
Old October 3rd, 2001, 01:45 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Check out env variables -> http://hoohoo.ncsa.uiuc.edu/cgi/env.html

Then check this -> http://httpd.apache.org/docs/mod/mo...ig.html#formats

If there is no cap on your host, just log anything you want to plain-text or db and do all kind of nasty things and utilitize your server resource your account consumes per monthly fee that you pay. Just don't bog down the server.

Reply With Quote
  #5  
Old October 3rd, 2001, 01:58 AM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Ahhh - looks familiar first link

k apache manual... yup do need to rtfm on logfiles...

mmm just one thing - when you said 'write your own script' what did you have in mind?
See I'm thinking I could jsut about manage it all in PHP but this might not be the fastest/easiest solution (don't want it to impact on the download time for a page request at the client end, plus the hassles of having to 'prepend' the logfile script to each file requested) - is there any other alternative at all apart from having a script execute on each and every request made for files on the server?

Reply With Quote
  #6  
Old October 3rd, 2001, 02:17 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
But you have no other alternatives. If you don't have access to httpd.conf, .htaccess can't do it. It must be done with your script, PHP or CGI doesn't matter.

>> the hassles of having to 'prepend' the logfile script to each file requested

Your host probably is doing multiple logging mechanism anyway. So adding your own script and perform additional logging mechanism might not be too significant, unless your host has a poor system/backend in the first place.

Reply With Quote
  #7  
Old October 3rd, 2001, 01:00 PM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Ok, thanks for that.

I think I'll create a php request logging script and have it called each time a request is made for any file on the site by setting the 'prepend_file' php.ini file option in the site's config include file (using ini_set()). Sounds like it might be doable without too much problem.

Thanks for the advice.

Reply With Quote
  #8  
Old October 3rd, 2001, 05:31 PM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Ok, all is going well with this custom log filer PHP script - up until the point where the apache log module would log the HTTP request status to the log file normally (200/304/404 etc).

Obviously I cannot get at the status information in the case that the request was anything other than '200' (since the script is only called/included if the request was successful). Any ideas on logging HTTP requests of status other than just success using custom scripting? Intuitively it doesn't seem it would be possible - is this the case? Or are there any hacks which might be applicable?

Thanks in advance,
Jez

Last edited by munkfish : October 3rd, 2001 at 05:34 PM.

Reply With Quote
  #9  
Old October 3rd, 2001, 08:07 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Obviously I cannot get at the status information in the case that the request was anything other than '200'

Why not? If your host allows you to use your customized ErrorDocument, then it's more than possible.
Have you ever wondered why it's named ErrorDocument instead of HTTP_RESPONSE_STATUS_ROUTINE?
It's just because you DON'T set 200 status to ErrorDocument in most case. But technically it's possible to set something like this:

ErrorDocument 200 /path/to/error.php

So just set up 304, 404, 403 or whatever with another script.

Reply With Quote
  #10  
Old October 4th, 2001, 02:59 PM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
doh - of course - many thanks I'll get on and set it up.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Changing log file location on shared host


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway