Configure IIS for upload multiple website under same domain - asp.net

I have classic asp project uploaded in the IIS 7 with ApplicationPool set to .Net framework 2.0.Now I have develop admin site for that but its in the asp.net 3.5.So I want to insert this application inside this classic asp project which is deployed.
i.e.
old classic asp have url
http://192.168.1.159:8888/profile/
and now my admin site will reflect to
http://192.168.1.159:8888/profile/admin/
but I am getting some error when I try to look in the browser and its failed to load.
How can I configure this or what setting I have to do in IIS 7 so that this will work fine ??
Thanks in advance.

You will want to configure your /admin folder as a new application.
Open IIS Manager
Expand your computer node
Expand the sites node
Expand the site you want this new application under
Right click on the /admin folder
Select convert to application
Fill in the alias box and check the physical path box
Click OK and you're done.
See here for a picture of the dialog that opens after step 6.

Related

How can I get Visual Studio to automatically attach debugger to web Site not Application?

I have a web application required to run as a Web Site (root application). This is due to it being a multi tenant application that uses the urls sub domain prefix to know which client is accessing it. I create the site in IIS 10 setting the physical path to my Visual Studio 2017 .NET 4.5 MVC application and the site works fine.
I open the web project properties and under Servers choose Local IIS setting and set Project Url to the site I just created in IIS. Visual Studio then forces me to create a Virtual Directory for the Project Url, to save it, which then creates a Web Application under the default web site. You can't set and save the Project Url without being forced to create the virtual directory.
Now when I start debugging Visual Studio attaches to the Web Application not my web site so my breakpoints never get hit. If I manually attach to the w3wp process where the web site is running I can debug. I had this all working fine prior to recently switching to Git causing me to reconfigure things and I can't recall what I did to make it work.
How can I set the Project Url on web properties page without being forced to create a virtual directory? Or how do I make VS automatically attach to the Web Site and not Web App I was forced to create?
This blog might help: How to Debug Your ASP.NET Projects Running Under IIS
If your project is a website and not a web app, then here are the steps to configure it to use IIS when debugging. This assumes you already have IIS set up and hosting your project.
In the solution explorer.
Right-click on your project node and navigate to "Property Pages".
Navigate to "Start Options" item in the left pane.
In the "Server" section make sure "Use custom server" is checked.
In the "Base URL:" field put in the address you have mapped to your project. (Usually the address you put in your hosts file)
I finally discovered that setting the Servers 'Project Url' in the web projects properties page to 'http://localhost/' does not force you to use the 'Create Virtual Directory' to save the changes. You can't even change the default port here without being forced to create a virtual directory.

How to configure IIS 7 for localhost website?

I am new in Asp.Net
I have enabled features of IIS 7 on my windows system and able to see IIS manager.
I created an application but build/run application through visual studio it goes to browser and run the application with different port number. When i stop build/run application through visual studio and again i refresh browser application could not run.
I want to run application without visual studio. How to do this.
It gives this : http://localhost:9864/
To configure IIS with a new website follow these instructions:
Open IIS manager, right click Sites (At the right menu) and click Add Website
Give the site a Site Name, The physical path on your machine, and a Host Name
There are some conventions as for what website physical path to choose you can read about it in this SO question
In Windows Explorer go to C:\Windows\System32\drivers\etc and Edit the hosts file
Add this line at the end of the file:
127.0.0.1 your-chosen-host-name-from-iis-ie-localhost.testsite.com
And save the file
Thats about it. You can open your browser and browse the Host Name you chosen for your website or in IIS right click your site and click Manage Website - Browse
Important note
If you wish to use the same address as your VS uses (http://localhost:9864/) then on step 2 leave the Host Name textbox blank and instead change the Port textbox to your desired port (9864). In this case you can also ignore step 3.
As a site note:
If you installed IIS on your machine after the VS installation you might get some conflicts. You might be able by this stage to browse to static content as html but not .NET resources like aspx files. If by browsing to .NET files you get a message saying The page you are requesting cannot be served because of the extension configuration you can solve it with this SO question

Deploy asp.net on IIS 8

I'm trying to deploy a asp.net site on iis 8 but i'm getting an error.
Site is working in visual studio, deployment is done without error using a custom profile with file system as publish method. (Here is actually my first question, should I use file system?)
Build->publish site->(Custom profile, file system, release)
Well, the site is added to selected folder which I've set up in IIS. I host several php pages from this folder whithout problem. But when I try to url forward to the new site I get this error: Given URL returns 500
I'm using IIS8, .tk adress through a dlinkddns.com adress
Any ideas?
Edit: added picture
What should I choose here if i'm hosting the page on the same computer? (I tried File system for now)
The error I get when I'm opening default.aspx
To deploy a website into IIS8 from Visual Studio, use 'File System' instead of 'Web Deploy', and put in the directory of where you want to publish your site.
Right-click your site name on your IIS 8 manager, select 'Add Application', and select the folder where you published your website in your physical path.
Click on the application under the website, then click browse, and you should view the website on your browser.
You can look at my question on how to create new website under the title, 'New website not showing default page in IIS 8.5'.

Issue with Response.Redirect and Page.ResolveUrl in ASP.NET WebForms site hosted on Amazon AWS

I have deployed an ASP.NET WebForms site to Amazon AWS to the following link ('webapp' is just a dummy name I haven't included the real url)
http://webapp.elasticbeanstalk.com
My problem is that wherever I do a redirect using Response.Redirect (for example Response.Redirect('~/Page.aspx') or create a link using Page.ResolveUrl (for example Page.ResolveUrl('~/Page.aspx'), the url becomes
http://webapp.elasticbeanstalk.com/webapp_deploy/Page.aspx
But I want it to be simply:
http://webapp.elasticbeanstalk.com/Page.aspx
My guess is that the site is located in a folder called 'webapp_deploy' on the Amazon server and the home sign '~' gets mapped to 'webapp_deploy'.
Is this a known issue or am I doing something wrong ? Are there any workarounds to this...do I need to change something in the AWS console ?
Thanks
By default, your web application will be deployed to webappname_deploy, but you can change that in the Project Properties.
In the Solution Explorer, right-click on the web project and select "Properties".
In the properties pane, go to the "Package/Publish Web" tab.
On that tab, there is a form field labeled "IIS Web site/application name to use on the destination server:"
Remove webappname_deploy, so it would just say "Default Web Site/"
Your web app will then be deployed to the root of the IIS Default Web Site.

IIS ASP.NET MVC3 doesn't show my website

So I've set up IIS 7.5 to host my ASP.NET MVC website on my own local machine, but when I surf to http://localhost/ I just get this:
Welcome to ASP.NET MVC!
To learn more about ASP.NET MVC visit
http://asp.net/mvc.
A very basic HTML page with only this on it. No CSS or anything.
I haven't used IIS before, so I don't know what settings I need to change in order for this to work, but this is what I've done:
Added a new Site "MySite"
Set the Physical path to the root folder of my asp.net project
Tested the settings (everything OK)
Edited the "MySite" Application Pool and set it to .NET framework version v4.0.30319
What else do I need to do to make my website display? Thanks.
EDIT: please read this
I'll give a step-by-step walkthrough of what exactly I do:
1) I create a new ASP.NET MVC3 Razor web project. I don't do anyting but save and build the project.
2) I open IIS Manager
3) I go to Sites -> Add Web Site
4) I fill in following data:
Site Name: MyWebSite
Application Pool: MyWebSite
Physical Path: Visual Studio 2010\Projects\MyOwnProject\MyOwnProject (Project root folder)
Connect as: My PC's login and password. Test Settings is succesful
I leave the rest of the settings as it is and press OK
5) I go the Application Pools and edit the basic settings of MyWebSite to change the .NET framework to the latest version (v4.0.30319)
6) I select MyWebSite and click Browse *:80 (http) to go the web site. It opens up Chrome and I see the following page:
<h2>Welcome to ASP.NET MVC!</h2>
<p>
To learn more about ASP.NET MVC visit http://asp.net/mvc.
</p>
That's it. Nothing more. What am I missing here?
That looks like it is working (at least that's an MVC page it is displaying.) Maybe you need to alter your default route in Global.asax.cs to hit a different controller?
Do you have a Layout.cshtml in your shared folder and is your ViewStart pointing to it?
Edit:
I do remember having an issue like this at one point. I think it has to do with static resources pointing to the root which by default will be pointing to another App in IIS. I'm not sure if this is exactly the issue but what I do is setup an address in my host file for each application. For me the host file is :
C:\Windows\System32\drivers\etc\hosts
You have to run notepad or something as Administrator to edit it and add the following line:
127.0.0.1 MySite
This will allow you to simply navigate to http://mysite without any conflicts. Just double check your IIS setting so that the hostfile address point to the right physical path.
It seems I've fixed it, I don't know how or why this works. But this is what I've done:
In Visual Studio, I went to the Properties of my project. There, in the Web tab, I selected "Use local IIS Web Server", filled in "http://localhost/MyWebSite" and hit "Create Virtual Folder".
Save and build the project and suddenly it worked. However, I am not able to debug my project from Visual Studio now. But when I change the Web configuration back to "Use Visual Studio Development Server" it still works and I can debug again...
Doesn't make too much sense because you should be able to debug from IIS right?

Resources