Project

General

Profile

Lighttpd not logging images and css and others

Added by tkeyser over 15 years ago

Just started moving domains on to the machine and notice that no images or css are being logged to the accesslog. GETs for .txt and .gz are being logged. Any idea what I have setup wrong, or have I found a bug or special condition based on my config.

I'm running

Linux 2.6.18-128.4.1.el5.centos.plus #1 SMP Thu Aug 6 11:04:26 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

lighttpd-1.4.21 - a light and fast webserver
Build-Date: Aug 26 2009 13:45:59

PHP 5.2.6 (cli) (built: Sep  4 2009 16:19:26)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with XCache v1.2.2, Copyright (c) 2005-2007, by mOo


my config is
##########################################################
# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules              = (
                               "mod_rewrite",
                               "mod_redirect",
                               "mod_alias",
                                "mod_access",
#                               "mod_cml",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
                               "mod_status",
#                               "mod_setenv",
                               "mod_fastcgi",
#                               "mod_proxy",
#                               "mod_simple_vhost",
                               "mod_evhost",
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
                               "mod_deflate",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )

server.document-root        = "/var/www/vhosts/default/htdocs/" 

server.errorlog             = "/var/log/lighttpd/error.log" 

index-file.names            = ( "index.php", "index.html",
                                "index.htm", "default.htm" )
server.follow-symlink = "enable" 

# mimetype mapping
mimetype.assign             = (
  ".rpm"          =>      "application/x-rpm",
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "application/ogg",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jar"          =>      "application/x-java-archive",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv",
  ".bz2"          =>      "application/x-bzip",
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar",
  # default mime type
  ""              =>      "application/octet-stream",
 )

$HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
  server.max-keep-alive-requests = 0
}

#### accesslog module
accesslog.filename          = "/var/log/lighttpd/access.log" 
accesslog.format = "%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" 

url.access-deny             = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
  server.range-requests = "disable" 
}

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".cgi" )

## to help the rc.scripts
server.pid-file            = "/var/run/lighttpd.pid" 

## change uid to <uid> (default: don't care)
server.username            = "lighttpd" 

## change uid to <uid> (default: don't care)
server.groupname           = "lighttpd" 

##################################################
# our fastcgi.server configuration
#
# since we are using xcache we need to limit ourselves to
# one proc 'max-procs' = 1 . ( each proc has an independent cache )
#
# Memory usage for 100 processes or threads should be
# num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN ).
# Each PHP-cgi has 671816 virtual and estimated 13M resident
# including xcache configured at 448M
#
# (13MB * 101 processes) + 672M Virtual = 1,985MB RAM (2GB)
# at full throttle
#

  fastcgi.server = ( ".php" =>
      ( "localhost" =>
        (
          "socket" => "/tmp/php-fastcgi.socket",
          "bin-path" => "/usr/bin/php-cgi",
          "max-procs" => 1,
          "bin-environment" => 
          (
              "PHP_FCGI_CHILDREN" => "100",
              "PHP_FCGI_MAX_REQUESTS" => "500" 
          ),
          "broken-scriptfilename" => "enable" 
        )
      )
  )

######################################################
#### status module
status.status-url          = "/server-status" 
status.config-url          = "/server-config" 
status.statistics-url = "/server-counters" 

#### mod_deflate
deflate.enabled = "enable" 
deflate.compression-level = 9
deflate.mem-level = 9
deflate.window-size = 15
# deflate.bzip2 only in patch for 1.4.x
deflate.bzip2 = "enable" 
# deflate.allowed_encodings only in 1.5.x
#deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
deflate.min-compress-size = 200
deflate.sync-flush = "enable" 
deflate.output-buffer-size = 8192
deflate.work-block-size = 512
deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
#deflate.debug = "enable" 

alias.url += ("/xcache-admin/" => "/var/www/vhosts/default/xcache-1.2.2/admin/")
## include configuration snippets, usually provided by packages
include_shell "find /etc/lighttpd/conf.d -maxdepth 1 -name '*.conf' -exec cat {} \;" 

## base file for vhost domains by user

$HTTP["host"] =~ "(^|\.)xxxxxxx.com" {
  # redirect WWW to base domain
  $HTTP["host"] =~ "^www\.(.*)" {
    url.redirect = ( "^/(.*)" => "http://%1/$1" )
  }
  # otherwise set us up to execute
  var.servername              = "xxxxx.com" 
  var.webowner                = "zzzzz" 
  accesslog.filename          = "/var/log/lighttpd/"+servername+"/access.log" 
#  server.errorlog            = "/var/log/lighttpd/"+servername+"/error.log" 
  evhost.path-pattern         = "/var/www/vhosts/"+webowner+"/%3.%0/htdocs/" 
  alias.url += ("/favicon.ico" => "/var/www/vhosts/default/htdocs/favicon.ico")
  alias.url += ("/robots.txt" => "/var/www/vhosts/default/htdocs/robots.txt")
  alias.url += ("/default/htdocs/wp-includes/" => "/var/www/vhosts/default/htdocs/wp-includes/")
  alias.url += ("/default/htdocs/test/wp-includes/" => "var/www/vhosts/default/htdocs/test/wp-includes/")
  alias.url += ("/default/htdocs/wp-2-7-1/wp-includes/" => "/var/www/vhosts/default/htdocs/wp-2-7-1/wp-includes/")
}


Replies (6)

RE: Lighttpd not logging images and css and others - Added by nitrox over 15 years ago

first, your php config is somewhat overdoze, 100 children is insane, use e.g. 8.
include_shell might include other settings, interfering with your logging and wordpress might handle inclusion of files in its own way, not sure about that tho.
is it with every file of the mentioned ones no matter at what vhost or dir the files are?

mod_deflate on lighttpd 1.4? It wouldn´t even start if not modified, so if your lighty is a heavily patched one, use the official releases!

RE: Lighttpd not logging images and css and others - Added by tkeyser over 15 years ago

Im using

840950 Feb 16  2009 lighttpd-1.4.21.tar.gz
67611 Mar 7 2009 lighttpd-1.4.21.mod_deflate.patch

The include_shell is only including what wa shown below it.

## base file for vhost domains by user

$HTTP["host"] =~ "(^|\.)xxxxxxx.com" {
  # redirect WWW to base domain
  $HTTP["host"] =~ "^www\.(.*)" {
    url.redirect = ( "^/(.*)" => "http://%1/$1" )
  }
  # otherwise set us up to execute
  var.servername              = "xxxxx.com" 
  var.webowner                = "zzzzz" 
  accesslog.filename          = "/var/log/lighttpd/"+servername+"/access.log" 
#  server.errorlog            = "/var/log/lighttpd/"+servername+"/error.log" 
  evhost.path-pattern         = "/var/www/vhosts/"+webowner+"/%3.%0/htdocs/" 
  alias.url += ("/favicon.ico" => "/var/www/vhosts/default/htdocs/favicon.ico")
  alias.url += ("/robots.txt" => "/var/www/vhosts/default/htdocs/robots.txt")
  alias.url += ("/default/htdocs/wp-includes/" => "/var/www/vhosts/default/htdocs/wp-includes/")
  alias.url += ("/default/htdocs/test/wp-includes/" => "var/www/vhosts/default/htdocs/test/wp-includes/")
  alias.url += ("/default/htdocs/wp-2-7-1/wp-includes/" => "/var/www/vhosts/default/htdocs/wp-2-7-1/wp-includes/")
}

This is my first time building or using lighty. Thanks for the tip on the php children. This machine will be running about 700 blogs, but I can bump it later if need be.

Im moving these domains from another machine that's using apache. All GETS for image files, and css files are being logged on that machine. So, this has nothing to do with wordpress. wordpress is just php and not doing anything that tricky.

Is it possible that this is caused by the mod_deflate patch? I could understand this with .css files being missing from the log but robot.txt files are showing up in the logs. Also, mod_deflate is not deflating image files so I would expect them to show in the logs.

Can anyone confirm this condition using mod_deflate patch?

I'm going to turn on debug for mod_deflate and try to track its operations. Wondering if anything mod_deflate touches doesn't get logged?

RE: Lighttpd not logging images and css and others - Added by nitrox over 15 years ago

If you need deflate, use lighttpd 1.5. You won´t have any drawbacks on stability or otherwise, might even work a little better due to mod_proxy_core.

RE: Lighttpd not logging images and css and others - Added by tkeyser over 15 years ago

Hmmm, obviously with 700 blogs I need deflate, but 1.5 is still in pre-release correct?

I need this server to be reliable enough to run 700 blogs. Not sure moving to a pre-release would be a prudent move?

Do you need beta tester that bad, or are you that convinced of 1.5 stability?

RE: Lighttpd not logging images and css and others - Added by tkeyser over 15 years ago

Interesting, I downloaded lighttpd-1.5.0-r1992.tar.gz and installed it on a machine with my currently functioning 1.4.21 config file.

And what do I get?

configfile-glue.c.169: (error) found deprecated key in 'fastcgi.server' = 'it is replaced by mod_proxy_core and mod_proxy_backend_fastcgi'

WTF... I read all the doc files... in the .doc dir..... What the hell does this mean? Where is the documentation that explains this. If your going to totally redesign a feature as critical as fastcgi, you should take the time to write a doc on it and include it in the download.. where is the documentation on mod_proxy_core and mod_proxy_backend_fastcgi? And can you be less clear on what is depreciated?

I heard that your documentation was poor, but one would expect that by version 1.5, you would have learned something.

RE: Lighttpd not logging images and css and others - Added by nitrox over 15 years ago

1) 1.5-r1992 is ooold, its really outdated
2) 1.5 is not released, thus lacking functions, documentations and other things
3) as it lacks some stuff 1.4.x might have, it has also its strengths, among some are mod_deflate and mod_proxy_core*

configfile-glue.c.169: (error) found deprecated key in 'fastcgi.server' = 'it is replaced by mod_proxy_core and mod_proxy_backend_fastcgi'
4) I pointed you to that one already, and it is very clear, else search the wiki
If you need deflate, use lighttpd 1.5. You won´t have any drawbacks on stability or otherwise, might even work a little better due to mod_proxy_core.

5) You already found this forum, the wiki isn´t far away, beside that please file a bug if search isn´t working for you
6) The wiki is the documentation. As it is a wiki, add/change what you think is missing/not clear

I heard that your documentation was poor, but one would expect that by version 1.5, you would have learned something.
7) 1.5 is no official release, the documentation is user-contributed, learn to use the information already out there

8) We use 1.5 for years now on lighttpd.net as we believe in its stability (but thats not a guarantee, neither there is one for 1.4.x)

Before you rant next time, make yourself a picture please! And beside that we are on #lighttpd at irc.freenode.net.

    (1-6/6)