ASP.NET deploy to IIS7: To default site root, app in default site, or separate site? - asp.net

I'm sort of new to IIS7, and I sort of get the differences between sites, applications, and virtual dirs. However, I'm not quite sure what the best deployment approach would be for my specific situation.
I have a clean windows '08 server VM with a IIS/asp.net set up. I set up an FTP site with C:\inetpub\wwwroot as the FTP root thinking I could do a quick "copy site" from VS to this root.
However, before I do the copy, I want to make sure this is the quickest, safest approach.
Please note that, this VM will be soley dedicated to my asp.net app (for testing purposes), and I'm kind of under the gun having to get this app running by EOD today.
That said, my questions is, should I...
simply do a "copy site" directly to the default site's root and
leverage the default app pool that's already been created, or
add a new application under the default site (if I do this, should I select the default app pool, or create new ones), or
add a whole new web site?
Also, while I'm at it... My app was built with asp.net 4. Should I select the Default App Pool, or the ASP.NET 4.0 Integrated ones?
Thank you,
Ed

Here's how I would setup IIS:
Create a new site (I always name the sites by the domain that they will be using)
Creating a new site will create a new application pool. Verify that the application pool is using .NET 4.0 Integrated.

Copy/Publish your site to a folder and then host this folder.
IF you host it under default web site, your url to the site will be http:// machinename/sitename or http:// localhost /sitename
In the other case you will host your site directly on a specified port or you can even host it under :80 port, and will be accessible directly through your machine name. Choose the application pool that is in integrated mode with supported version of 4.0 and you won't have any problems ( usually default app pool is configured with these settings)

Related

ASP.NET webapplication deployment - with domain / server name access

I have deployed my ASP.NET web application on IIS (windows 2008 server). I have created a virtual directory (named TestApp) and all the users on local area network are accessing it with the following URL.
http://"SERVERNAME"/TestApp/Default.aspx
My client wants that, it should be accessed as following URL
http://"SERVERNAME"/Default.aspx
There is single application deployed on the server.
Could you let me know how can i implement this thing??
Instead of adding a virtual directory on the existing site, you need to add a new web site
Create a Web Site (IIS 7)
In fact, it's fairly simple.
Remove your current app, including all files and settings in IIS (i.e.: delete everything).
Run the deploy wizard again, BUT be carefull of the path that it's given to your application: by default, you should see "http://SERVERNAME/TestApp/". Remove "TestApp". The wizard will show you a warning message, just continue.
Finish the wizard as usual, and voila!
I did this 2 or 3 times yet.

How to set up a asp.net application on IIS

I've copied a whole folder which keeps a website inside from a web server to another computer.From the original server I can easily run the web application. Now I need to know what exactly I have to do in order to be able to run the application on the second computer too. I think there are some special considerations with IIS. What and how do I have to set up in IIS?
Follow these steps.
create a new site from left menu By right clicking and add new website.
Give physical path to that folder
Map with the site url
Give permissions to Directory as (like everyone)
Set up the default page if (index page is not present in the directory)
Set framework which ever you are using.
Install the IIS Windows component for whatever version of Windows you're using.
Create a new site in IIS
Point this new site to your web root
Configure DNS for the site (maybe using your hosts file)
There are some considerations to make depending on which version of IIS you are using. It would be helpful to know if you are using 6 or 7.
If you are under 7, you need to copy the site to your IIS directory (typically wwwroot) and then setup the basic settings in IIS by choosing your application pool and such. Application pools are typically (but not always) setup by .Net Framework. You may need to setup your default page and set it as an application. There are many blogs and sites out there that will tell you how to setup this basic functionality but are specific to your application.
For configuring IIS
1. Firstly, in Programs and features go to Turn on and off windows features...in that tick everything under IIS..go to sub folder and tick everything everywhere
Go to Internet Explorer> Setting> Internet Options> Advanced> untick Show friendly http error messages option
Go to IIS manager
a. In default application pool> advanced settings > Set true enable 32-bit program option
b. Go to Asp> setting> expand debugging properties> there will an option of error messages some 2nd last or last option that would be false...set it to true..apply changes
Run vbscript and asp only in Internet Explorer (edge 10 in developer options for pop ups)

Is it possible to run ASP.NET in IIS 7.5 without creating Virtual Directories or Applications?

I have a Continuous Integration server with dozens of ASP.NET applications hosted on IIS. Everytime I want to deploy a new application, I have to create a new Website or virtual Directory and configure it as an application in IIS.
I would really love to have only one website listening in a specific port (say, 80) serving multiple ASP.NET sites according to wildcard host headers.
For instance:
*.dev.mydomain.int -> my server's ip address (eg: 192.168.1.32)
IIS web site reads the host header and try to find a local folder with the same name. Ex: when a request uses the host header "helloworld.dev.mydomain.int" IIS tries to open a preconfigured folder appending the host header site name (e.g: D:\dev\helloworld)
IIS serves the contents of the folder as an ASP.NET application, using preset configurations (Application Pool, ASP.NET version, and so on).
My goal here is not to create a web site or virtual directory for each and every project in our CI server. I know I can create them programmatically, but I'd prefer a more dynamic solution.
Thanks in advance
You can use MSBuild tasks to create Virtual Directories / Web sites automatically.
http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html
I had it working on a large application with many branches (we had an environment for each branch) and I didn't have to open IIS settings at all. Just pure hands-off process.

How to hide directory list in ASP.NET 3.5?

I have a ASP.NET 3.5 web site, which is password protected (form authentication). But yesterday I found I was able to browse the list of directories (which is unexpected).
I searched the web, one article said we need to config it in IIS. But I'm a developer and I'm working on my local machine (no IIS installed).
My question is: are there any way to hide them other than IIS configuration? like set web.config?
This must be configured in your webserver - you cannot handle this in the website itself. Since you are working locally it shouldn't matter that the root directory is browsable. If you need to be able to control the site in this way you really ought to set up a webserver.
if you don't have IIS, you're likely working on your local ASP.NET development server (called Cassini possibly?), in which it is only available locally, so no security worries there.
When you deploy your app, you will likely be on an IIS server, so the configuration will be available
Directory browsing in IIS is controlled in the virtual directory/site configuration.
When you deploy your application to a real server you can configure directory browsing there.
Directory browsing on your local machine shouldn't matter, but this may work for you.
In IIS6: http://blog.crowe.co.nz/archive/2006/03/18/603.aspx
In IIS7: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx
In IIS - Website properties, Home Directory tab, untick Directory browsing.
In Cassini (the ASP.NET development server) I don't think it can be turned off. But the server only runs while your debugging.

Run ASP.NET application as Default Web Site on dev machine

I am trying to run my ASP.NET Web Application Project in my Local IIS Web Server instead of using the Visual Studio Development Server. It seems to only allow me to run my application in a Virtual Directory off of the Default Web Site. However, I would like to run the application in the root of the Default Web Site itself.
I go into the properties of my project, go to the Web tab, click the User Local IIS Web server radio box, and change the Project URL to http://localhost/. However, when I attempt to save, it tells me I need to configure the Virtual Directory, although I am not using a Virtual Directory.
Has anybody made this work before? Thanks!!
It sounds like localhost port 80 is already in use.
IIS creates a default web site that listens on localhost port 80. Have you disabled that before trying to add yours?
Another approach is to have your site listen on a different port, 81 for example.
So far I used a Post-Build event to copy the contents of my project to c:\inetpub\wwwroot\ and I set the Start Action's Start URL to http://localhost/. Not very elegant, but it gets the job done. I would love for somebody to include a more elegant solution.

Resources