Solved

In IIS7, when you add a new web SITE, is that the same as adding a new application too?

Posted on 2011-03-03
10
604 Views
Last Modified: 2012-05-11
I'm trying to get an understanding of what's going wrong with my website development now I'm using IIS7.  Every answer I've had to questions on here this week has tended to leave me none the wiser or at worst pointed me to a website rather than answer the actual question directly, so I'm hoping this one will work out better...

So to the question: when I add a website to IIS7, is that new website automatically a new application too? (e.g. a root application?) If not, then what is it? Or how am I meant to structure a new web site?

(P.S - I still have some other open questions that I'd like answers to, do look at those if you can help!)
0
Comment
Question by:najh
  • 4
  • 3
  • 3
10 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35026575
Yes, if you create a new site then IIS will automatically make it an application too, and assign it to the default application pool.
0
 
LVL 9

Expert Comment

by:jkofte
ID: 35026649
hello,

basically all of the web sites you add are applications when they are created. they run under an application pool which have a .net version.  

I think you are confused by this:
a web application, for example an asp.net application is something that contains code files and a web.config file. Web.config file is equivalent to app.config file of an application. I think you see it necessery to have these files for the website to be counted as an application.

No, in IIS 7 you do not need to have code under the website for it to be an application.

For example: if you do not have a home.aspx file but you wish to open the file http://localhost/home.aspx file, you will see an error page. this alone is a proof that a website running under IIS 7 is a website.
0
 
LVL 10

Author Comment

by:najh
ID: 35026723
Right, so when I have trouble with getting this error:
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.

and i don't have any virtual directories in my website and people tell me to convert my site to an application, what do they mean? If it's already an application then why would it need converting?

All I really want to do is have a website with a certain part of that site being under forms authentication control, but not all of it.  Just a bit - and that could be a page or a directory (I don't mind which).  But as soon as I try i start getting bogged down in these same errors, and the advice I always get seems to revolve around converting the website into an application.  Why would people tell me to do this if websites already are applications?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35026773
Do you have a web.config in a sub directory of your site?
0
 
LVL 9

Accepted Solution

by:
jkofte earned 250 total points
ID: 35026809
are you trying to place all your code and web.config files under a specific folder in the website ?

basically if you want your application to run, you should have your web.config file in the root of the application. so, right click to the folder and convert is to application. (a regular folder is not an application, it is just a folder under application)

And if you convert the folder to application, the root folder of that application will be the folder where your web.config file is in.

not being able to run the site under a regular folder in a website does not get the website out of the application status. you still can put a web.config file and some code files under the root of the website and it will be a regular web application.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 10

Author Comment

by:najh
ID: 35027145
I'm not trying to put all my code and web.config files into a specific folder - just wherever they'd naturally go.

I have a web.config file in the root, yes.  And it does indeed run just fine.
 structureSo here's a website (called MENU) and it has a folder in it called "test". I can access stuff in the root and in the test folder without any problems. There's a web.config in the root and there's also one in the test folder.  (the one in the test folder is used to specify what the default documents are - nothing more)

I've added an aspx file into the "test" folder called PrivateStuff.aspx.  I'd like to be able to use Forms authentication to control who can access that.  As soon as I try doing that, I get my error that I quoted above.  How would you add such authentication?
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 250 total points
ID: 35027201
The error suggests you are trying to enable forms authentication in the config file inside your "test" folder, which you cannot do because it is not defined as an application. You need to enable forms authentication in the config under the root folder of your site, and then use authorization rules to restrict access to the sub directory.

So your config would look something like the one in the following:

    http://my.re-invent.com/helpdesk/KB/a190/how-can-i-configure-forms-authentication-on-sub-directory.aspx
0
 
LVL 10

Author Comment

by:najh
ID: 35027744
ooo this sounds promising!  let me try some stuff first...
0
 
LVL 9

Expert Comment

by:jkofte
ID: 35028144
basically you can use the web.config file under the root of your application to configure properties (authorization etc.) of every folder in that application. you do not need to define web.config file for each of the folders in your application.

delete the web.config file in test folder, and add this to the web.config file under menu application. (inside configuration tag in web.config)

<location path="test">
		<system.web>
			<authorization>
				<deny users="?"/>
			</authorization>
		</system.web>
	</location>

Open in new window

0
 
LVL 10

Author Closing Comment

by:najh
ID: 35028380
Thanks to you both.  You both said things which really helped me clear up some of the issues I've been having!
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now