0

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.

Thanks.

Renee

rzlines
  • 219
  • 6
  • 18
  • 2
    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

3 Answers3

2

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.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
1

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

silviud
  • 2,687
  • 2
  • 18
  • 19
  • 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
  • 1
    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
  • 1
    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
-1

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