Access website on a local IIS from a mobile phone - asp.net

I uploaded my ASP.NET website on local IIS server
I'm using windows 8.1 pro and would like to access the website through another PC and a mobile phone (windows phone or android)
I would like to know how to configure my network and my server to do though

First, both devices should be in the same network. Then hit windows key and type "Windows Defender Firewall". In advance settings, you can add a new Inbound rule. Next, select the port option and give your port number. After creating a new Inbound rule you can connect using the IP address and port. eg: 192.168.8.102:8000

appreantly my stupid bitdefender was the problem although I tried disabling it's firewall but appreantly it doesn't stop giving the last piece of himself until you completly uninstall it
thanks again for trying to help

you have to find your iis machines' ip address - you can use service like:http://www.whatismyip.com/
open your firewall port for whatever port you set for the website in iis. (Firewall port opening tutorial:http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7)
then on your another pc or mobile, just navigate using the ip you found on setp 1 with the port number you set on iis.

I was using MachineName:Port, thus was not working. When using MachineIP:Port it works, however. I found that mobile cannot resolve the ip of machine using its name, as a normal PC can do (PC's Chrome works using machine name, but Android's one does not work unless using explicit IP).

Related

How to access my localhost website from my phone?

Good day to all,
I am trying to create my website locally, and perhaps access the website through my phone from the localhost. Forgive me I am just a beginner.
So I used ipconfig -all to find my IPV4 address and it was e.g
192.168.1.102
And on the ASP.net webapplication I ran, the address was:
https://localhost:44337
Hence, I was trying to access this Web Application of mine created on my PC, to be accessed on my phone. On my phone, I entered the address:
192.168.1.102:44337
I went into my firewall setting to add a new rule for inbound connection to allow all ports to be connected as well. But it still don't work. Both my PC and phone is connected to the same wifi.
Does anyone know the fix? Thank you in advance.
You might have to configure an IIS server. This tool comes default in Windows (professional?), and there's lots of good resources on how to do this, all of which do a better job of explaining the process than I could do.
Essentially, you will need to:
Publish your site (Done through visual studio or cli)
Enable and configure your IIS
Create a new website in the IIS manager and point it towards the output of your web app publish
After opening the neccessary firewall ports, check to see in which IP address your web application is running. I am assuming you are using some sort of HTTP webserver software like IIS(windows) or Apache(Linux). In IIS to do that you must go to your site bindings and where it says "IP Address", select "All Unassigned" (NOT localhost or 127.0.0.1)so that the web application runs in all network adapters and IP addresses.
See full IIS documentation here: https://learn.microsoft.com/en-us/iis/get-started/getting-started-with-iis/getting-started-with-the-iis-manager-in-iis-7-and-iis-8
Follow the guide: https://medium.com/#manujsdeveloper/debug-a-website-local-or-remote-hosted-on-an-android-mobile-device-ff2c43527be1
You will need to set your phone in developer mode and get the OEM USB driver specific for your phone. and get a ADB running on your computer
I suggest supplement your knowledge with with links below, as some things are left out in the above guide and vice versa:
https://developer.android.com/studio/command-line/adb
https://developers.google.com/web/tools/chrome-devtools/remote-debugging

Unable to call ASP.NET Web API hosted on IIS 10, Windows 10

I have created ASP.NET API endpoints on my Windows 10 PC, hosted on IIS. Using Chrome's extension app, Postman, I could call the API internally within the same machine (using localhost and even my own local IP). Example:
http://localhost/UserService/api/user/getByUsername?username=abc
and
http://192.168.0.160/UserService/api/user/getByUsername?username=abc
Then I tried using another PC (Windows 7) to connect to the same Wifi LAN that my Windows 10 PC is connected to, and attempted to call the above example URL via Postman, but it did not get through (getting "Could not get any response"error). The Windows 7 PC could not call API hosted on Windows 10 PC.
However, when I reversed the setting ie to host on Windows 7's IIS (version 7.5) and used Windows 10 PC to call instead, no issue found.
What went wrong?? Is it due to some Firewall settings?
A few things to check in Windows Firewall with Advanced Security:
Have you enabled the World Wide Web Services (HTTP Traffic-In) rule
in Windows firewall exceptions?
Do you have any entries in the Remote Computers tab?
Is the action Allow the connection?
What is the content of your Advanced tab like?
EDIT
Based on your comments, the issue is indeed a firewall issue, but not Windows Firewall with Advanced Security. McAfee firewall is blocking external access to port 80. Add an exception to McAfee to allow port 80, and possibly 443. Consult McAfee's knowledge base.
With great help from #reckface, the root cause is found, which is in fact the McAfee antivirus itself. After exploring around the UI, I found the setting to allow incoming traffic for certain port(s) without needing to turn off firewall setting entirely.
With "Web Server (HTTP) Port 80" enabled on the UI, I can now access API's from another PC.

IIS 7.5 running on Win7 Pro - access through a port other than 80 or 8080

I'm not sure I can adequately explain my dilemma, but here goes...
Our company has its own web server at xyz.com. I have a Win 7 Pro machine running a non-HTTP server program that communicates with an iPhone app used by our field crews. The path to this machine from outside the network is abc.xyz.com, and it's set for port 5000. The app, then, is programmed to exchange data (ASCII only) with the server at abc.xyz.com:5000. The server program is written in VB, and the system works very well like that.
What I would like to do now is to add IIS to this same machine and open it on port 5001, so I can run asp.net pages that will enhance the functionality of the app for our crews. The URL would be abc.xyz.com:5001, and they will access it through their phone browsers.
I have IIS 7.5 installed on the machine, and I have started it running with the "default web site," and I have the binding set for port 5001. So far I am able to access the IIS "Welcome" page only from the same machine. I can't get it to come up on any other machine either inside or outside the network.
In searching for clues for this problem, all I read indicates that it's pretty much a snap to get a web server running on your Windows 7 machine. But it hasn't been so much a snap for me. I've checked the sharing settings and the security settings, they seem to be ok, as best I can tell.
I am hoping that someone will help me identify some obscure setting somewhere that I am overlooking and get this going. But I also even wonder if this is something that can't be done, i.e. because there's another server program using the same path running on port 5000.
By the way, I am not the network administrator. I try to avoid getting him involved because he's difficult to work with. I am hoping that this is just between me and my server.
Thanks for any insight anyone can give me.
You mention that you can access the website from the machine itself on port 5001, but you can't access the site from another computer within the same network - this suggests to me that the Windows 7 built-in firewall is blocking the request - as it's a non-standard IIS port.
You should configure the firewall to allow incoming requests on port 5001. Open a command prompt (as administrator) and run the following:
netsh advfirewall firewall add rule name='IIS Website on Port 5001' dir=in protocol=TCP localport=5001 action=allow profile=any
I found the answer elsewhere on StackOverflow. I needed to add IUSR to the list of authorized users. So far I have tested it on my iPhone browser using 3G and it came through. Seems likely that it will work from anywhere, but I'm not yet ready to declare total success.

Can't open site other than on the port 80

I installed on my server, a Bug tracker which is accessible through port 3000 (http://myserver:3000).
Every thing is ok on my server, i can access to my web application any time, but in my job's computer, i cannot even connect to this application and no other web application which run on different port other than 80.
I have added a role on the windows Firewall settings by letting connection to and from port 3000. But same result.
If some one have a solution to this, i'll be thankful.
Best Regards
Is it possible that your work network is blocking your home machine. Can you ping your home machine or access it with its ip address? When you type
http://myserver:3000
are you doing this from the local intranet? If you have your bug server on your home machine then you won't be able to access
http://myserver:3000
from your work machine without a fully qualified domain nae or ip address?
If the above answers are all resolved then whenever I have such difficulties on windows, I do the following. If you don't have admin rights you might not be able to do this.
temporarily disable all firewall/antivirus programs.
Start web server listening on port 80 (on your home machine)
Access from a different machine if this works then
Start web server on 3000
Access from a different machine.
If it works then it is a matter of finding whether the problem was that the web request was being blocked by the firewall or antivirus. In your case it appears it might be the antivirus. To confirm disable all antivirus for a moment.
Make sure you turn your antivirus/firewall back on once the problem is diagnosed!

Cannot access web application (Internet Explorer Can Not find this Page) remotely

I have Deployed my Asp.net web application on IIS 7.0 on localMachine(Server) and it is working fine there.
But when i try to access it from other machine in LAN, It gives me error that, 'Internet Explorer Can Not find this Page.'
I am accessing it on terminals using server name address and also tried using IP address.
Even I have Shared the Application Folder in network.
Check the Windows Firewall on your Vista PC. You need to let TCP port 80 through.
Make sure that you enable the firewall and bind to IP addresses other than localhost.
You don't need to and should not share the application folder.
This is a security risk as people on the network will be able to access the source code of the application. Also, it won't help with the problems you're having because a network share is not accessed over HTTP and so will never hit IIS and your web application. So you can turn off sharing for the folder and be safe in the knowledge that this isn't the issue.
Next, check your windows firewall and make sure incomming web trafic is allowed ("http" or "port 80").
Next I would have a look at the host headers that the site is running on.
Then maybe update your question with more detail.
Greg
You may also want to ensure that IIS is listening on the correct IP Address. This problem can occur if you switch from a LAN connection to a wireless connection (for example when taking a work laptop home).
To Check this, open inetmgr and right-click on the 'Default Web Site' node. Verify that the IP Address entry is set to the current IP of your machine.

Resources