Switch from host name mapping to folder names

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
9/22/2011 11:33:11 AM
Gravatar
Total Posts 10

Switch from host name mapping to folder names

Hi,

I am a new to mojoPortal. The site was installed by someone else and the mojoPortal version is 2.3.6.8. It is set-up for Host name mapping. I am needing to create a sub site accessed by folder names. Is it possible to switch from Host name mapping to folder names without redoing the installation. The site already has content in it. The master site is not using the Host name map, so it seems the switch should be easy to get access to the folder names feature. Thanks for letting me know what is needed to make the switch and does this change impact the database or server somehow?

Debbie Pickrel

 

 

9/22/2011 11:47:39 AM
Gravatar
Total Posts 18439

Re: Switch from host name mapping to folder names

Hi Debbie,

If you are using version 2.3.6.8 then the person who installed it must have compiled it from fairly recent source code since the current official release is only version 2.3.6.7.

You should be able to change easily to folder based sites as long as the first site is a root level site.

Just add this to your user.config file in the root of the installation:

<add key="UseFoldersInsteadOfHostnamesForMultipleSites" value="true" />

then touch web.config or recycle the app pool because it won't automatically detect changes in user.config like it will for Web.config

then assign a folder mapping to the child sites from Administration > Site List > Site Name (Site Settings for the child site)

See also Hosting Multiple Sites, and Hosting Multiple Sites by Folder Names

Hope that helps,

Joe

9/27/2011 12:33:48 PM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Joe,

Thanks for your help.

The changes have been done to the user.config file. I have been informed by the person who installed mojoPortal that none of the source code goes on the server, but it is deployed. In Visual Studio, I see the Package/Publish Web tool has been configured and also the Solution Explorer properties has been set in which projects will be included within the build. It seems that all the needed settings are in place. I also see the plug-in Unleash It on the computer, but the destination directory folder does not exist so I don't think they used it in order to deploy.

I have been reading the Packaging and Deployment web page in the documentation to understand how to move the user.config file changes made on development to be on the server for the fix to be live. I don't know what recycle the app pool entails, please explain.

Within the documentation there seems to be quite a bit of steps needed in order to make changes on the site such as update the development database with the live database, get the latest mojoPortal code, update database scripts, so on. Is this needed every time a developer needs to deploy changes? I also read that the build should exclude source code files. Please explain how changes are made live?  From reading it sounds like a developer builds and then opens the zip file to remove certain files such as currentlog.config file and systemfiles. Seems to me files would of have already been filtered before deployment via configuration? Also, which configuration does the build use? Is it Active(Debug)? Then it says to rebuild using Release. Does Visual Studio know where the deployment package is located? I don't see where this information is located. The line that reads "Choose the Release configuration for your chosen database platform, the one that just says "Release" is for MS SQL Server" where is this done? How does the deployment file get installed on the server if not using Unleash IT? I see in the Package/Publish Web tool an IIS Web Site/Application name on the target IIS machine (destination server). When is this used?

Need a jump start. I have looked in the documentation pertaining to deployment. The more I read the more questions I have. Please explain the steps to get the user.config changes live and for deployment.

Debbie

 

 

9/27/2011 1:06:10 PM
Gravatar
Total Posts 18439

Re: Switch from host name mapping to folder names

Hi Debbie,

user.config is the one file that you should not copy from development to production. You should directly edit the user.config file on production if you need to make a change to it. Your database connection string should be in user.config and this will usually not be the same on your dev machine as on production.

Honestly it sounds like you are in a bit over your head if you don't understand about release build vs debug builds Active just means that is the build profile you currently have selected in Visual Studio, so Debug is the active build profile at the moment on your copy of the solution but you would choose Release from the dropdown in Visual Studio for making a production ready build. I would choose Release form the build profile dropdown then I would choose Rebuild Solution from the Build menu, then I would publish to a folder on the local file system and delete any extra files from your dev environment such as the log file and any other junk as described in the article on Packaging and Deployment, but user.config would be one of the files I removed before deployment because it is generally going to have differences on production such as the database connection string, so you don't want to overwrite the production user.config file with the one from a development machine.

You don't even need to do this kind of packaging and deployment in order to make a change in user.config, just update that file directly with a text editor on the production site, very simple.

[Edit] after making the change in user.config just edit the web.config by typing a space in it and save it, that will recycle the app and make it detect the changes in user.config.

The only time to redo the deployment is when you've made changes in C# source code like in your own custom features and you want to compile and deploy those changes, or if you've updated your source code from our repository and want to update your site with a new build of the code.

Hope that helps,

Joe

9/28/2011 8:39:57 AM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Joe,

At this time what is on the server is used for both development and production. The site is live and being used only for developers. Ok, one mystery has been revealed. The installer of mojoPortal informed me that the Web.config had its own configuration on the server compared to the one on the development. After the installer deployed previously he removed the Web.config file off the server. The development Web.config file does not go on the server. All changes  are brought over through deployment. I have been reading mojoPortal documentation through information I have been told and have been trying to make since of things. This makes since know why things did not align up.

To start over from scratch to go forward. Sounds like I need to place a Web.config file and create an user.config file and place them on the root level on the server. The thing is the site is working fine currently without the Web.config file. Is there another configuration possibility that the installer could of put in place for the site to work. My concern is by modifying the server file set-up and placing these two files, I don't want to break the site.

Can I use the development Web.config and modify it or could I be sent a server Web.config file. I need to know where in the documentation that goes over what needs to be modified in the server file for it to be configured.

Thanks for your help and time, Debbie

 

 

9/28/2011 9:20:06 AM
Gravatar
Total Posts 18439

Re: Switch from host name mapping to folder names

Hi Debbie,

You are mistaken. mojoPortal cannot run at all without a Web.config file in the root of the site, so one already exists there though it may have differences vs the one on the dev environment. Making changes to Web.config or user.config on the production site can be done directly it does not require re-deploying from Visual Studio.

The main difference between a dev environment Web.config and a production one is on the <compilation section where debug="true" on development and false on production. Other than that there may also be other customizations in Web.config that need to be maintained whenever updating the Web.config file. For example once you have created a custom machine key, that needs to always stay the same so you need to maintain it whenever you update the Web.config to prevent it from being changed.

If you are not doing custom development I recommend don't bother at all with Visual Studio, just use our pre-compiled release packages from the links on our download page. You really need to understand a lot about development and ASP.NET to correctly manage your own deployments from Visual Studio. Trying to do it without that understanding is not recommended. Its ok with a test site because there is no real harm if something goes wrong and you have to start over but once you have a production site or a site that is critical for your business, you could easily break things and cause yourself a lot of heartburn and struggle.

However, even upgrading from our pre-compiled packages requires the same care about the web.config file to make sure you don't lose the machinekey after you've changed to a custom one.

Hope that helps,

Joe

9/28/2011 2:04:27 PM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Joe,

mojoPortal needing a web.config file on the server to run makes sense. The installer told me he took it off though. There is no web.config file at the root of C:\inetpub\wwwroot\site. I have done a search and there is no web.config file on the server at all.

Is there another file that states the location to where the web.config is located in order to read off of it. I am thinking maybe the installer done something custom and adjusted files to read off the new location in order to get information. There is a Web.Debug, Web.mediumtrust, Web.net3.5, Web.net3.5mediumtrust, Web.Release, and Webback files, but no Web.config file.

Debbie

 

 

 

9/28/2011 2:58:00 PM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Joe,

I figured it out. config is the file extension. I thought it was part of the name. On the server, the extension was turned on to be shown. Easy fix, praise the Lord. Ok, now I will read back on your earlier comments to apply from. I will follow your directions as the basis of the installation. The installer who no longer works here is very smart and when he gave me foundation information on mojoPortal he probably just left off some details. Still thankful for what he was able to share. Working it all out, so it is all good.

Debbie

 

9/30/2011 3:33:54 PM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Joe,

Changed the user.config file on the server and received a white blank page for the newly created child site. Currently, site has index.html at the root that redirects to the web pages in its own folder. URL for master site is http://localhost/mastersite/. Now need to move files from this subfolder install for the site to be at the root level (http://localhost/), so can map sites based on folder name.

Read over the "Moving an Installation of mojoPortal to a Different Server" article hoping for guidance on moving the subfolder folder/files to the root level on the server. Currently, on the Development and on the Server the folder/files reside in the same name folder "mastersite." Will there be broken images due to the new change of location and will need to redeploy?

For the move on the same server looks like I would need to do a zip of the folder/files on the mastersite folder, paste it in C:\inetpub\wwwroot, unzip it, and then delete all the files from /Data/systemfiles and from /Data/Sites/[SiteID]/systemfiles. mojoPortal needs all folders and files to sit directly on wwwroot. There is another folder on the root called aspnet_client, which is empty; does this need to be changed in anyway? I can then delete the redirecting index.html page. I recall a place where you set the default first pages to be read for a website to load (now it will be Default.aspx page). Is this in IIS? Currently, in IIS the default web site is the mastersite folder. What needs to be changed to IIS now that the folder/files will sit directly in wwwroot.

For the files on Development do they need to be moved somewhere special or housed in another name rather than the mastersite folder. Currently, the mastersite folder resides in a Projects folder that is handed by control version software.

For this line in the article: Re-establish correct folder permissions so that only the /Data and /App_Data folders are writable by the web process, and all other files and folders are read-only. Does this need to be done on both the server and development.

For the server and development databases. I don't think these need to change any.

At this time, I am aware of Unleash It. Could you inform me if there is any other software or plug-in recommended to use with mojoPortal that could need reconfiguring due to the change of location. I have not learned all of the software that was installed on this computer. I know there is Powershell sitting on the server - could this of been used for deployment?

After this is in place and going back to setting child sites. Does the child site folder and blank Default.aspx page only go on the server? 

Thanks,

Debbie

 

 

 

10/4/2011 7:36:09 AM
Gravatar
Total Posts 10

Re: Switch from host name mapping to folder names

Hi,

I studied IIS (where it states what is the default page of the site to load up). The IIS  is configured correctly for an Web Application, but  switching to folder names does the site folders and files need to sit right on C:\inetpub\wwwroot? Please read my previously post  for questions.

Debbie

 

 

10/4/2011 8:26:45 AM
Gravatar
Total Posts 18439

Re: Switch from host name mapping to folder names

Hi Debbie,

For folder based sites the first site has to be a root level site so that the url is http://localhost/ or http://somedomain/

not http://somedomain/somefolder/

The files can live anywhere on disk, it doesn't have to be under inetpub\wwwroot, you can point the IIS web site to any folder in basic settings. inetpub\wwwroot just happens to be the default location where the automatically created default web site points to, so if you want to put the files there that is fine. if the files already exist at inetpub\wwwroot\mastersite then just point the default web site to that folder (instead of to inetpub\wwwroot\) and then use the url http://localhost/

note that when you create folder based child sites it does not copy files to a child site folder and the folder does not even really have to exist. The child sites run out of the same files as the master site the urls are done by url rewriting

all the pages in the menu in both master sites and child sites are served by /Default.aspx?pageid=x even though the url you see is like /home.aspx for a root site or /foldername/home.aspx for a child site those are just url mappings, the page id is determined by the home.aspx and in the case of the child sites the siteid is determined by the first folder segment /foldername/ but it doesn't mean files are actually located under /foldername/

See 

Hope that helps,

Joe

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