Option 1
Ensure certain traffic goes to a certain server, you can use this:
1 2 3 4 |
<LocationMatch "^/wordpress/wp-admin/?.*> ProxyPreserveHost On ProxyPass http://ip.of.master.server/ </LocationMatch> |
Option 2
Step One: Configure Environment
We need to setup some environment variables to get this to work correctly.
Add the following to your environment on the slave server(s):
RHEL/CentOS: /etc/sysconfig/httpd
1 2 |
OPTIONS="-DSLAVE" export MASTER_SERVER="SERVERIP HERE" |
Ubuntu: /etc/apache2/envvars
1 2 |
OPTIONS="-DSLAVE" export MASTER_SERVER="SERVERIP HERE" |
Step Two: Configure your VirtualHost
In your VirtualHost configuration do something like the following.
1 2 3 4 5 6 7 |
RewriteEngine On ProxyPreserveHost On ProxyPass /wp-admin/ http://${MASTER_SERVER}/wp-admin/ ProxyPassReverse /wp-admin/ http://${MASTER_SERVER}/wp-admin/ RewriteCond %{REQUEST_METHOD} =POST RewriteRule . http://${MASTER_SERVER}%{REQUEST_URI} [P] |