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:
  #1  
Old August 24th, 2001, 02:02 AM
jaume44 jaume44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Spain
Posts: 6 jaume44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow Help to configure httpd.conf to create the mod_gzip Logfile

Help to configure httpd.conf to create the mod_gzip Logfile
Hello,

I have installed mod_gzip in my raq4 and it works ok.

I just can't configure httpd.conf to generate the log for mod_gzip.

I add in httpd.conf:

LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2
CustomLog /var/log/httpd/mod_gzip_log common_with_mod_gzip_info2


But I always get the same error when I try to restart Apache:

Syntax error on line 149 of /etc/httpd/conf/httpd.conf:
Invalid command 'Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct."', perhaps mis-spelled or defined by a module not included in the server configuration

What am I doing wrong?

where do I have exactly to place the "Logformat ...etc" in httpd.conf?

anybody had this problem?

Thanks.


__________________
Jaime

Reply With Quote
  #2  
Old August 24th, 2001, 02:28 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
I haven't tried mod_gzip. From your error log, it tells me you splitted the single line to two lines without slash.

Your line should be:

LogFormat "%h %....Out:%...ssion_ratio}npct." common_with_mod_gzip_info2

Note, I use .... just to shorten the line so you can see they are on the same line here.

You can also break that long line into two lines in httpd.conf like so:

LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n \
Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2

Reply With Quote
  #3  
Old August 24th, 2001, 02:51 AM
jaume44 jaume44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Spain
Posts: 6 jaume44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks ... it worked :-)

I was pasting the single line in pico ant it splitted automatically in two lines...

Reply With Quote
  #4  
Old August 24th, 2001, 10:39 AM
jaume44 jaume44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Spain
Posts: 6 jaume44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi again,

Excuse me if I ask some basic questions but that's because I have just started with the Apache webserver and Linux.

Now that I have mod_gzip and mgstats working Ok on my box, I see that the mod_gzip_log is growing damn fast...

I would like to know how can I rotate this log at least twice a day.

Also I would like to know how can I just reset it.
What I do now is Stop Apache and reset it manually, then restart apache.

thanks for your help :-)

Reply With Quote
  #5  
Old August 24th, 2001, 06:01 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
>> I would like to know how can I rotate this log at least twice a day

There are too many ways to do it. You can use newsyslog, check /etc/newsyslog.conf for details. Personally, I use my very own script. There are many people out there using cronolog -> http://www.ford-mason.co.uk/resources/cronolog/

Say cronolog, to rotate /var/log/httpd/access_log once a day:

LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n \
Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct."
TransferLog "|/usr/local/sbin/cronolog /var/log/httpd/%Y/%m/%d/access_log"


- The location becomes /var/log/httpd/2001/08/24/access_log
- cronolog runs as a standalone process in background so when it's time for rotation, it will restart httpd automatically

Reply With Quote
  #6  
Old August 27th, 2001, 06:23 AM
jaume44 jaume44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Spain
Posts: 6 jaume44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Finally I used logrotate.
I placed a file called modgzip_rot in the /etc/logrotate.d

/var/log/httpd/mod_gzip.log {
missingok
compress
size 100M
}


When the mod_gzip.log reaches 100 mb it's rotated and reseted to 0 kb's but it does not log. It remains 0 kb's.

I delete mod_gzip.log restart apache and it is regenerated and logging again.

Can I do something to avoid stopping and restarting apache after the mod_gzip.log rotation?

Reply With Quote
  #7  
Old August 27th, 2001, 07:22 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
>> Can I do something to avoid stopping and restarting apache after the mod_gzip.log rotation?

No. You also can't manually rotating your mod_gzip.log this way:
cp -Rp mod_gzip.log /other/path/to/mod_gzip.log
cat /dev/null > mod_gzip.log

While Apache is running, if you alter the log file in any ways, Apache will no longer write to that file. You must HUP it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Help to configure httpd.conf to create the mod_gzip Logfile


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 5 hosted by Hostway
Stay green...Green IT