Project

General

Profile

Bug #257

Web Server Configuration Mismatch Across Nodes Causing Broken Sites

Added by Daniel Curtis about 11 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Server
Target version:
-
Start date:
12/04/2013
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

I encountered a problem where one of my hosted web sites would periodically fail to load and display errors. I managed to track the problem down, when I make changes to web sites in ISPConfig it makes changes to the primary web node, but not to the other worker nodes that are set as mirrors of the primary web node. To work around this until a more appropriate solution can be created, I have made a script to synchronize the available websites on the primary node.

#!/bin/bash
# Script to synchronize the primary web nodes available web sites to  listed servers, then restart the web server

hosts="web-node2 web-node3 web-node4";

# Run rsync of available each website on web server node, then restart web server
for i in $hosts;
do
  echo $i;
  rsync -avh /etc/apache2/sites-available/ -e ssh $i:/etc/apache2/sites-available/
  ssh $i service apache2 restart
done;

I ran the script on the primary web nodes, and the problem was solved.

Note: As the web services grow, I may need to mount this as an NFS share.

#1

Updated by Daniel Curtis almost 10 years ago

  • Project changed from 40 to GNU/Linux Administration
  • Category set to Web Server

Also available in: Atom PDF