Summary
This documentation is for configuring mojoPortal CMS for Multi-Tenancy using Host Names or Domains. You can also use folders for your Multi-Tenancy configuration.
- Get mojoPortal CMS working properly on the first site (e.g. www.mysite.com).
- Setup IIS to handle requests for the other host name (e.g.: www.myothersite.com) or subdomain (e.g. othersite.mysite.com) you will be using for the second site. See Dedicated IP Address or IIS Host Headers for additional information.
- Configure your DNS server to point the host name of the second site to the same IP address as your first site.
- Make sure the web.config setting AllowMultipleSites is set to true (in the first site).
- Go to Administration > Site List and click the "Create New Site" link.
- Set the Site Title and then click the "Save" button at the bottom of the form.
- After you save the new site, some new tabs appear. Select the Site Mappings tab.
- Enter the host name for the new site and click the Add Host Name button.
- Open another browser window and navigate to the new site using the host name added in the previous step.
Dedicated IP Address or Host Headers?
Hosting multiple sites using host names requires you to have either Host Headers configured or a dedicated IP Address. Regardless of whether or not you are using a dedicated IP address or host headers, all host names that you wish to use with mojoPortal must be set in your DNS server to point to the IP address of the server running your mojoPortal installation. Most web hosts use Host Headers and provide a control panel of some sort to allow you to set them up. If you are running your own server and need help setting it up for either dedicated IP Addresses or Host Headers, please post in our forums or check out the IIS.net website.
When using a dedicated IP address, your IIS site should be configured to handle all requests for that IP Address.
When using IIS Host Headers, your IIS site should be configured to handle requests for each host name you want to use with mojoPortal.
Note: Host Headers are called Bindings in IIS 7 and above.
Considerations for Multiple Physical Web Sites (Multiple Installations of mojoPortal)
If using multiple mojoPortal CMS installations with a single mojoPortal database, configure the second physical web site (installation) with the same database connection string as the first site. The host name you entered for the new site must point to the new site through DNS. mojoPortal uses the host name to determine the siteid from the database; if no host name is configured, the content will appear the same for both sites, since mojoPortal always defaults to the first site when requests arrive from an unconfigured host name.
The first site is the master site as it can control what features are installed in the child sites. If using multiple physical web installations and one database, it is probably best if only the first site has the web.config setting "AllowMultipleSites" set to true.
Testing Multiple Sites on a Development Machine
If you want to test host name based multiple sites on your development machine:
- Get the first site running at http://localhost
- Make sure this key is set to false in Web.config: <add key="UseFoldersInsteadOfHostnamesForMultipleSites" value="false" />
- You can simulate other host names by putting them in your c:\Windows\system32\drivers\etc\hosts file, its just a text file open it with notepad (On Windows Vista and above, you will need to run notepad as Administrator in order to edit this file--find Notepad under programs, then right-click and choose "Run as Administrator"). You will see an existing entry like this:
127.0.0.1 localhost
- You can add as many additional host names as you like:
127.0.0.1 someotherhost1
127.0.0.1 www.myfakesite.com
Created by Joe Davis on May 14, 2007
Last Modified by Joe Davis on Mar 16, 2023