GoDaddy Multiple website hosted on Dedicated Server issue - hosting

I'm using my friend's dedicated server where he hosts 2 of his websites to host my own, but I'm not familiar with registering domains, and I can't get my domain to point to a specific port I use so that my website doesnt clash with his. He has 2 websites that according to IIS are using the SAME PORT, I installed XAMPP so I had to use the 8080 port, how did he register two different domains for websites hosted on the same ip under the same port? and how do i point my domain to my 8080 port? (using apache)

You need to use host headers to prevent conflicts if you're sharing the same IP, else you need your own IP. With the appropriate dns settings, and host headers setup in iis, you'll never conflict with his sites (that should also be using host headers).

Related

Websockets error (Signalr2 and core) when calling a DNS from a client in the same LAN that the server

I am developing a web application with Asp.Net Core and Signalr. The problem occurs when the client is in the same LAN that the server and it tries to reach the server using a dns. If the client uses the local ip (eg 192.168.1.40) or if the client is outside the LAN (eg a mobile) and uses the dns (eg. myapp.company.com) then it works.
The server is accessed by a reverse proxy when coming from outside by the dns following the next pipeline:
1) router with static ip: from 80 to 192.168.1.35
2) IIS site in 192.168.1.35 with ARR and Url rewrite listening the dns (myapp.company.com) and redirecting to another internal server 192.168.1.40
3) Self Hosted asp.net core app in the internal server 192.168.1.40 listening port 80 and 443
to summarize again:
It works when:
1) client inside the LAN uses the server local IP (192.168.1.40)
2) client outisde the LAN (eg. a mobile with 4g) uses the dns
It fails when:
1) client inside the Lan call the dns
Notes: I've tried with asp.net 4.7.1 and signalr 2.2.1 as well and also with two types of clients (and Unity 3d app and a javascript one) just in case it was something relating to the client.
Some years ago I think I faced the same problem and it may be related to how the reverse proxy handles the NAT resolution inside the LAN but I cannot find how I fixed neither to find a solution in internet, shame on me I didn't take notes..
At the end we can survive in production as the clients will be always outside the internal LAN but it really pisses me off and I think it can helps intranet developers. I will keep trying anyway (been searching for days) and I will post anything I find.
thanks!!
take this response with a grain of salt. I just facet this with servers at home
The dns resolves to the external ip, and the router/firewall you have there does not route connections to the external ip from the inside the same way it does with external connections.
You probably either needs an internal dns entry pointing to the internal ip, or an entry in your hosts file pointing to the internal ip

Hosting Website

I'm hosting a website on Windows Server 2012 R2. I'm able to access the site with no problem via the assigned ip address and as long as I'm on my home network. However, when I try to access the site using a public ip address, it defaults to my NAS (MyBookLive).
Baffled.
Thanks.
This is intentional.
When a user connects to your ip address, any inbound requests are blocked for security. You would need to open ports on your home router (most likely 80 and 443) and direct the traffic to an internal ip address.
Even if you do this, it is very likely that it would not work. Most residential internet providers do not allow you to host web/mail servers on the internet. If someone compromises your webserver, they would have access to your entire network.
You are better off with a dedicated hosting provider (AWS, Amazon, Google Cloud).

Why is wamp Apache not allowing APIs to access my www folder?

I have a piece of code where an external API needs to access my "www" folder for images. When I load the url, "http://localhost:8001/images/1.jpg" from the browser, it does show the image. But when I access it through the code it says, "connection refused". I have turned off the firewall as well. I also tried using the IP address instead of the "localhost".That doesn't work either. Please help.
Remember the domain name localhost has a special meaning. It always means this PC, or more accurately this network cards loopback address.
I cannot access your PC from here using the domain name localhost, as it will always be looped back to my PC.
If you want an external site to make a call to your PC then there are a number of things you will have to do.
Buy yourself an domain name, you either buy a real one or use a Dynamic DNS service like dyndns.com or or noip.com
Or you use your routers WAN ip address.
Then you must amend the httpd.conf file so that Apache allows access
from all ipaddress's
Then you must Port Forward your Router so the the NAT firewall allows
external accesses on port 80 to be forwarded to the internal PC
running Apache, and only that PC.
And possibly amend your software firewall on the Apache PC to allow access from external sources on port 80

WebMatrix Host File

Is there any way to do a redirect to a WebMatrix address like you would using a host file: 127.0.0.1 localwebsite.com.
I can't use computername:2000 in the host obviously, so how can I use my localwebsite.com with WebMatrix/IIS Express?
From Stefan Schackow:
You need to tweak some local machine settings to allow IIS Express to bind to port 80. As long as you can’t use port 80, all of your local Urls will have “:port#” in the Url, which defeats the ability to run arbitrary hostnames against the web server by way of faking out DNS with your local HOSTS file.
I see there is an article on learn.iis.net that explains how to ACL http.sys to allow IIS Express (and other apps) access to port 80: http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/ The section titled “Using a Reserved Port” has the info.
Once you have done that, you should be able to do the usual tricks with the local HOSTS file, as well as configuring websites with specific host headers in IIS Express – and everything should work.
-Stefan

Servers Vs Ip address

When I say,
1000 domains are hosted on the same server.
Does it means that 1000 domains are hosted on the same IP address?
Yes. You configure the server software to correlate the host name to the right service files. This applies to FTP/WWW, etc.
A server can host either virtually by use of the same IP address with different host headers (example.com, sample.com, sub.sample.com), through the use of multiple IPs bound to the server, or a combination of both.
So to answer your question, no, having 1000 domains hosted on the same IP address doesn't mean that they have the same IP address. However, it is possible given the configuration of the sites.
Normally, yes.
There is nothing stopping you from installing another NIC and having another IP address on the machine, but typically, 1000 domains hosted on the same server will be accessible using the same IP address.
Web servers use the host header to determine which site to load when many sites are configured to use the same IP address.
It's possible, with name based virtual hosting, a feature introduced in HTTP 1.1. It causes some problems with really old (corporate) proxies that pretend to only speak HTTP 1.0 and there are SSL related issues, so in general it's not the optimum solution.

Resources