Problem browsing secondary site

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.
6/17/2011 4:24:08 AM
Gravatar
Total Posts 20
ScalSan

Problem browsing secondary site

Hi guys,

I installed and am using following Mojoportal version:

  • mojoPortal Version 2.3.6.4 MSSQL
  • Operating System Microsoft Windows NT 5.1.2600 Service Pack 3
  • ASP.NET Info v4.0.30319 Running in Full Trust

Followed the documentation to install a second site based on host headers on development machine (locally):  added the host headers in IIS 5.1 - changed hosts file on development machine with the dns entry - altered the keys in the web.config...

MojoPortal is installed as vir dir: http://localhost/MyMojoPortal  works fine.

I suppose http://localhost/MyMojoPortal\secondsite should be working also?
http://localhost/\secondsite  doesn't work either. Same for http://secondsite .

I receive a Windows 'connect to' dialog box to enter credentials with error afterwards:  IIS error message appears: 
You are not authorized to view this page - HTTP 401.2 - Unauthorized: Logon failed due to server configuration Internet Information Services

Changing the authentication method in IIS didn't help (removing unauthenticated, changing account)

Thanks for your thougths

Pascal

6/17/2011 6:41:47 AM
Gravatar
Total Posts 20
ScalSan

Re: Problem browsing secondary site

Have been looking the entire day for this yesterday, and typically, a while after posting this question I found the solution :) :

You cannot have MojoPortal installed a Vir Dir but have to install it in the root (Default Web Site) 

If someone can explain why?  Would be great!

Thanks

6/17/2011 6:52:22 AM
Gravatar
Total Posts 18439

Re: Problem browsing secondary site

Yes folder sites can only work if the first site is a root level site as stated in the documentation.

The reason is simple, it would have been far more difficult to implement it without that limitation if we can't assume the first folder segment is the site folder. Allowing arbitrary folders in between would make it much more difficult and error prone.

Best,

Joe

6/17/2011 7:21:47 AM
Gravatar
Total Posts 20
ScalSan

Re: Problem browsing secondary site

Thanks Joe  -  That sounds logic.

I thought I had installed 'Multiple sites based on host names'  where I stated the host name in the host file and added a Host header in IIS (host header or dedicated ip were the options here?) ?
But what I did was configuring multiple sites based on folder name apparently?

I'm confused and even more when I noice that UseFoldersInsteadOfHostnamesForMultipleSites is set to false?

 

6/17/2011 7:32:29 AM
Gravatar
Total Posts 18439

Re: Problem browsing secondary site

You "could" setup host named based sites without it being a root site, but it won't be based on folders and it won't make much sense to do it that way.

Consider the url http://localhost/mojoportal/

ok, that is not a root site, but the host name is "localhost", so if I make another host name based site the url will be http://someotherhost/mojoportal/ and mojoportal is still installed in a sub folder not a root. The folder is not part of the host name, so the real benefit of host name sites is for root level sites though it can work in a folder like that.

It makes far more sense to have http://localhost and http://someotherhost without any sub folder. If you later plan to move the site(s) and database to another server it is also very important to have the same url structure on your dev environment as on the production environment. The urls don't have to be the same but the structure of the urls does.

I recommend the following articles

Hope that helps,

Joe

6/17/2011 7:42:16 AM
Gravatar
Total Posts 20
ScalSan

Re: Problem browsing secondary site

I definately mixed up the 2 options we have of running multiple sites: 

I removed the host headers and the host file entry and the second site was still running fine...
TIP1: clear Local DNS cache --> worked NOT anymore afterwards
TIP2: open a new browser session regularly while testing to be sure all is refreshed

Removing the Host headers in IIS didn't stop the second site from working!
It seems that 'based on folder names' is entirely based on the 'dns-entry' in the local hosts file....?

What's the main difference between the 2 setups or where is my confusion?

6/17/2011 7:47:15 AM
Gravatar
Total Posts 20
ScalSan

Re: Problem browsing secondary site

Sorry, was working on my previous post while you already replied, Damn you're fast :)  THANKS - GREAT support

Wouldn't be suprised if I have more questions though ... :)

6/17/2011 7:55:09 AM
Gravatar
Total Posts 18439

Re: Problem browsing secondary site

Host headers are only needed if you have mutliple IIS sites running on the same ip address so it can resolve which IIS site should handle the request. mojoportal doesn't really care about the IIS host headers other than that is needed to resolve which IIS site handles the request so if it doesn't map to th eone where mojoportal is installed ten mojoportal will not be handling the request. But a mojoPortal installation is only one IIS site even if it hosts multiple sites, so we have to be clear about what we mean by sites, it is a different context to talk about IIS sites vs mojoPortal sites that run in the same IIS site/installation of mojoportal.

The difference between host name based sites and folder based sites is how mojoPortal determines the siteid, for host name based sites it determines the site id based on the host name and for folder based sites it determines the site id based on the first folder segment in the url. So mojoportal cares about the host name mapping in Site Settings that tells it which site is mapped to the given host name, if no site is specifically set for a host name then the root site (ie the first site created during setup) is used. Similarly for folder name based sites, if that is enabled then in Site Settings you will not see host name mappings but instead folder mappings.

By determining the site id it knows which site content to show.

Hope that helps,

Joe

6/17/2011 8:17:54 AM
Gravatar
Total Posts 20
ScalSan

Re: Problem browsing secondary site

Couldn't have been more clear!  Thanks again.

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