Server Fault is a question and answer site for system and network administrators. 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

Hello I have setup an Apache/PHP/MySQL on CentOS 5.5 with and have installed WebMin on it. I would like to take my server online. And try to host multiple sites on it for my research.

My current server is behind a router. I have 2 static Ip addresses, its bundled with the internet package that I subscribed to. Though the connection has NAT enabled because I share this internet connection with other computers. Its a hybrid network as I have DHCP enabled for a certain range on the router. And I have configured some servers to have a private static IP address for obvious reasons.

The webserver that I configured has a static private ip of 192.168.1.* , I have port forwarded port 80 to the internal IP address of the server.

My domain name has an A record assigned to it which my public IP address, but when I try to access my domain from my current internet connection I am redirected to my routers default page.

I can access the page from a proxy or another internet connection, but the page is not displayed perfectly (the images don't display at all and the formatting of the page is all messed up).

I have wordpress on the default domain (I have configured a virtual host) but all I can see is the text on the page and no pictures and the access to the page is also very slow. I have forwarded port 3306 for MySQL for the same server IP address. I can access the wordpress instance perfectly when accessed locally.

How do I solve this?

I would also like to setup a DNS server either on this webserver or on another machine, but since I am behind the router how do I configure the zones ? - with the private IP of the server or the public IP. I know that for DNS I have to forward port 53. But beyond this I'm kind of stuck. SomeOne please advise this is the first time I'm trying this out by using the documentation of Webmin, Apache, MySQL and some tutorials on the internet. So please be kind to my questions they could be a little basic but I'm kinda stuck here for sometime now.



share|improve this question
Think carefully about whether you really want to run your own DNS server. Most domain registrars provide DNS services for free with domain registration, and it's nice to have this run on a professional scale. – mattdm Dec 12 '10 at 14:52
@mattdm But if my dns servers are external how do I point it to my server, I'm a little confused here. (I know about DynDNS as an external DNS service) but the concepts not very clear – rzlines Dec 12 '10 at 15:02

Your router can't properly detect the difference between accesses to the internal and external interfaces. Either configure/upgrade your router to do so, get a router that can, or use the internal address when you're in the local network.

share|improve this answer
but why doesn't the page display correctly, when I access it externally? – rzlines Dec 12 '10 at 15:01
My guess would be that WP is using the internal address for the media. – Ignacio Vazquez-Abrams Dec 12 '10 at 15:02
Well I'm using a Beetel 110TC1 router, it was given by my ISP I do have a spare Buffalo router, should I connect my internet connection to that instead? – rzlines Dec 12 '10 at 15:06
And how do I resolve the WP problem I mean get it to point to the public IP address instead of the local one and still have local and public access? Is that possible or will it just be accessible either publically or locally. – rzlines Dec 12 '10 at 15:07
Either tell it to pick up the URL/address it's being accessed from, or use the same name both internally and externally. – Ignacio Vazquez-Abrams Dec 12 '10 at 15:09

your router runs a web server as well - the admin interface

you need to run it on a different port number then 80 how to do it is dependent on your router

from internal network it will be difficult to access your internal server going trough the router - this is because you hit an internal interface then hit the external then back to internal

is Better to access the server internally direct to his ip

share|improve this answer
but can two interfaces be running on port 80? I don't think that's possible. I have configured my webserver to run on 80 now, so how can the router be running on that port? – rzlines Dec 12 '10 at 16:44
yes two interfaces can run on port 80 because there are two different ip addresses - you can't run on the same interface the same port - the router has two interfaces (internal/public) so does your server so that makes it three - what you need is to run external router intf. on port 80 and forward to your internal server port 80, but you don't need interfere the admin gui from router to your server - so that's why is not a good idea to run in on port 80 - of course you can always change the port for your web server – silviud Dec 12 '10 at 22:51
this is a asci diag of your network (internet) --- port 80 (public-router) -- (internal-router) ----- port 80 server – silviud Dec 12 '10 at 22:52

I solved this by editing the local host file so the domain will get resolved to the IP address for the machine running Apache/Nginx/Proxy.

In Linux, the file is /etc/hosts

In Windows, the file is c:\Windows\System32\Drivers\etc\hosts

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.