Hosting own website on iis from home Win10 computer with domain mapping - asp.net-mvc

I have a developed a web application based on asp.net mvc 4 framework and it works fine in visual studio. since we want to launch our website to public we bought a domain from the godaddy account. And in GoDaddy -> Domains -> Manage -> we mapped the domain name to public/external IP address e.g. 178.112.24.5 ( which is different from what i get in cmd-> ipcoonfig-> shows 192.168.0.2). I guess i should use the public ip addresss not the local ip address shown in the cmd -> ipconfig.
Now i created a web site under iis-> sites-> add new site -> mynewdomain -> with protocol as http, ipaddress as unassigned(default) , port as 80 and hostname as www.mynewdomain.com . But whenever i launch this site from iis, it routes to ISP router configuration login.html page(BTW i use Rogers Internet). So it also fails to launch from other network computers and chrome shows the error as ERR_CONNECTION_REFUSED.
I followed some posts on this site:
How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?
https://serverfault.com/questions/54623/sites-in-iis-not-available-externally
I tried to fix this by defining firewall rule for port 80 (selected domain,private and public ) , dnsflush and some suggestions from the above two links. But it didn't fix the issue.

You want host your app yourself, ok.
So:
1. To access your host from other networks you've open ports (80 for http and ) in your firewall, sure your local IP address will 192.168.0.2 and you can access your app from LAN on it. But others must get your external IP.
2. Next moment is your domain resolver, you must setup your Name Servers for your host external IP address.
Now what can you do:
First of all use DMZ for testing, it will be open all connections to your machine, but after testing setup your firewall and open only nessessary ports.
And if your internet provider gives you your external IP + not blocking connections you can host your application.
Sure this way of host your web site is not recommended because:
A. Windows 10 Home is not server OS.
B. You need minimum 100 MB/s Speed.
C. Not secured to use home router as firewall.
Hope this will help you.

Related

How can I access services via subdomain instead of ip + port?

I have a little server in my local network that provides several web services. Each service can be accessed by entering the ip of the server followed by the respective port.
Now I always have to remember which service is behind which port and it would be nicer to have specific subdomains forwarded to these ports. For example
ip:1234 -> foo.server.local
ip:4321 -> bar.server.local
How can this be done? I have pihole running on the server and had hoped to get this done using pihole but I was not successful.
What you are looking for is to set up a Domain Name Server (DNS). phoenixnap.com/kb/raspberry-pi-dns-server This guide should help.
You use a domain to direct to an IP:port combo. Like you could direct 123.12.12.12:8080 to some.thing and 123.12.12.12:8081 to any.address.
The domain name is arbitrary and masks the whole IP:port address.

Is there a way to get the iOS simulator to access a FQDN redirecting to my localhost?

I am running a local web server with SSL enabled that my app needs to log into. I have a domain name whose A-record is set to 127.0.0.1, which allows for local development using loopback with an nginx server with different subdomain configurations for services on the app I have hosted locally. The problem is that, in the iOS simulator, the domain resolves to the device's localhost and not my machine. I can't use the IP address of my machine because I need the domain for nginx to redirect to the proper vhost (also SSL and OAUTH would get mad).
Is there any way to use a custom DNS server for lookup in the simulator? Either that, or can I edit the hosts file to set the domain to my device's LAN IP instead of localhost? Any other ideas?

How to change IP address to host name in IIS server?

I have hosted my .Net project in IIS server and now I have the IP address.I want to change it to host name and I have already tried following steps
1) Add the Host Name in site bindings according to my existing IP address in IIS server
2) Do changes in host file(C:\Windows\System32\drivers\etc) according to the added host name
But I am getting following error when I navigate host name in browser
Bad Request - Invalid Hostname HTTP Error 400. The request hostname is
invalid.
What is the solution for this problem ??
Where did you host the IIS server? On-premise domain environment or Cloud VM with public firewall IP address?
If you are hosting the web server in domain environment, then you need to create a CNAME for your web server in DNS and set binding host header for your website in IIS.
If you are just hosting the web server in cloud VM, then you should purchase a public domain from domain provider like Godaddy and map the domain name to your Virtual machine'S public firewall address. After that, you should add host name to your IIS site. Finally, you should be able to access the website. Just remember to allow port number in firewall inbound rule.

testing mobile apps at home (IIS hosted)

I am not sure what to look for with the current problem and I appreciate your suggestions.
Basically, all I want to do is locally host a web application on IIS and access it from my mobile browser.
My web application is hosted on the local IIS and works fine on the main machine. I can use my computer name, internal ip or external ip instead of localhost to connect to the app from the main computer. But when I go to another computer (which I can see and exchange files with) connected to the same network I cannot access the web application on the main machine. I tried ip and machine name.
At work, we are connected to a Domain and I tried the same thing with the work computer. When I write my computer name or it's ip, I can access hosted app from another computer.
So the question is, do I have to have a domain for this capability and if so, Is it possible to create a local domain at a home network? What do I need to search for to get this working? Is WAMP a must?
Apparently opening the outbound/inbound port 80 from windows firewall is enough

Remotely viewing web pages served by pow.cx

Using WEBrick you could navigate to an app you were serving from another device/virtual machine by navigating to your.ip.address.here:port
Is it possible to do something similar with pow.cx?
The latest version of Pow (0.4.0) now includes xip.io support. You can read about the release here.
Here's a quick explanation of how this helps Pow serve your Rails apps across your entire local network, from their post:
Say your development computer’s LAN IP address is 10.0.0.1. With the
new version of Pow, you can now access your app at
http://myapp.10.0.0.1.xip.io/. And xip.io supports wildcard DNS, so
any and all subdomains of 10.0.0.1.xip.io resolve too.
Here's a description of xip.io, from their site:
xip.io runs a custom DNS server on the public Internet. When your
computer looks up a xip.io domain, the xip.io DNS server extracts the
IP address from the domain and sends it back in the response.
There are basically two options:
Don't use pow: run your applications on localhost as usual and access them as usual
Edit the hosts file (or local DNS) to point your server machine ip
Example accessing from a virtual windows machine:
Suppose you are running two rails applications in pow: store.dev and auth.dev, and you want to access them from a windows xp virtual machine to test them with IE, you only need to edit your hosts file to add the lines:
C:\WINDOWS\system32\drivers\etc\hosts
# Allow to access applications in pow.
# The ip address points to the host machine localhost, that usually is the default gateway
10.0.2.2 store.dev
10.0.2.2 auth.dev
And then open the IE browser to access your applications in http://store.dev and http://auth.dev respectivelly.
Specifically, no, because Pow uses the Host header of the request to determine which app you need to access. To get that working remotely, you would have to have the remote machine map the required domain name to your IP address - either with a local DNS server or by editing the HOSTS file. Both of which are possible but annoying.
The simplest thing to do in that case is to start up a standalone Rails server as you mentioned (using ./script/server or rails s depending on the version), and then you can address http://[ip address]:3000 as before.
In other words, Pow works because it intercepts your local domain resolution, something that isn't affected by (or available to) remote machines.

Resources