High Availabilty, Virtualmin with Multiple Servers

I am wondering if their is a way to have virtualmin manage a multi-server setup.

For example, I have two identical servers. I would like to load balance web, dns, and email between them. The ideal usage would be that I sign on to virtualmin, create a virtual server and it is automatically setup on both servers, email is properly synced between the two, DNS, and web. Should one server go down, the other server can provide un-interrupted service.


That’s a long list, by itself. :slight_smile:

First, I’d go with a shared MySQL and/or PostgreSQL server, if you plan to have either. I usually keep my SQL servers off the webservers. Here’s some good documentation on that:

For shared users, use LDAP. You can get some good documentation about the subject here:

I personally only used the portion mainly about the actual virtuamin side of the setup, especially for postfix.

For the /home mount, use shared storage such as NFS. With NFSv3 over udp mounting a floating IP of two servers that replicate and provide NFS, wether that’s using glusterfs or DRBD, or some other kind of SAN, your choice, you can provide failover-capable NFS by this means.

As for syncing configurations, I use unison to sync /etc/webmin/virtual* directories to both sides, as well as /etc/apache/sites-enabled, /etc/apache/sites-available, /etc/postfix, and even the stuff for bind.

After all that, it’s a matter of setting up init.d scripts to start and stop both webservers, dns servers, mail servers, etc. I use my own wrapper script that basically looks something like:

Apache Example:


case $1 in
stop | status)
ssh root@node2 /etc/init.d/apache2 $1
/etc/init.d/apache2 $1
start | graceful | reload | force-reload | restart | start-htcacheclean | stop-htcacheclean)
ssh root@node2 /etc/init.d/apache2 $1
/etc/init.d/apache2 $1
log_success_msg “Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}”
exit 1

The only issues I’m having with this setup at all is the IP configurations. I’m using a public internet IP through ldirectord for LVS masquerading directing to LAN IP’s. When I do that, the webservers are on different IP’s on the LAN so I;m having difficulty getting them to respond to name-based virtual-hosting as expected by the way virtualmin wants to do things.

So if anyone has any ideas to resolve that issue, I’d be very welcome to the input as well. :slight_smile:

One of my tested solutions ended up working.

Instead of allowing virtualmin to “autodetect” the IP, I set the IP in:

Virtualmin -> System Settings -> Module Config -> Network Settings: Default virtual server IP address = *

Instead setting a specific IP, * works. Do make sure your external IP elsewhere is setup appropriately for DNS and the likes however. So far this /appears/ to only effect Apache settings otherwise. Dirty hack IMHO, may break other things, but for my purpose it’s working so far.

This will work as long as all virtual servers are using * and are available on all IP addresses.

It can work when using different IP addresses, but it gets very challenging to understand how Apache will select which virtual server to serve, and it’s definitely not intuitive. Pretty much everybody gets it wrong, and comes here confused about why the wrong site keeps showing up, so I pretty much say, “Never do that”.

BTW-Thanks for describing your setup. It’s solid, and is about the most straightforward way to accomplish most of these tasks.

Hi erenfro
I hope you are still there !
How do you hanle the quota on the NFS share for virtualmin?