Medium Trust, Multiple installations of mojoportal, one database

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/16/2012 3:23:12 PM
Gravatar
Total Posts 40

Medium Trust, Multiple installations of mojoportal, one database

Hi. I'm new to this forum and would just like to say how impressed I've been with the whole mojoPortal experience so far! I have only tried mojoPortal recently since it was featured in a newsletter from my web host Pipeten. I managed to make a single-site install using 2-3-9-0-mssql-net40 and everything worked absolutely fine!I even managed to upgrade to 2-3-9-3-mssql-net40 without any problems!
My next task was to try to add another site. Because of webhosting restrictions I am running in Medium Trust, so I understand that I can't run multiple sites on a single web installation. My intention is to run multiple installations of mojoPortal on different domains, but use just one MSSQL database.
My first attempt didn't go so well & I just ended up with the second site displaying the content of the main site. In trying to get things sorted I somehow caused errors on the server & pipeten automatically pulled my main site down. Luckily both sites were 'trials', so I'm probably best wiping the database & starting from scratch.

The documentation states the following:

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.

Can I confirm that I understand this correctly? Once I have set up the first site correctly, if I want to add another installation on a separate domain this is the order I do things:

1. Add a new site via the admin panel of the first site.
2. When the site is added I go to the Host Name Mapping tab & 'Add Host Name' for the new domain (do I need the www. at the beginning?).
3. Then I ftp the new installation onto the new domain (with the correct config settings etc).
4. Then I run setup on the new installation & because I set the domain in the Host Mapping on the main site it recognises the domain & starts a new site instance in the database?

I'm thinking that my mistake was running setup before doing the Host Mapping.

Does this sound right, or am I missing something?

Thanks,

Craig

10/17/2012 8:57:22 AM
Gravatar
Total Posts 18439

Re: Medium Trust, Multiple installations of mojoportal, one database

As long as your are using .NET 4 there should not be any problem running multiple sites in a single installation of mojoPortal under medium trust.

For host name based sites you do need the ability to point more host name to the ip address, and if it is not a dedicated ip address you would also need to be able to add IIS host headers so that the hostname/domain names all resolve to the same IIS site.

If you don't have those abilities then you still could easily do folder based sites.

Hope that helps,

Joe

10/17/2012 9:04:55 AM
Gravatar
Total Posts 18439

Re: Medium Trust, Multiple installations of mojoportal, one database

Regarding your question about whether you need www, there is a good explanation about host names in the first section of the article Adding a Host Name to the Hosts file for Local Testing

The short answer is the www.somdomain.com and somedomain.com are just host names, you can create as many host names for a given domain as you like using DNS A records like foo1.somedomain.com foo2.somedomain.com whatever.somedomain.com

But for a given site it is better for SEO to pick one and force a specific host name

Hope that helps,

Joe

10/17/2012 3:36:24 PM
Gravatar
Total Posts 40

Re: Medium Trust, Multiple installations of mojoportal, one database

Hi Joe and thank you very much for your reply. I am running .Net4, so hopefully I'll be able to get things sorted. I'm getting slightly out of my depth with regards IIS Host Headers, as this is something that I haven't played with before...

My web hosting account with pipeten is on a shared IP address, so I guess that this is the way that I need to go. The DNS for the second site is already set to the pipeten nameservers, but I'm not sure what I have to do to set the Host Headers. I'll do some research & see if I can figure it out!

The bit about the different host names & using the 'force a specific host name' makes sense - thanks.

Thanks again for your time.

Regards,

Craig

10/18/2012 8:46:16 AM
Gravatar
Total Posts 40

Re: Medium Trust, Multiple installations of mojoportal, one database

OK, I've managed to get myself slightly confused now!

Having checked with my webhost (Pipeten) it appears that modifying Host Headers is achieved by adding a Domain Alias within the Pipeten control panel. Say for example if I had domain2.com I would set up an alias to my main site domain1.com. This would mean that any requests to domain2.com would automatically be routed to my domain1.com installation (ie I wouldn't need a separate mojoPortal installation on domain2.com?). So long as I have the Host Name correctly configured via the admin page on site1 the domain name would be recognised & site2 content would be displayed.

Do I understand from your comment that multisites on a single installation is now possible on Medium Trust with .NET 4?

It is also my understanding that folder based sites for multiple installations is only possible when using child folders on the original domain (eg domain1/site2/default.aspx).

Say that I would prefer to run separate installation of mojoPortal on different physical domains (one reason why I would like to do this is so that I can also have non-mojoportal content on these domains). Is this possible?

ie     domain1.com    -> Main site running mojoPortal installation 1 (multisite true)
        domain2.com    -> running mojoPortal installation 2 (physical files on domain2.com), but connecting to the same database.

Thanks for your patience!

Regards,

Craig

10/18/2012 8:58:44 AM
Gravatar
Total Posts 18439

Re: Medium Trust, Multiple installations of mojoportal, one database

As far as I know there have never been problems with multi site hosting and medium trust except for skin problems in .NET 3.5 mentioned at the bottom of the article Understanding the theme.skin file.

Yes, you could use separate physical installations and set them all to use the same conneciton string/database and then still manage the host name mappings from the master site that was created first. You don't really need to run the setup page in the other sites if you do that though it also won't hurt anything if you do. The only problem then is that whenever you upgrade you need to upgrade the first one first then immediately update the other installations so that the code version is in sync with the database version. Using a single installation makes upgrading easier since you only have to upgrade one installation.

Hope that helps,

Joe

10/18/2012 9:19:31 AM
Gravatar
Total Posts 40

Re: Medium Trust, Multiple installations of mojoportal, one database

OK. I was just going by the paragraph on the 'Hosting Multiple Sites on One Installation' page where it states under limitations:

"If your hosting provider enforces a Medium trust policy, hosting multiple sites on 1 web installation will not work correctly but you can still use 1 database as long as you have separate physical web installations at the same host."

So assuming that I want two separate installations (the master site1 on domain1.com & the second site on domain2.com) presumably I don't have to do anything with Host Headers on domain2, otherwise a request for a page on domain2 would never get to the physical files on domain2 (it would be forwarded to look at the files on domain1)?

All I'd need to do is setup the Host Name Mapping for domain2.com as site2 (via the admin page on site1)?
 By doing this, when the database is accessed by domain2.com it would know to feed content for site2?

Thanks,

Craig

10/18/2012 9:25:00 AM
Gravatar
Total Posts 18439

Re: Medium Trust, Multiple installations of mojoportal, one database

Well it is true in the sense that using different skins in the sites will not work correctly because of the theme.skin file problem but I need to update that to say under .NET 3.5. I probably wrote that back before .NET 4 came out. Thanks for pointing it out.

Best,

Joe

10/18/2012 10:02:18 AM
Gravatar
Total Posts 40

Re: Medium Trust, Multiple installations of mojoportal, one database

No problem. Am I right in my understanding of how to achieve two separate domains with separate installations connecting to one database as per my last post? I've just had to completely delete the installations from both domains & also the database because site1 was completely freezing... Possibly because I messed up the multisite installation & effectively had two domains (each with different user.config files) trying to access site1 & confusing things? Luckily both were test site, so nothing important was lost!

As an aside, if deleting a site & starting again is it only the Data/Sites folders that contain different data from a fresh install, or is data written to other folders during the setup & during subsequent customisation?

Thanks,

Craig

10/18/2012 10:09:27 AM
Gravatar
Total Posts 18439

Re: Medium Trust, Multiple installations of mojoportal, one database

It should not affect site 1 in general but most likely your hosting account has a limited amount of server memory available that is shared with each installation you create and its really probably just enough for one installation so adding more installations may kill performance by starving each installation for memory. When the memory allocation for the app pool is reached IIS recycles the app. In a low memory environment it immediately hits the limit again as soon as the app starts so you end up with it continually recycling the app pool which kills performance and could cause the sites to hang.

Hope that helps,

Joe

10/18/2012 11:30:28 AM
Gravatar
Total Posts 40

Re: Medium Trust, Multiple installations of mojoportal, one database

Hi Joe,

BRILLIANT!

I've got both sites up-and-running with separate installations on different domains using the one database. I take your point with memory allocation & I'll see how things go, although it seems fine at the moment.

I found that I had to run /setup/default.aspx on the second site, otherwise there weren't any site files in the /Data/Sites directory on Domain2.

Thanks for your help. It's certainly a learning process & I'm amazed that you have the time to help users out so quickly & so well!

Regards,

Craig

You must sign in to post in the forums. This thread is closed to new posts.