I am running lighttpd
in a docker container on Ubuntu (as a service that must always be up in my traefik
setup). My docker-compose.yml
contains:
lighttpd:
image: sebp/lighttpd
container_name: lighttpd
restart: unless-stopped
volumes:
- /srv/docker/traefik/lighttpd/etc/lighttpd.conf:/etc/lighttpd/lighttpd.conf
- /srv/docker/traefik/lighttpd/log/error.log:/var/log/lighttpd/error.log
- /srv/docker/traefik/lighttpd/log/access.log:/var/log/lighttpd/access.log
- /var/www/miniserver/html/:/var/www/html/
ports:
- "80"
tty: true
labels:
- "traefik.enable=true"
- "traefik.http.routers.lighttpd.rule=Host(`foo.rna.nl`)"
- "traefik.http.routers.lighttpd.entrypoints=web"
- "traefik.http.routers.lighttpd.tls=false"
networks:
- proxy
lighttpd
works, serves me index.html
, but:
# docker logs lighttpd
2022-10-29 12:13:55: (server.c.1568) server started (lighttpd/1.4.64)
I get the startup message, but nothing else. When I direct access log to a file, I get access log entries there:
172.26.0.2 foo.rna.nl - [29/Oct/2022:11:53:02 +0000] "GET /index.html HTTP/1.1" 200 37 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
How do I direct lighttpd
's access log to stdout? I tried both of these:
accesslog.filename = "/proc/self/fd/1"
accesslog.filename = "/dev/stdout"
My full lighttpd.conf
:
server.modules = (
"mod_indexfile",
"mod_access",
"mod_alias",
"mod_redirect",
"mod_accesslog",
)
server.document-root = "/var/www/html"
#server.errorlog = "/var/log/lighttpd/error.log"
server.port = 80
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
accesslog.filename = "/proc/self/fd/1"
#accesslog.filename = "/dev/stdout"
#accesslog.filename = "/var/log/lighttpd/access.log"