|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Thanks ... it worked :-)
I was pasting the single line in pico ant it splitted automatically in two lines... |
|
#4
|
|||
|
|||
|
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 :-) |
|
#5
|
|||
|
|||
|
>> 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 |
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
>> 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. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Help to configure httpd.conf to create the mod_gzip Logfile |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|