IIS intranet link directly to hard disc folder - iis-7

I'm trying to use IIS 7 to run an HTML5 app via localhost directly out of the folder of the GIT repository where I am developing files (e.g. I go to [ip address]/myApp and it runs C:/git/myApp/index.html).
So I set up a new web site in IIS that has the following advanced settings:
Application Pool: myApp
Bindings: http:*:80:newAutoDemo
ID: 2
Name: myApp
Physical Path: C:/git/myApp
Physical Path Credentials Login type: Interactive
Start Automatically: true
However, when I try to go to [ip address]/myApp, it looks for files in C:/inetpub/wwwroot/myApp instead of my GIT directory (throwing a 404 error). Any idea how to fix it so that it links directly?
Note: I would like this to run on other computers on the same LAN as well as the computer with IIS running.

A new WebSite in IIS means that it's no longer under the default http://localhost/ site. Looks like you've got it set up to respond to http://newAutoDemo, so you'd need to make sure your DNS points that domain name to this IP address (if you're testing from a single machine, you can do it in the hosts file).
If you want to access it as http://{ipaddress}/myApp, then rather than creating a brand new website in IIS, you'll just want a new virtual directory or application underneath Default Web Site.

Related

How to create Application in the IIS Default Web Site root (virtual path : '/')?

Context
I have an Asp.Net MVC application. I would like to deploy it to an IIS (Windows Server 2016). I do not care which will be physical path, but I would like to access to the application in the virtual path '/'
(I am using Package web publish method, because no online access to the server, but I think this question is on IIS/ASP and not about publishing. I clearly miss some basic concept about IIS/ASP.)
What I've tried
1) When I try to create an Application in IIS then the dialog forces me to add an application Alias, which becomes the part of the virtual path. So regardless the physical path now the the url will be
myserver/myapp/mypage instead of myserver/mypage
which is not what I want. I would like to access to the page as myserver/mypage
2) If I simply deploy the app under wwwroot then it will appear as myserver/mypage it seems to be working, but where is the "Application" this case? (see picture).
Question
Maybe I missing something: Is this the Default Web Site is an "Application" in its own right? How to configure then its Application settings? If not, then how can I create an Application which's virtual path is '/'?
If I have understood your question correctly, you want to access the application as servername/pagename. In order to do so, do not create an "application" or "virtual directory" under a "website". Instead, directly host the content under Default website. You can change its path under "Basic Settings" and point it to your content folder.
You can also create another website at port 80 and point it to the location where your content is present. However, you will not be allowed to create 2 website with the same IP-port-hostname combination. You can solve this problem further in 3 ways.
If Default web site is not in use, then instead of creating another website, click on Default website, select basic setting from right hand panel and change the path to application content folder.
If Default website is in use, then create another another website at port 80 with a hostname.
If you do not have a hostname and are accessing the application using server-name, then you will have to modify the port to 8080 or something like that.
Refer my blog - https://blogs.msdn.microsoft.com/parvez/2016/07/27/iis-bindings/ for more information about IIS bindings

publish asp.net application localy in iis

i'm trying to publish asp.net app localy on my computer:
In the iis i right-click the "sites" and selected "Add website"
In site name i wrote: www.mysite.com
Physical path: i created new folder named "www" on my c driver
Type: http
IP address: all unassigned
port:80
host name: www.mysite.com
in visual studio:
I selected build-> publish
get the message that both the built and the publish succeeded.
In "select publish target" i pressed "custom" and created new profile
publish method: file system
target location: c:\www
and still when i write the url in chrome or explorer i get url not found (the computer is not connected to the internet)
what am i doing wrong?
In IIS Manager --> Application Pools
check if your added website application pool status has been started or not?
Also check whether your .NET Framework version is 4.0 or not for added website in application pool? If not double click and change the options.
IF you're not using http://localhost, then DNS is missing.
You need to map whatever "web site name" (www.mysite.com) you used to:
your local loopback ip, 127.0.0.1, or;
whatever local IP your router/dhcp service provided your local machine), or;
if you want to be fancy and assign multiple IPs to your machine, then assign one to the site
Finally, map any of the above to your hosts file.
Hth..

How to properly map IIS / to a specific Web application

I have a server: myserver.mycompany.com
My Web server is IIS 7 on Win 2008 R2
On this server I run my app: MyApp
Currently, for the users to access my app they need to enter: http://myserver.mycompany.com/myapp
I would like to change that, and have my app accessible by entering just my server.mycompany.com
What settings do I need to adjust to make this happen?
You will need to change the binding for the virtual website. You should have the MyApp listed in the tree down the left hand side of the IIS console. Select it and then use the Bindings link of the far right side of the console.
Add your domain name and link it to the IP address of the server.
If you MyApp is already a folder underneath a virtual website of myserver.mycompany.com then you would be better off moving it out to its own virtual website
You can see more about host headers and binding them here - http://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx

Use Local IIS Web server for debugging

So I'm trying to setup a local test domain so I can have a subdomain using this article. My problem is that I can set up the sites fine in IIS and browse to files there. But when trying to setup visual studio to use the site for eg. In Project Url: http://localtest.me when I click Create VirtualDriectory I get the following error: Unable to create virtual directory. The URL 'http://localtest.me' is already mapped to a different folder 'C:\Websites\site'.
If I delete the site from IIS and allow visual studio to try create it, I get the following error: Unable to create the virtual directory. Could not find the server 'http://localtest.me' on the local machine. Creating a virtual directory is only supported on the local IIS server. But the site localtest.me poits to 127.0.0.1, which is my local machine right?
So how do I set up debugging in a scenario like this where I already created the site in IIS?
Instead of using the "Use Local IIS Web Server" setting in visual studio I always check "Use Custom Web Server" and point it at my local url. for your example localtest.me with the start url above set to localtest.me
If you still run into problems you can always get into debug mode but doing attach to process instead of F5 and selecting the IIS process.

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