logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Hardware & Networking View previous topic :: View next topic
Reply to topic   Topic: Dynamic DNS, Apache and Port Forwarding still shows IP?
Author
wjroberts



Joined: 22 Dec 2013
Posts: 3

PostPosted: Sun 22 Dec '13 7:48    Post subject: Dynamic DNS, Apache and Port Forwarding still shows IP? Reply with quote

I figured this was the best place to post, so...

I am fairly new to server administration and I am learning a lot through this process. I recently built a small dual purpose server that hosts a website and doubles as a NAS and media frontend. Additionally, I got dynamic DNS service with noip.com so that I could access my server with a name instead of the IP address. Everything (for the most part) works just fine. When I point my browser to www.mysite.com, it works just fine. Through noip.com, I can setup port 80 redirections so that it simulates going to that port from a subdomain name. The issue that I am having is that the name resolves just fine in accordance with the DDNS service on noip.com, but it immediately switches back to the IP address in the address bar on any browser. (for instance, when I go to webmin.mysite.com, it goes to 123.123.123.123:10000 in the address bar). It's a little thing, but it never keeps the domain name in the address bar. I am not sure if I need to configure apache differently, add a virtualhost, or manage the ports on the server instead of managing the port forwards on my router. There are several ports that I have forwarded and through my router and have a subdomain attached to them with the noip port 80 redirect and all of them strip the domain name and go right to direct IP addresses in the address bar. I tried to simplify a drawing to help understand below.

NO-IP Dynamic DNS Service (attaches name and does port redirects for 10000, 10001, 10002 for 3 different subdomains)
|
Router (Port forwards 22, 80, 10000, 10001, 10002 from 192.168.1.90)
|
Server is 192.168.1.90

My ultimate goal is to figure out where the problem resides so that I can fix it. I am just trying to mask the IP address and make it so that when I point my browser to webmin.mysite.com, it resolves properly and doesn't go back to using the IP address in the address bar.

(it sounds crazy, but there are some networks that I use that block direct access to an IP address, and will only allow access via a domain name, that is why I am trying to figure this out).

Any help is greatly appreciated.

Will
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 22 Dec '13 8:17    Post subject: Reply with quote

If I'm understanding you correctly, you are using a web forward at no-ip to forward requests to your server on a different port?
Back to top
wjroberts



Joined: 22 Dec 2013
Posts: 3

PostPosted: Sun 22 Dec '13 8:36    Post subject: Reply with quote

Yes. And I have the "Mask URL" feature turned on, but that doesn't work out properly. Still resolves to the actual dynamic IP address (not the internal IP 192.168.1.90).
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 22 Dec '13 10:04    Post subject: Reply with quote

OK, here's what happens.

When you set a web forward, the IP address of www.mysite.com points to no-ip's server. No-ip's server receives the request from say my browser, and through the use of a Location header, tells my browser to go to your outside or WAN IP and the different port.

www.mysite.com -> xxx.xxx.xxx.xxx:8000 using port 8000 as example.

So my browser is making a second request but instead of www.mysite.com it's making it to the IP:port listed in the Location header and here is where the problem is, my browser is now requesting an IP and not a hostname which is when I will see it switch to the IP:port URL.

The way this is usually dealt with so this doesn't happen is that you create an A Record (not a web forward), say ww2.mysite.com, pointing to your WAN (dynamic) IP address. You then set the web forward for www.mysite.com to redirect to ww2.mysite.com:port.

www.mysite.com -> ww2.mysite.com:8000

This way, my browser receives a Location header redirecting it to ww2.mysite.com:port which it will then show in the address bar instead of an IP address.

Now you can also start using name based virtual hosts as well since Apache will be receiving a host header from the visitors browser with an actual hostname and not just the WAN IP.

Since this is more of a networking thing, I'm moving this post to Hardware & Networking as your Apache is barely in the picture.
Back to top
wjroberts



Joined: 22 Dec 2013
Posts: 3

PostPosted: Sun 22 Dec '13 11:25    Post subject: Reply with quote

Okay, so if I understand correctly, I can create an A Host, and then do a virtualhost based on that hostname and redirect to a different folder in my /srv directory (eliminating port forwards and displaying IP addresses and ports)?

I understand the route that you are taking with the first explanation, but I think the second route is the way I want to go (I don't want ports or IP's displaying).
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 22 Dec '13 12:13    Post subject: Reply with quote

If you are redirecting to any port other 80 for http://, 80 being the standard http port, then the port number is going to show in the address bar or the browser.
Back to top


Reply to topic   Topic: Dynamic DNS, Apache and Port Forwarding still shows IP? View previous topic :: View next topic
Post new topic   Forum Index -> Hardware & Networking