0

I am working in a Docker container that so far have the following ready to go:

  • CentOS 6 (latest, I think is 6.9)
  • Apache 2.2.15 (latest on CentOS6 repositories)
  • PHP 5.3.3 (latest on CentOS6 repositories)
  • Supervisord 3.3.3

I am stolen the idea from this nginx.conf where they are listening using inotify for changes (create,delete,modify,move,attrib) at /etc/nginx/ and /data/conf/nginx/ and if this happen then Supervisord automatically reload Nginx. This will allow me to forget about be restarting Apache (if it's possible because my experience with Docker is when I bash into the container and execute service httpd restart the container exit out) and/or be stopping/building/starting the container each time I want to add a new VH to Apache.

Having said that I am looking for some help with this line:

[program:nginx-reload]
command=bash -c 'while inotifywait -q -r -e create,delete,modify,move,attrib --exclude "/\." /etc/nginx/ /data/conf/nginx/; do nginx -t && nginx -s reload; done'

Since I am not sure how to write that for achieve the same using httpd. Can any give me some help?

1 Answer 1

0

Program for supervisord should be like the following:

[program:httpd-reload]
command=bash -c 'while inotifywait -q -r -e create,delete,modify,move,attrib --exclude "/\." /etc/httpd/ /data/conf/httpd/; do apachectl -t && service httpd restart; done'

Note logs location, you may need exclude it too by adding one more --exclude "/etc/httpd/logs" or path where logs are located.

1
  • Cool I'll give a try later today and will let you know
    – ReynierPM
    Jan 26, 2018 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .