Litespeed and bytes log ( directadmin)

Discussion in 'General' started by gregor, Aug 29, 2012.

  1. gregor

    gregor New Member

    Hello
    as i see Litespeed generates Cpanel log bytes format output
    I use litespeed with directadmin integration and this output shows me gigabates instead of kilobytes..

    -Request in Apache to a site with some text and 28kb image shows output

    1110 331
    29166 338

    29166 /1024 =~ 28,2 KB ,its ok

    -Request in Litespeed to a site with some text and 128kb image shows output

    1346233969 1373 .
    1346233969 131075 .

    1346233969/1024 /1024 .... =~ 1,25 Gb (!)

    So directadmin shows a strange transfer usage...


    how to change it to apache log format, thanks
  2. NiteWave

    NiteWave Administrator

    what's your current bytes log format setting? search "CustomLog" in apache's httpd.conf

    maybe 2nd field "131075" is the image size(128k).
    and the first field is the time stamp.
  3. gregor

    gregor New Member

    my integration with directadmin is not based on apache.conf , i am doing it manually, like adding xml vhost to httpd_config.xml , deleting etc..

    So, i create vhost in litespeed manually
    As you can see i can only set "Log Format" for access log, can not make any modyfication for bytes log format.
    And yes, you are right, the first column is a timestamp , second is a bandwidth log
    how can i delete that timestamp from log or modyfy that log

    Directadmin reads that timestamp as it is a output log
    Last edited: Aug 29, 2012
  4. NiteWave

    NiteWave Administrator

    CPanel compatible bandwidth log format looks to be "%{%s}t %I .\n%{%s}t %O ."

    you are right, for native vhost, the bytes log format is fixed and not customizable.

    can you share what's directadmin's bytes log format?
  5. gregor

    gregor New Member

    in directadmin it looks like :

    LogFormat "%O %I" bytes
    it is hardcored in litespeed configuration or it is able to change somehow?
  6. NiteWave

    NiteWave Administrator

    apparently it's hardcoded at present.
    maybe can add this feature -- will report the request.

    any other issue when you convert directadmin vhost to lsws native vhost?
  7. gregor

    gregor New Member

    for now i found only this one issue
    i have a enterprise 2 cpu license 64bit, it is possible to rebuild a binary for me?

    by the way i would ask about CPU license. I have bought 2 CPU license , but in my opinion it is not a 2 CPU license , it is 2 "worker license", each "worker" is handling static or php request. So logically in huge server load it will be working much better than 1 CPU license.
    I see in system ( mpstat -P ALL) that all my 8 cores are working when handling requsts. :)
    Last edited: Aug 29, 2012
  8. gregor

    gregor New Member

    hello
    any feedback?
  9. NiteWave

    NiteWave Administrator

    I think you can work a quick solution to work around it.

    for example, create a cron job to run every minute, to process the bytes log file created by lsws. here's an example:

    #mv lsws_bytes.log tmp.log
    #your_translate.sh tmp.log > tmp2.log
    #cat tmp2.log >> da_bytes.log
    #rm -f tmp.log
    #rm -f tmp2.log

    da_bytes.log is bytes log format recognized by directadmin

    please first command:
    #mv lsws_bytes.log tmp.log

    this is enough -- in apache, you have to send a signal to apache process, so apache will create new lsws_bytes.log.
    in lsws, just mv it, lsws will create new lsws_bytes.log automatically.

    your understanding regarding license is correct
  10. gregor

    gregor New Member

    hello
    that is an idea. By hosting 1000 domain could be a little problem , but a proper bash script should handle with this.

    Could you add that feature in the next release to choose what bytes log format will be generated in LSWS ?
  11. NiteWave

    NiteWave Administrator

    there is another general way to do it:

    lsws admin console->Configuration->Virtual Hosts: select a vhost

    ->General->Apache Style configurations
    enter
    LogFormat "%O %I" bytes_log_format
    CustomLog /usr/local/lsws/DEFAULT/logs/bytes.log bytes_log_format

    will generate the bytes log file /usr/local/lsws/DEFAULT/logs/bytes.log

    -- tested in my local lsws.
  12. webizen

    webizen New Member

    the latest 4.1.13 supports relative path (to vhost root) for CustomLog, i.e.,

  13. NiteWave

    NiteWave Administrator

    i.e.,
    logs/bytes.log equal to $VH_ROOT/logs/bytes.log

Share This Page