The idea about starting your services under Supervisor’s supervision is to be able to run multiple services under a single daemon. Depending on the Supervisor’s configuration it will be able to start,stop or restart any given service as a child process. In this config we show how to runapache2
as supervised service ( useful for docker images etc. ) on Ubuntu/Debian Linux.
First, install supervisor:
# apt-get install supervisor
Include apache2
‘s supervisor configuration into /etc/supervisor/conf.d/
. Supervisor will pick any configuration files from this directory where the only requirement is *.conf
file extension. For example insert a following lines into a new file /etc/supervisor/conf.d/apache2.conf
:
[program:apache2] command=/usr/sbin/apache2ctl -DFOREGROUND