I want to replicate my virtual machine and put it behind a load balancer.
Apache1 Apache2 ....ApacheN | | | ------------------------- LoadBalancer
I'd like to use only ONE configuration file for virtual hosts (actually a directory of conf files with Include in each httpd.conf), ONE log file and a common DocumentRoot directory for all instances.
Is that possible, just sharing some directory between the virtual machines and configuring each Apache accordingly?
Or there will be some conflict with file opening and writing?
Is there maybe a better way of maintaining all the machines with the same configuration?
The only other thing I can think of, it's a script that copies a master configuration and restarts all the Apache instances. And also some script to merge all the logs…
Any suggestion welcome.
UPDATE: I thought that in my case performance was not an issue, but I stopped writing to the same log file from two instances, when I started to notice log corruption.
[04/Oct/2014:17:10:34 +0200] "GET /index.html HTTP/1.0" 200 15082 22633 [04/Oct/2014:17:10:36 +0200] "GET /index.html HTTP/1.0" 200 15082 13[04/Oct/2014:17:10:38 +0200] "GET /index.html HTTP/1.0"[04/Oct/[04/Oct/2014:17:10:40 +0200] "GET /index.[04/Oct/2014:17:09:42[04/Oct/2014:17:10:42 +0200][04/Oct/2014:17:09:44 +0200] "GET /index.html HTTP/1.0" 200 15082