After playing around with wordpress for a week I finally figured out how to get it working behind a reverse proxy with Apache between 2 machines. In this scenario SERVER A is connected to the internet, while SERVER B is on the local intranet only.
Step 1: Apache modifications on the internet facing box (SERVER A)
1 2 3 4 5 6 7 8 | <VirtualHost *:80> UseCanonicalName Off RewriteEngine On ServerName www.lamolabs.org RewriteRule ^/blog/(.*) http://machineB/blog/$1 [P,L] ProxyPassReverse /blog/ http://machineB/blog/ </VirtualHost> |
1 | % /etc/init.d/httpd reload |
Step 2: Apache modifications on the intranet box (SERVER B)
NOTE: wordpress is installed under “/var/www/html/apps/wordpress/current” on SERVER B
1 2 3 4 5 6 7 8 | <VirtualHost *:80> UseCanonicalName off ServerName www.lamolabs.org ServerAlias machineB RewriteEngine on RewriteRule ^/blog/(.*) /apps/wordpress/current/$1 [L] </VirtualHost> |
1 | % /etc/init.d/httpd reload |
Step 3: Configure Wordpress
- first login to …/wp-admin/
- click on Settings -> General
- change the Wordpress address (URL) to “http://www.lamolabs.org/blog”
- change the the Blog address (URL) to “http://www.lamolabs.org/blog”
- click on Settings -> Permalinks
- change to the Custom Structure and set it to “/%post_id%/%postname%/”
- Save Settings
Should now be able to access the wordpress blog at lamolab’s blog
