Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

For example:

The 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
share|improve this question
I'm no Apache expert, but it'd probably help if we knew which router you had for the forwarding part. – slhck May 28 '11 at 10:27
I am using Buffalo ADSL wifi router. Model: WBMR-HP-GN. – Chau Chee Yang May 28 '11 at 13:12

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]
share|improve this answer

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


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.

share|improve this answer
Do you have any ideas which dynanic DNS service has such options? – Chau Chee Yang May 29 '11 at 13:42

You must log in to answer this question.

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