Installing multiple site based on hostname

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.
2/24/2009 12:25:42 PM
Gravatar
Total Posts 30

Installing multiple site based on hostname

Hi Joe,

  I am now on my second site , I've read thru the documentation on multiple site based on hostname, just  couple of clarifications:

Here is a little background of my setup. I have the current site running mojo (one installation) then I wanted to add a new site using same database and same installation, from the documentation I can just add 'New Site' and put a new host name where it says add host name. Right now I am running it on the local machine (localhost).

In reference to the documentation, "1. Get the first site working" - DONE

"2. Make sure the web.config setting "AllowMultipleSites = true" - DONE

"3. go to admin-> Site settings FIRST SITE. See dropdown list next to the site name choose "New Site" .....

My question is after doing the above on the first site (current site) I noticed on mp_sites table it added the new site however, the current site didn't change at all? meaning I selected a different skin and it didn't seem to change the current site. Does this mean that I should create a new folder and assign a new site (IIS) to that folder?

And last one on the Database everytime I connect using the new site I get this error thought maybe you have some ideas..

Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema already exists.
database core schema needs upgrade.
0 site(s) found.
Running script mojoportal-core - 2.2.1.9 - 00:00:00.0468753
System.Data.SqlClient.SqlException: Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

 

Thanks again Joe.

-gil

2/24/2009 1:58:35 PM
Gravatar
Total Posts 30

Re: Installing multiple site based on hostname

Hi Joe,

 I think I'm close to solving this , one of your answers from other same forum topic goes like this

"Oh, I thought of something else you will need to do to make this work. When you create the second (or nth) site using the Admin > Site Settings of the first site, it will create a folder in the first site at Data/Sites/[new site id], so the second site will be Data/Sites/2 and the 3rd site will be Data/Sites/3 and so on. Since the additional sites are using their own web installation you will need to copy these folders to the correct location in the additional sites because by default there is only 1 folder at Data/Sites/1."

I just got confused with the part where you say "Since the additional sites are using their own web installation you will need to copy these folders to the correct location" do you mean that I have to have another "mojoportal" folder  inside the "Data/Sites/2" ?

Thanks again,

Gil

 

2/24/2009 2:11:29 PM
Gravatar
Total Posts 18439

Re: Installing multiple site based on hostname

Hi Gil,

You should not need to create any folders or copy any files when creating new sites using host names. When you create the site it should do that for you.

Whatever site is current in the dropdown list when you save is the site it is updating. Creating a new site does not change the root site.

For host name based sites you need a fixed ip address that all the hosts point to and then in site settings for each site you have to specify the host name on the host names tab. Any host name that points to the ip address if it is not specified on a site will result in seeing the root site.

Sometimes after adding the host name to the site it may help to recycle the app by tocuhing Web.config

Hope it helps,

Joe 

2/24/2009 2:25:02 PM
Gravatar
Total Posts 30

Re: Installing multiple site based on hostname

Thanks Joe I think I finally got the whole concept of adding additional sites, so I changed my 'host name' and selected a new skin to be modified, then I ran the dev machine and gave me this

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

Does this error make sense to you? did I do something wrong with pointing hostnames?, additional fyi we're using WINS to resolve IP address in our dev boxes here in the office.

Thanks truly,

-gil

2/24/2009 2:32:05 PM
Gravatar
Total Posts 18439

Re: Installing multiple site based on hostname

 You can look at the errors in the log at Administration Menu > System Log, or download the file /Data/currentlog.config

newest errors are at the bottom of the file, please don't post a lot of errors, just find the newest.

you an also see the error by doing what it says, look in Web.config and change this:

<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

to

<customErrors mode="Off" defaultRedirect="mycustompage.htm"/>

Hope it helps,

Joe

2/24/2009 2:43:10 PM
Gravatar
Total Posts 30

Re: Installing multiple site based on hostname

Hi Joe sorry about posting all those errors won't happen again, anyway, I finally realized something tell me if this is correct.

What I did was, I created a separate copy of mojoportal and then assigned the new hostname to that copy I created (which was the same hostname that I set up on the First site when I created a new site). This will not work since I think what you were trying to tell me is that when I create a new site using hostname-base all contents and data are related to that SiteID I newly created, thus the new site.

my manager want's to have a separate folder (another mojoportal) but using same DB and point the hostname (new site domain) to that new folder.  I can apply the multi-site FOLDER-based setup right?

Don't worry once I have this down, I can take it from here, since I have mastered the art of skinning MP and I'll be able to start redesigning the new site.

Once again for untiring support - thanks!

2/25/2009 5:02:21 AM
Gravatar
Total Posts 18439

Re: Installing multiple site based on hostname

 Hi Gil,

Yes, you can use Folder Based sites instead of host name based sites.

It will work out of the box with urls like:

root site:

http://somehostname/

next site:

http://somehostname/folder1/Default.aspx

if you want it to work with the url like:

http://somehostname/folder1/

then you have to actually create a folder named folder1 and put an empty text file there named Default.aspx

Hope it helps,

Joe

2/25/2009 11:44:41 AM
Gravatar
Total Posts 30

Re: Installing multiple site based on hostname

Hi Joe, appreciate the reply so much, I will just have to do the folder-based one then, since I'm having problem using hostname-based.

cheers!

-gil

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