Different port make the DNS useless - windows

I use XAMPP to make a website but I have the other Website use IIS so I couldn't use port 80. So I use port 8888 at XAMPP Apache for Windows OS.
If I type HTTP:/URL (my IP):8888 I could link the website, but when I use the DNS name such as shop.example.com.tw(just example).then It's not work.
I know it need to set virtual host and name base
but the default document is use port 80
How could I make the shop.example.com.tw work by port 8888 and the client-end
don't need type shop.example.com.tw:8888

Domain Name Services (DNS) only links a (sub-)domain name to an IP address, it does not deal with IP Ports.
So the part you have listed as "URL (my IP)" would be replaced with the domain name, e.g. "something.mydomain.com". You need to still put the port number on the end because you are directing your client browsers to a non-standard HTTP(s) port. The standard ports being, of course, 80 for HTTP and 443 for HTTPS.
If you want to direct a local port to a standard one externally, you need "Port Address Translation" (PAT) which is commonly available on routers. Or you need a proxy that will do the PAT for you.
Both Apache and IIS can do such redirections.
So the transformation is done in two steps:
http://sub.domain.com:80 --> http://1.2.3.4:80
http://1.2.3.4:80 --> http://1.2.3.4:8888
DNS takes care of the first, PAT or Web Server configuration or proxy server takes care of the second step.
Below are some examples for Apache. Note that personally I no longer use Apache as I find NGINX more performant and better to configure.
Apache redirect to another port
http://www.ubergizmo.com/how-to/how-to-set-up-port-forwarding/

Related

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

java socket server hosting

I am creating an android client app connected to a Java server using sockets. At the moment I am working both on my pc. How can I upload my Java server to an online server so I can set my app to friends and test it?
I used OpenShift but could figure our how and if I can use it for what I want.
Also I looked at Amazon ec2, but they need credit card information, something that I would prefer not sharing for this.
Is there any way I can do this for free?
Thanks
Make sure you have a computer able to connect to the internet, and that can run 24/7. Then run your server on that computer, assume you run it on port 8080. Make sure that your host computer's IP address is it to static, otherwise DHCP will give it a different IP every time it connects to the router.
To allow your friends to connect, unless if they're on the same LAN as your host, you will need to port forward port 80 -> ComputerIP:8080 on your router. Once that's done, you will need to retrieve your router's global IPv4 address from it's configuration page and then send that to your friends.
If they're on the same LAN as your host, then you can just give them the IP address of your host computer.
If you port forwarded your server and you would like to get a host name, like stackoverflow.com, you're going to need to buy that from whoever owns the host name you would like to use. I don't know many details about how to update the DNS servers though.
If your server is local and you would like a host name, then just go onto your router configurations page and tell it to automatically assign each computer the default gateway as the primary DNS and then add a mapping in the router's DNS settings to map the host name to your computer's local IPv4 address. Note that not all routers support this feature.
Edit: You'll also need a good bandwidth to support multiple simultaneous connections.

GoDaddy Multiple website hosted on Dedicated Server issue

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).

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

Do we have to buy a domain to serve Bugzilla?

I tried putting my IP from whatismyip.com in the urlbase of Bugzilla but it did not work. I wasn't able to create a new account for my team mate, and he wasnt able to access the server by typing the my ip address in his browse. And surely, when I connect again, my IP address will change. Do we have to buy a www address to host Bugzilla?
You can setup a dynamic dns service, for example via http://www.dyndns.com or http://www.no-ip.com or http://freedns.afraid.org to solve the changing ip problem without buying a domain (or buying a domain as well, but it's not a requirement).
But the real problem is that your team mate cannot access the server via the current IP address which points to either a misconfiguration of the webserver (listening only on localhost?), to a firewall in between, or most likely, that port forwarding isn't set up in your router for requests coming to your external IP address to be forwarded to the machine where you have Bugzilla set up. Additionally, you must set the urlbase to your local IP address, not to the external IP address, as blak3r says.
Check http://www.portforward.com for instructions on how to do port forwarding. But don't forget that everything mentioned has to be working:
Web server listening to outside requests: This can be tested from the same internal network via the local network IP address (what you see typing in a command line console ipconfig in Windows and ifconfig in Linux). If you can connect from a different machine on the same network via the local IP address, this is solved.
Firewalls (in router and the webserver machine) accepting connections to the web server port: For firewalls in the web server, the same test as above covers it.
Port forwarding so the router forwards the requests received on the web server port to the web server machine: This gets tested in the same way as firewalls in the router, that is, you must have your friend (or yourself from the house of your friend) try to connect to the dyn dns name set up or to the external IP as reported by whatsmyip.org.
This is all assuming your test mate is not on your same network, if he is, just using the local IP address (shown via ipconfig or ifconfig) instead of the external IP address and making sure the first step is covered (web server listening to outside requests) should be enough and nothing else is needed!
You most likely do not have your port 80 forwarded to your machine which is the reason he cannot connect when using the IP that was returned from whatismyip.com.
Assuming you're on a windows box... do
Start->Run->cmd then type
ipconfig
If your address starts with 192...* or 10...* this is your Local Area Network (LAN) IP. If this is the case, then your isp provided you with a router. Look for a setting called port forwarding or "application setting" which allows you to forward all incoming traffic on your router to a particular IP address. Go into your router's configuration settings and make sure port 80 (and maybe 443 if you're using ssl are forwarded to your local ip).
The other problem you mentioned is you do not have a static IP. This is a common problem and no you do not need to buy an address. There are several sites which can provide you a free dynamic dns host. Try no-ip.org.

Resources