inutan
inutan

Reputation: 10888

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!

Upvotes: 4

Views: 14912

Answers (3)

alastairtree
alastairtree

Reputation: 4289

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

Upvotes: 4

awe
awe

Reputation: 22442

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:

Example on web site and web application in IIS
Web site details

Upvotes: 10

fab777
fab777

Reputation: 49

Here is my CreateWebsite PowerShell script: http://www.zerrouki.com/create-website/

Upvotes: 3

Related Questions