ASP.NET - test my asp.net website - Asked By amit sharma on 19-Feb-09 11:48 PM

hiii,

i wanted to test my website over IIS....

for that..i hav installed IIS.....then i created virtual directory......and undertook all the step reqiured but when i m tryng to run that website over browser then i m gettng error as..

page not found ....

HTTP 404 - File not found
Internet Explorer
...

here i m attching my internet information services .....screenshot......

 

 

plzz help...

 

 

Vasanthakumar D replied to amit sharma on 19-Feb-09 11:57 PM

Hi,

check whether the target page is existing in your virtual directory or not?.

reply.. - amit sharma replied to Vasanthakumar D on 20-Feb-09 12:03 AM

ohhh yaa....Default.aspx.....of my website is listed under   virtual directory...........

HTTP Error 404 - mv ark replied to amit sharma on 20-Feb-09 12:55 AM

If you are using IIS 6, be aware that IIS disables dynamic content for security reasons.

To permit IIS to serve dynamic content, the administrator must unlock required content in the Web service extensions node in IIS Manager.

Check these links for more info -
HTTP Error 404 - File or Directory not found" error message when you request dynamic content with IIS 6.0 - http://support.microsoft.com/kb/315122
How system administrators can troubleshoot an "HTTP 404 - File not found" error message on a server that is running IIS - http://support.microsoft.com/kb/248033
check this - sri sri replied to amit sharma on 20-Feb-09 01:09 AM
hi,

check the correct version of framework in the IIS
.






follow this step - C_A P replied to amit sharma on 20-Feb-09 04:49 AM
Local IIS Web Sites

A local Internet Information Services (IIS) Web site is an IIS Web application on your computer. Visual Web Developer communicates with the Web site by using the HTTP protocol.

Creating or opening a local IIS Web site is useful in the following situations:

  • You want to test your Web site using IIS, which closely emulates how the Web site will run on a production server. This can have advantages over working with file system Web sites that run using the ASP.NET Development Server, because paths are resolved as they will be on a production server.

  • You already have a set of Web site files in a folder and you want to test the Web site with IIS. In this case, you can create a virtual directory in your local version of IIS.

  • Your local computer is also your Web server.

To create a local IIS Web site requires the following:

  • Your computer must have at least IIS version 5.0 installed and running.

  • Your computer must be running the .NET Framework version 2.0.

  • ASP.NET version 2.0 must be enabled in IIS. For details, see the topic "Enabling ASP.NET" in the http://go.microsoft.com/fwlink/?LinkId=16179.

  • You must be logged in as a user with administrative privileges. This is required because working with the IIS metabase (where information about IIS applications is stored) requires administrative privileges.

To open an existing local IIS Web site, the preceding must be true as well as the following:

  • The site to be opened must be configured as an IIS application. For more information, see the topic "Creating Virtual Directories in IIS 6.0" in the http://go.microsoft.com/fwlink/?LinkId=16179.

  • The site must be configured to use ASP.NET version 2.0. If it is not, when you open the site, Visual Web Developer will prompt you to reconfigure the site to use ASP.NET 2.0. This is distinct from having ASP.NET 2.0 installed on the computer. It is possible to have ASP.NET 2.0 installed on the computer but have the site to be opened still mapped to use an earlier version of ASP.NET.

When you create the Web site, Visual Web Developer performs all of the tasks that are required to make the Web site function as an IIS application. Visual Web Developer creates the folder or folders for your Web site under the Web root for IIS (for example, under \inetpub\wwwroot). After creating folders, Visual Web Developer creates the files for the Web site template that you selected.

ckk1e6z4.alert_note(en-us,VS.90).gifNote:

You can create an IIS application as a subfolder of any existing IIS folder.

When you create or open a local IIS Web site, Visual Web Developer creates a project to manage the files. The project stores a small amount of information, such as your choices for how to run the application and what debuggers are available. Project information is stored on a per-user basis. For more information, see http://msdn.microsoft.com/en-us/library/928s83k9.aspx.

By default, when you run a local IIS Web site to test it, Visual Web Developer launches a browser and runs the Web site using the server name localhost. For example, if you have created the Web site ExampleSite, when you test it in Visual Web Developer, the browser will request the test page from this URL:

http://localhost/ExampleSite/page

IIS resolves the application name, whether it points to a folder that is under the IIS root or to another location, and serves pages from that folder.

For more information, see http://msdn.microsoft.com/en-us/library/df5x06h3.aspx.

Local IIS Web sites are generally used only for development, so that individual developers can create and test ASP.NET Web pages on their own computers. In most cases, you must deploy the files from a file system Web site to a production server that is running IIS.

You can deploy the files from a local IIS Web site using the Copy Web tool and the Publish Web utility in Visual Web Developer. For details, see http://msdn.microsoft.com/en-us/library/bb398992.aspx.

READ THIS - C_A P replied to amit sharma on 20-Feb-09 05:04 AM

that the problem occured due your own code-overdoing, namely by setting the EnableSsl = true; value, which is not supported by the the smtp of the hosting company. Another problem occured by setting the Port = 80; but it turned out that Port=25; (like I used for localhost) is the right solution.

Developer Developer replied to amit sharma on 20-Feb-09 06:36 AM

How To Deploy ASP. Net Websites

  • From Now onward I will describe one Example To deploy your ASP.Net websites.

Step 1: From Visual Studio Published Your Web Application .
Step 2: Copy The Published Application Folder to "C:\intepub\wwwroot" [default] Folder.
Step 3: From RUN - > inetmgr -> OK
Following Screen Will Come . This is the main Page for Any Application. There are Three Panel.

Main_DefaultIIS.JPG

"TestWeb" is recently pasted webapplication on your wwwroot folder.
Step 4 : We need to Convert it to Application , just RightClick and and Then Click on "ConvertToApplication" as Following picture

ConvertToApplication.JPG

After Converting it to Application its icon will be changed and then you can set the property for your web application from middle pane. you can set IIS Authentication Mode, Default Page Just like IIS 6.0

ConvertedToApplication.JPG

You can Change Security Settings on Authentication Section. Bydefault Setting will be set from your web.config itself. As in my web.config Form Authentication was set that's why, Forms Authentication has been Enabled. if we want to change the Status just double click and update status to Enabled to Disabled or Vice Versa.

AuthenticatinSettings.JPG

Now one most important part to Set Application Pool for you application.

A site can contain many applications including that site’s default application, which is called the root application. In addition to belonging to a site, an application belongs to an application pool, which isolates the application from applications in other application pools on the server .

Step 1: Right Click on Application Pool and Give the Name of your Pool here i have given "pool" and select Framework and click on OK

PoolCreation.JPG

Step 2 : if you are writting some thing on server [ May be writes Error Events Logs ] , you need to Change the Pool Identity to Local System . Right Click on Pool Identity set seeting as following image

There are Three Identity of Application Pool

  • Network Service
  • Local Service
  • Local System

changePoolIdentity.JPG

Now , we need to assign the Application Pool to our web application

Step 1: Right Click on "TestWeb" Application and Select "Advanced Settings"

asingAppPool.JPG


Step 2: Finaly Assign Your Created Application Pool "pool" to "TestWeb" Application.

FinalAppPoolAsign.JPG


Now you can run your application by just typing http:\\localhost\testweb and it can be accessable on network by ip also.

Configure Web Gardens in IIS 7.0

I have split this section with some Parts , these are
  • http://www.codeproject.com/kb/aspnet/iis7aspnet.aspx#WhatisApplicationPool
  • http://www.codeproject.com/kb/aspnet/iis7aspnet.aspx#HowToCreateApplicationPool
  • http://www.codeproject.com/kb/aspnet/iis7aspnet.aspx#WhatisWebGarden
  • http://www.codeproject.com/kb/aspnet/iis7aspnet.aspx#HowCanWeCreateAWebGarden
  • http://www.codeproject.com/kb/aspnet/iis7aspnet.aspx#IsItRecomanded

Application pools used to separate set of IIS worker processes that share the same configuration. Application pools enable us to isolate our web application for better security, reliability, and availability. The worker process serves as the process boundary that separates each application pool so that when one worker process or application is having an issue, other applications or worker processes are not affected.

aPPpIOOL.JPG

Fig : Application Pool With Worker Process On IIS Server

In your IIS there may be more than on Web sites hosted and by creating Application Pool , you can just Assign a Separate Worker Process to your application. I have already discussed how you can assign Application Pool To your web application

Type of Application Pool :

There are Two Predefined Applocation Pool is IIS 7.0

  1. DefaultAppPool (Integrated)
  2. ClassicAppPool

None of Application Pool Installed bydefault when IIS 7.0 is installed. Classic Application Pool is installed when Asp.Net 2.0 is installed in the System

Identity Of Application Pool :

Application pool identity configuration is an important aspect of security in IIS 7.0, because it determines the identity of the worker process when the process is accessing resource. This Settings comes form IIS 6.0. in IIS 5.0 There Application pool runs under the local system account. In IIS 7.0 there are Three predefine Identity , that are same with IIS 6.0

Applicationpool Identity

Description

LocalSystem

LocalSystem is a built-in account that has administrative privileges onthe server. It can access both local and remote resources

LocalServices LocalServices Built-in account has privileges of an authenticated local user account . It does not have any network access permission
NetworkServices This is the default Identity of Application Pool NetworkServices has privileges of authenticated local user aaccount and it can have access remote resource as machine account.
This has been already discussed

Creating Application Pool And Assign it to a Web Application

By default Each Application Pool runs with a Single Worker Process (W3Wp.exe) . We can Assign multiple Worker Process With a Single Application Pool. An Application Poll with multiple Worker process called "Web Gardens" . Many worker processes with same Application Pool can sometimes provide better throughput performance and application response time. And Each Worker Process Should have there own Thread and Own Memory space.

WEb_Garden.JPG

Fig: General Block Diagaram of Web Garden

As Given in Picture, in IIS Server there may be multiple Applicationpool and each application pool having at least a single Worker Process. Web Garden should contain multiple Worker process.

There are some Certain Restriction to use Web Garden with your web application. If we use Session Mode to "in proc" , our application will not work correctly because session will be handled by different Worker Process. For Avoid this Type of problem we should have to use Session Mode "out proc" and we can use "Session State Server" or "SQL-Server Session State".

Main Advantage : The worker processes in a Web garden share the requests that arrive for that particular application pool. If a worker process fails, another worker process can continue to process requests.

Create a New Application Pool. Right Click -> Advance Setting -> Go To Process Model Section , Set the Value for Maximum Worker Process

IIS_Update.JPG

It not always recommended to use Web Garden To Your Application affects to performance of your sites except in very specific cases like some long running Synchronous request or Application is very unstable .

IIS 6.0 Vs IIS 7.0

Main Advantages of IIS 7.0 is Modular Design. Which gives some benefits fo to IIS 7.0 over IIS 6.0. Followin table showing you some difference of IIS 6.0 and IIS 7.0 .

Features

IIS 6.0

IIS 7.0

Architecture Monolithic Modular
Setup Most Features Installed Minimum installtion based on role
Extended Features ISAPI Filter and ISAPI Extention Added Module and handler in managed or native code
Customize UI Normal Customize for .NET

There are many more Difference are There.

Where Do I Get IIS 7.0

IIS 7.0 Will Not available with All Operating System . There are some Specific OS and Specific Version For IIS 7.0 .

Operating System With Edition Available

Windows Server 2008 Yes
Windows Vista (Home Basic) No (Default) Need to be Install
Windows Vista (Home Premium) No (Default ) Need to be install
Windows Vista (Business) Yes
Windows Vista ( Ultimate ) Yes
test my asp.net website - Nikhil Bhardwaj replied to amit sharma on 12-Oct-09 12:01 PM
have u done entries in hosts file to run on local server,try it

also enable asp through IIS if ur using higher ver than ver6 in V.D