Username Password
Bookmark and Share

One WebGUI Multiple Sites

Typically, each website has its own WebGUI database, but there are some instances where it is advantageous to have ONE webgui database to serve up all your domains. This means that additional sites will be added via the asset manager to your "master site", but accessed through a different domain or subdomain. Here's how:

  1. First, setup your master site (referred to as [MASTER_SITE]) using wreconsole or
  2. Create page layouts for additional sites (referred to as [SUB_SITE]) via the asset manager in [MASTER_SITE]. You may want to change the style or add some custom text to make testing easier. Set meaningful custom URLs for each pagelayout (/site-name) and make note of these.
  3. Add the sub sites as you normally would (via wreconsole or Now we will start customizing.
  4. Delete the database for the [SUB_SITE].
  5. Make the following edits to your [SUB_SITE] modproxy.conf (/data/wre/etc/):

    Set the vhost IP to the server's local IP. The config would not work with *.

    Add the following lines under the block "#deal with port number in HTTP_HOST." Note that the last block replaces the existing "# proxy webgui pages" block.

        RewriteRule ^/$ [MASTER_SITE]/[SUB_SITE]/ [P]
    RewriteRule ^/(.*) [MASTER_SITE]/$1 [P]

    # proxy webgui pages
    RewriteRule ^/(.*) http://[MASTER_SITE]:8081/[SUB_SITE]$1 [P]
  6. Symlink [SUB_SITE]'s public directory (/data/domains/[SUB_SITE]/public) to [MASTER_SITE]'s public directory, otherwise links to images and other uploads will not work as expected.


The WebGUI config file (/data/WebGUI/etc) and modperl config file (/data/wre/etc/) can both be safely removed after the above steps are completed. This will reduce SPECTRE connection errors.

Here is a good forum post with questions and answers about this topic.

Keywords: apache mod_rewrite multi-site rewrite shared WRE

0UMN_law: "I'm trying to get to go to, but retain the address in the browser (both domains resolve to the same IP number).

I've tried the above multi-site configuration, but I keep getting a RewriteRule loop error.  Any ideas/suggestions would be greatly appreciated."
5UMN_law: "We finally found a solution that seems to work for us.  If you already have a configuration for domain1, as above (/data/wre/etc/domain1.modproxy/modperl, /data/WebGUI/etc/domain1.conf), just create a modproxy and modperl file for your domain2, e.g.:


<VirtualHost *:80>

   ServerName domain2
   ServerAlias domain2-alias
   CustomLog /data/domains/path/to/access.log combined
   DocumentRoot /data/domains/domain1/public

   # Turn on mod_rewrite
   RewriteEngine On

   # Rule to append 'index.html' onto base URL with or without "/"
   RewriteRule &#94;(/*)$ /index.html [R]

   # Remove initial /sub-page/ directory, if it exists in URL
   # This can result from navigation links or relative URLs
   ### RewriteCond %{REQUEST_URI} &#94;(/sub-page/)(.*)$
   RewriteCond %{REQUEST_URI} &#94;/sub-page/.*$
   RewriteRule &#94;(.*)/sub-page/(.*)$ $1/$2 [R]

   # Redirect all traffic to domain1/sub-page
   RewriteRule &#94;/(.*) http://domain1/sub-page/$1 [P]

   # (Add other rewrite rules as needed)...

   # deal with port number in HTTP_HOST
   RewriteCond %{HTTP_HOST} :80
   RewriteRule &#94;/(.*) http://%{SERVER_NAME}/$1 [P]

   # proxy webgui pages
   RewriteRule &#94;/(.*) http://%{HTTP_HOST}:8081/$1 [P]



<VirtualHost *:8081>
   ServerName domain2
   ServerAlias domain2-alias
   DocumentRoot /data/domains/domain1/public
   SetHandler perl-script
   PerlInitHandler WebGUI
   PerlSetVar WebguiConfig domain1.conf

You will use the domain1.conf file for your second domain -- do NOT create a config file for domain2!

Restart WebGUI, and you should be good to go.

IMPORTANT NOTE:  Be careful when using relative links in your sub-domain (for images, external documents, etc.).  You may need to convert them to use an absolute address, instead.

If I missed something, or if you have questions, send a note to law-webmaster (at)  -Tim
0UMN_law: "NOTE: The "&#94;" string in our modproxy file, above, is supposed to be an up-arrow or "carat" (if you're familiar with rewrite rules, you'll know what that is)."
Search | Most Popular | Recent Changes | Wiki Home
© 2023 Plain Black Corporation | All Rights Reserved