IIS 7.x - Alias creation restart AppDomain - iis-7.5

We are working on IIS 7.x - we have site named www.lms.com (example). we have SAAS model based system and sell it to multiple client.
e.g. C1, C2 & C3 are client and they all have same source code but they have following URL
Client C1 has URL http://C1.lms.com
Client C2 has URL http://C2.lms.com
When we create Client in the System we create aliasing entry in the IIS Programatically through our Application. Note, we have already "*" alias entry in the IIS already done.
When we add new Alias our Application Domain Restarts (though same Application if we run on the IIS 6.0 - works without any issue or AppDomain restart).
Please suggest how to allow alias entry on IIS 7.x without restarting IIS OR AppDomain.
Any help on the same appreciated.

I've seen this before and there doesn't appear to be a way around it. I'm guessing this is because you're adding a new endpoint which the app domain needs to be hooked into at some deeper level and it only does this at App Domain initialisation time.
The work around may be to have separate sites for each SAAS site and point them all at the same web folder.
This is probably preferable because you'll have more fine grained control over each SAAS site's resources and you can stop one site without it affecting the others.

Related

Switch ColdFusion 11 from built in web server to IIS

I originally installed ColdFusion 11 in a local environment (windows 7) and selected "Use built in web server". Everything was working pretty good. Now months later, I realize I need to use a real web server for URL rewrites (Apache, IIS, etc) but there is no documentation I can find on how to do so.
I have attempted looking through the administrator's panel for any information, but couldn't even get a jumping off point. Any assistance would be greatly appreciated.
First, it sounds like you need to decide which web server you want/need to use and that could be determined by where you'll end up hosting your site. CF code is quite portable but if you're doing URL rewrites, file system access, etc... then you need to code those to match the production environment, otherwise you might find yourself having to rewrite and retest all that again.
As commented above, a lot of information about configuring CF for web servers is available by searching. You'll first need to install & configure your web server, so search around that first. Then you'll need to configure the web server to understand which requests to pass to ColdFusion's engine.
If it's IIS then you need to make sure IIS is installed and the following components are installed: ISAPI Extensions, ISAPI Filters, CGI, ASP .NET
Then configure an IIS site to point to your CF code and after that use the "Web Server Configuration Tool" application (installed with CF) that will associate the relevant file types with ColdFusion.
Most of the time it's as simple as that.

Binding an IIS website to a second ColdFusion instance

I have a Windows 2008 R2 server, IIS7, Coldfusion 9.0.2. I created a 2nd CF instance, created an IIS website, used the web server configuration tool to bind the IIS website to the CF instance. Restarted IIS & CF windows services. It does not work as expected. It does not look like the IIS website is actually bound to the 2nd CF instance. With both the Windows IIS service and the new CF service running, I am able to hit the website and click around it.I then stop the CF service and the website still works. I would expect the website to not work when the CF Windows service was stopped. Any ideas as to what is going on?
Thanks ~Joe~
Here are the steps I did to create everything
CF admin > instance manager > Add New Instance with create Windows service option
create the website in IIS
remove the windows CF service
create a windows service and configure it to use a separate jvm.config file
restart IIS & CF services
use the web server configuration tool to bind the new CF instance to the new IIS website and checked off to configure web server for CF9 applications
possible reasons are
1) web config tool created a new connector but it points to wrong instance.
2) your website is using the wrong connector
3) the website is inheriting the global connector instead
every time you use the web config tool to enable cf on a site it creates a new connector. this doesn't serve much purpose if you have once instance, so for reference you are better off to just add the handlers manually and use existing connector.
for multiple instance, you only need to use the web config tool ONCE to create the new connector, then just add handlers manually to any site you want to use that connector.
this way you only have as many connectors as you have instances, so it doesn't get confusing.
first we need to check which connector your site is using, so go into iis and check the cfm wildcard handler, and see what connector it points to, it should be different than your other site.
so your first site should for example be using the conenctor in
C:\ColdFusion9\runtime\lib\wsconfig\1
and 2nd site using C:\ColdFusion9\runtime\lib\wsconfig\2
the numbers will differ according to how many times you have used web.config though.
in these connector folders open the file jrun_iis6_wildcard.ini
and look at the line
bootstrap=127.0.0.1:51011
the proxy port should be different for multiple instances.
so on the connector for instance2, it should have a different port than the connector for instance1, if not, if you have any other connectors, then check the rest as well.
If they all have the same port, then they are all pointing to the same instance.
In which case, you simply need to change the port for the conenctor that SHOULD be pointing to instance2.
Generally CF just increments the port for each instance, so if it says 51011 then change it to 51012 and it should be working.
You should also make sure instance 2 is running by connecting to it using the built in web server, if you look in your cfadmin in the instance manager, it will have a link to open the cfadmin for each instance on the native port.

Multiple sitecore instances hosted on one domain

I want to install multiple Sitecore instances to be hosted under one domain. So the root url of first instance will be http://example.com/instance-1 and so on.
The reason I want to have multiple instances is that, I want to split environments for each site. I know I can play with bindings and publish each instance on other port within same domain. I also know that I can install multiple sites under one instance. But I didn't found solution how to install instance in IIS site subdirectory.
Please if anyone was successful instaling multiple instances as child application or virtual directory, please share the knowledge.
I'm using Sitecore 6.5 and IIS 7.5
Sitecore does not support running in virtual directories.
It must run in its own website.
However, i did come up with a trick, but it is quite advanced and i don't have clear cut examples:
Setup one site that will be your main domain with sub folders (eg.
www.mydomain.com/site-a , www.mydomain.com/site-b
Setup your separate Sitecore instances as separate IIS websites
Give each site its own hostname and add it to your hosts file (so you get http://site-a, http://site-b, etc)
Install the IIS URL Rewrite feature, make sure rewriting of the HTTP_HOST server variable is allowed
Configure rewriting on your main site, so that http://www.mydomain.com/site-a/* is rewritten to http://site-a/*
Create a custom linkprovider that makes sure Sitecore links are being written using the correct domain and folder (so http://site-a/item is written as http://www.mydomain.com/site-a/item)
I'm sure this is possible as i've implemented a similar solution for a site that hosted clones if a site as 'virtual' folders.
I wonder why you have the need to host multiple Sitecore instances on the same domain. Sitecore has good solutions for multi site setup in the same instance. If the solution Ruud provided is not workable for your, check the multi site solution of Tim Ward ( https://github.com/jerrong/Sitecore-Multisite-Manager ) or the shared source module on the Sitecore Marketplace ( http://marketplace.sitecore.net/en/Modules/Multiple_Sites_Manager.aspx )

Creating Web-Site and Web Application in IIS

Till date, I was thinking that we always create/host web-site in IIS.
But I was going through powershell tutorial today which says it is different to create web-site and a web application.
This is the tutorial link (check different section on creating web site and application) -
http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools/
Can please guide what is the difference between the two.
Any example will be really helpful.
Thank you!
A web site in IIS is the top level under Sites. The default one that is normally automatically created for you when installing IIS is named "Default Web Site".
This is the "root" that runs on port 80.
Under that, you can create virtual directories, which is basically sub-levels under the root web site, or you can create separate web applications that lives as separate applications under the root level.
A web application must live under a web site.
It is possible to create other web sites that can either be set up to run on other ports (i.e. 81), or to be named with a different host name which enables multiple sites to run on same port number. If named with a different host name, this name must be registered in a DNS server somewere to point to the IP address for your server. A workaround is also to to add it as an entry in the hosts file on the client computer that should access it.
This is example on how it looks in IIS Manager:
I have a script I use when creating a website and AppPool in IIS 7+, .net4, Integrated pipeline and thought you might find it useful.
Use it as so:
CreateSite.ps1 [WebsiteName] [AppPoolName] [Port] [Path]
If you are reinstalling the site, you will need to Stop it first. That is done as so:
StopSite.ps1 [WebsiteName] [AppPoolName]
you can grab the scripts from my gist
Update I have added/extended the scripts and put them in their own Github repository
Here is my CreateWebsite PowerShell script: http://www.zerrouki.com/create-website/

One server out of three losing session using State Server in web farm

In short, I have three servers in a web farm, one of which is configured as a State Server. Two of the servers (including the State Server) are correctly sharing session state, but the other server is holding it's own session still.
Here's what I've done:
I have modified the web.config.comments file on all three servers so that they have the same machineKey entry.
On the State Server, I have changed the AllowRemoteConnections registry entry to 1. I then set the ASP.Net State Service to start automatically and switched it on.
The web site is configured on all three servers and the root site shares the same Identifer in IIS. Each configuration is identical. The website itself is contained on a network share, so the same web.config file is used on all three servers. I changed the sessionState entry in the web.config to point to Web3.
So Web2 and Web3 are able to set/modify/destroy the same session, but Web1 is still running with it's own.
I'm at a loss here after hours of Googling, so any help is greatly appreciated.
This application is configured a few subdirectories into the root site. Is there a separate AppID at this level? If so, how can I find it?
Thanks,
Aaron
http://support.microsoft.com/kb/325056
To maintain session state across different Web servers in the Web farm, the application path of the Web site (for example, \LM\W3SVC\2) in the Microsoft Internet Information Services (IIS) metabase must be the same for all of the Web servers in the Web farm. The case also needs to be the same because the application path is case-sensitive.
On one Web server, the instance ID of the Web site where the ASP.NET application is hosted may be 2 (where the application path is \LM\W3SVC\2). On another Web server, the instance ID of the Web site may be 3 (where the application path is \LM\W3SVC\3). Therefore, the application paths between Web servers in the Web farm are different. For additional information about how to check the application path of the Web site, click the following article number to view the article in the Microsoft Knowledge Base:
240225 Description of Adsutil and MetaEdit Used to Modify the Metabase
This is not really answering your question, but in my experience the ASP.NET session state service is not something you should scale to more than one server. It doesn't perform very well (especially under load) and is difficult to configure. I found that a distributed cache such as memcached is much simpler and faster for this purpose.
Have a look at this project.
matthewk's answer actually turned out to be almost the correct one. Over a year later I've returned to this and found the answer. Though probably correct, I felt that if the answer above had been more specific I would have solved this!
I searched through the MetaBase.xml file (C:\WINDOWS\system32\inetsrv) for the web application. After a game of spot the difference I noticed that there was a slight difference in the following line:
<IIsWebVirtualDir Location ="/LM/W3SVC/103071637/root"
AccessFlags="AccessRead | AccessScript"
AppFriendlyName="Default Application"
AppIsolated="2"
AppRoot="/LM/W3SVC/103071637/Root"
...
Specifically, the AppRoot (not the Location) on Server 1 had a Proper-Case "Root" whereas Server's 2 and 3 had "ROOT" all in caps. I updated Server 1 to match and restarted IIS and it works a treat.
ie.
AppRoot="/LM/W3SVC/103071637/Root"
AppRoot="/LM/W3SVC/103071637/ROOT"

Resources