How to access an ASP.NET web api that runs on localhost (IIS) - asp.net

I built an ASP.NET Web API. I run it locally from Visual Studio on IIS Express. I need to access this api from other device from another network, so I understand that it has to be hosted on the development machine on IIS, right? What I read is that:
I need to enable IIS Manager in the Control Panel (source) - DONE
Assign the IP of the dev machine to the localhost (source; source 2) - I don't see my site in the IIS Manager under Sites, only see Default Web Site. Why is that?
I assume the site needs to be hosted somehow on the dev machine, because I need to stop Visual Studio, therefore the IIS Express will be stopped and the site would not be accessible, even from localhost right?
My dev machine has a public static IP and I can access this Default Web Site successfully from outside.

You should consider your API in IIS just as any IIS App. i.e. a website.
It needs to have an IP (or a hostheader value)
Lets say api1.example.com binded in IIS with your IIS Application.
Your DNS must resolve this to the IIS machine IP.
then you can access it in that URL.
You can also just hit the machine IP running the IIS web server (on the port you added for the api - if its not :80)
See "Bindings" in IIS
See this Video : https://www.youtube.com/watch?v=I32AnqJzD58

Related

Deploy to localhost from Visual Studio

I'm working on 'asp.mvc' web site. When i deploy it to 'iis express', site is available from 'localhost:333'.
I want to deploy this site to 'iis' (and keep url like localhost:xxx), but when i change 'iis express' to 'iis', i receive an error.
How to deploy site to iis 10 from VisualStudio 2013/2015 and access it from localhost:xxx?
By default IIS, is configured for port 80. Hence by default, in IIS it can be configured as http://localhost/webapplicationname
But it can override in IIS by either editing the existing binding for specific port or create an new website with the port 444 and configure the web deploy accordingly.

Classic ASP website displays in Chrome but not in IE

I have not dealt with classic ASP for over 13 years (and IIS and ASP.NET for a while as well) and today I had to move a classic ASP website to a new server - Windows 2012 with IIS 8.5 from Windows Server 2003 with IIS6. I copied the website directory onto one of the drives (the same drive letter as it was on the old server) and went to IIS Manager and created an application for that directory.
Locally I can access the application via http://localhost/AppAlias/Default.asp and it renders in IE but when I access it remotely via http://ServerName/AppAlias/Default.asp, it does not rende rin IE, instead I get "Internet Explorer cannot display the webpage" error. When I open the same URL in Chrome, it renders just like it does when accessed locally.
I checked IIS settings on the server for ASP applications and under Basic Settings I clicked on Test Settings. Authentication uses Pass-through and it seemed fine but authorization had a warning mark on it. The message was "Cannot verify access to path E:\Pages\Test\AppAlias" and in details I found the following:
The server is configured to use pass-through authentication with a built-in account to access the
specified physical path. However, IIS Manager cannot verify whether the built-in account has access.
Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain,
and the application pool identity is NetworkService or LocalSystem, verify that \$
has Read access to the physical path. Then test these settings again.
I gave Network Service read access but still having an issue. Can anyone help?

Trying to reload project but it says the following error issue IIS web server

The URL 'http:localhost:8081' for Web project 'XXX project name' is configured to use IIS Express as the web server but the URL is currently configured on the local IIS web server. To open this project, you must use IIS Manager to remove the bindings using this URL from the local IIS web server.
It's not allowing me to reload the project..May some thing went wrong while doing IIS set up...

how to configure iis so that I can connect to my iis hosted localhost from a remote windows pc

there must be a load of questions on this but I cant get it working. I have a asp.net app running locally hosted within iis (windows 8/ version 6.2) which I can browse locally. Example below, and it works without a problem.
http://localhost:1234
I'm trying to browse this site from a windows virtual machine using remote desktop and then launching the browser on the client machine. Unfortunately this display "Internet Explorer cannot display the webpage"
any ideas why I cant get through on a remote desktop? The client has internet access obviously and I can ping the other machine (both ways). Is there an IIS or firewall setting I can configure. The firewall on the dev box (i.e. the web server in this situation) has a firewall switched on. When I turn it off I still get the same error message.
My iis authenication settings are shown below (for my website, not for the 'Default Web Site'):
On the client machine, I'm using the following:
http://12.34.56.78:1234
Thanks,
James
Try using https: instead of http: and also to access the website from other PC, you need to enable your Anonymous Authentication. And you also need to Enable the Directory Browsing from IIS settings of website.
Can you ping the ip? Disable the firewall on both machines and try.
Let me know

Allowing remote access to IIS 7.5

I have developed an asp.net web site and deployed it to IIS on my local pc. I am trying to set up my pc to be a temporary web server, but no matter what I do, I cannot access it from another machine. I just get a "Server not responding message". I have turned off the firewall and MS Security Essentials, but it is making no difference. All the other tips I have seen do not work.
The trouble is there are so many ways to go wrong here.
You are currently running IIS and not just testing in Cassini?
You can go to IIS Manager and see Default Web Site?
You can do a Browse under Actions when Default Web Site is selected?
You can get to your machine from another machine?
On your machine, can you browse to http://your-machine/your site? (Not just http://localhost).
Ensure that remote access and http access is turned off on your firewall. Are the other machines you've tested within your domain?

Resources