2

I have an Apache HTTP server that serve few named based virtual host in LAN environment.

For example:

www1.local.mylan.com
www2.local.mylan.com
www3.local.mylan.com

The local.mylan.com is not public domain but is a private domain managed by local named service. I may access those url in PC's browser in the local LAN.

I wish to setup port forwarding in my internet router/gateway to allow remote user to access these site, is it possible to do so?

Something like this is good enough:

mylan.<dynamic-dns>.com:8001 -> www1
mylan.<dynamic-dns>.com:8002 -> www2
mylan.<dynamic-dns>.com:8003 -> www3
2
  • I'm no Apache expert, but it'd probably help if we knew which router you had for the forwarding part.
    – slhck
    May 28, 2011 at 10:27
  • I am using Buffalo ADSL wifi router. Model: WBMR-HP-GN. May 28, 2011 at 13:12

2 Answers 2

2

You can check out this question and answers for setting up port forwarding:

What is port forwarding and what is it used for?

You can forward those incoming ports (8001, 8002, 8003) to your web server.

In your server configuration add Listen lines for each port:

Listen 8001
Listen 8002
Listen 8003

Add <VirtualHost> configurations, using the new port and all the same settings as the original site. For example:

<VirtualHost *:8001>
  ServerName mylan.<dynamic-dns>.com
  [settings from www1]
  ...
</VirtualHost>
0

Most dynamic DNS providers allow you to configure subdomains, which means you should be able to use:

www1.mylan.<dynamic-dns>.com
www2.mylan.<dynamic-dns>.com
www3.mylan.<dynamic-dns>.com

Some even allow wildcards, so you can configure it such that any subdomain of mylan.<dynamic-dns>.com will go through to your home network.

Once you've configured your dynamic DNS service properly, just forward port 80 in your router configuration and add ServerName directives for the dynamic DNS hostnames to your existing Apache <VirtualHost> sections. If you used a wildcard setup, make sure a default virtual host is configured properly so that you don't inadvertently offer something on the public Internet that you don't want to.

Note that some residential Internet service providers block port 80 inbound to their customers, so you might have to use an alternate port anyway.

1
  • Do you have any ideas which dynanic DNS service has such options? May 29, 2011 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .