spujadas / lighttpd-docker

Docker image for lighttpd, a secure, fast, compliant, and flexible web server
MIT License
59 stars 65 forks source link

restarting the server #15

Closed soydepr closed 4 years ago

soydepr commented 4 years ago

not able to restart the server forcing me to restart the image everytime i change something in the log

i want to log to server.error.log to /var/log/lighttpd/error.log

/var/log # /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf restart 2020-03-16 22:55:02: (network.c.307) can't bind to socket: 0.0.0.0:80 Address in use

spujadas commented 4 years ago

not able to restart the server forcing me to restart the image everytime i change something in the log

Not really an issue as containers should be considered immutable according to current best practices (see e.g. https://cloud.google.com/solutions/best-practices-for-operating-containers#immutability).

/var/log # /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf restart

This can't work because there is no restart command for lighttpd, so this command is starting a new lighttpd process, which fails because one is already running and bound to port 80. You would have to use SIGHUP to gracefully restart lighttpd (http://blog.lighttpd.net/articles/2007/09/02/there-is-an-angel-for-lighty/). I would however strongly advise against doing this to adhere to the immutability principle: you should instead modify the conf file on the host, bind-mount it to the container or add it to the image, and then start the container.