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/
Related
I am unable to get a Blazor app working while hosting the application as an IIS application on my local Windows 10 machine. The app is very simple, with just one page with minimal components - even simpler than the default Blazor app provided.
These are my steps:
Click on publish app
Select Folder, note it's going to ...\bin\Release\net5.0\browser-wasm\publish\
Open IIS, navigate to Default Web Site
Right-click Default Web Site and select Add Application
Select physical path as the path above, and host at www.NAME.com
Click Browse.. to view the app at www.NAME.com on *:80
Page displayed is the welcome page of IIS
Attempted Solution 1: Install URL Rewrite
Attempted Solution 2: Go to Hosts (in System32) and tried adding 127.0.0.1 or 127.0.0.1::80 followed by www.NAME.com
Attempted Solution 3: In index.html, edit the base element to include the link <base href="/NAME/" />
Attempted Solution 4: Instead of adding an application under Default Website in IIS, add it as a website instead
Attempted Solution 5: Gave IIS_IUSRS full permissions to web.config (Image)
None of the attempted solutions worked. I just started using Blazor yesterday and I am very new to this. Am I doing something wrong? Thank you!
Please refer to this tutorial, I think is one of the best tutorial to achieve your goals:
https://blog.medhat.ca/2020/08/deploy-client-side-blazor-web-api-to.html?m=1
Remember that the configuration of the hostname in your hosts file is related to your machine only
So, in order to allow the students to access your IIS published site you need:
Register a hostname in a DNS server that all the computer of the students will use to resolve your machine name. I.e. if your machine should be accessible with www.name.com you need your DNS server resolves this name with your local IP address
To use the https protocol you need a certificate on your local machine, loaded in your IIS configuration, but the same certificate has to be available to every computer of your students.
I think the better and simpler solution is to use your local machine name, probably using your full DNS name, and allows the students to access the site using this name on their browser.
In this case you can use your local development certificate to allow https connection
This certificate is already installed on your machine for development purpose.
Every concept I've described is well documented on the web and here on the SO.
I am currently setting up a development machine at my company and I would like to be able to set up a few local sites on this one machine for testing. In order to do so, I am running the following software:
ColdFusion Server 10 (Developer's Edition)
IIS
Everything is installed and I am able to run the default site (from localhost) but I can't figure out, nor can I find how I can set up other sites on this system. I have the files for each site on the local machine. Ideally, I would like to be able to call up each site using a subdomain, such as (http://site1.domain.com, http://site2.domain.com, http://site3.domain.com) where each one points to a separate file base on the local machine.
Can anyone point me in the right direction?
Create the sites in IIS for each site, pointing to its respective web root. Then run the web server configuration tool to hook up the connectors for the sites.
You can find that under {ColdFusion root}/cfusion/runtime/bin/wsconfig.exe (on windows - not sure of the file extension on non-windows machines)
From there you can run the connector for each individual site or you can set it to run the connector for every site.
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 )
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"
hi i am comletly new to iis and asp.net i am trying to setup bugNET on a godaddy server. i created a virtual directory and once i tried to launch the site i get this error:
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
here is complete detail of what i did.
hosting: godaddy
created virtual directory (child folder of root) - named: devbunk with these settings (anonymous access, directory browsing)
that is all i can do to with iis on godaddy.
the error tells me that i need to turn the virtual directory as an application. godaddy doesnt let me do that... how do i do it? btw, i have iis7 setup.
You can configure this with Godaddy Hosting Control Center. log in to godaddy hosting center.
Go to Content >> IIS Management.
Click on the pencil icon to edit your selected directory.
you will get a popped up screen with three check boxes. You need to check the one that says "Set Application Root".
Click Ok and your directory will be configured as an application in IIS.
Hope this helps you and feel free to ping me if you need more info.
You need godaddy to do that, usually hosters do offer the ability to convert a regular folder as an application through their Control Panel, so if you have access to one search for that option. Other hosters give access through IIS Manager and Web Deploy to convert folders to applications as well, but it boils down to "you need your hoster to do that".
There are no ways for you to do that through Web.config or FTP or etc. I think Front Page Server Extensions did had a way as well. The best thing is contact your hoster and ask them what is the right way of doing this. Usually all hosters will allow you to create as many applications as you need as long as they run the same .net version.
Check the properties on Web.Config to ensure "Copy to Output Directory" is set to "Do not copy"