Linux – Fowarding HTTP to LAMP server through router NAT

lamplinuxnat;routingweb-server

I'm trying to setup a LAMP server at my office. I've had my website hosted through a webhost service, but i currently want to move it in so I can have more options with what i do on the server.

My environment is basicly a few small net devices (Dlink modem, router and switch), a Win2008 server, the newly setup LAMP server (which is basicly a spare PC with Ubuntu Server 8.04 installed) and a few client PCs/laptops. Both the Win server and the Linux server have static IPs. Something like:

modem -> router/firewall -> gigabit switch -> Win server
               |                   |
               |                   -> Client PCs
               -> LAMP

I've had DynDNS working previously and well, connecting to my office's network with one of their domain names. I was able to connect to the win server on port 80 and a couple of others I needed. Now I want port 80 connections to foward to the Linux server. If changed the router's NAT definition for that, but I get no response. I have the router's NAT translating another port (81) to the Windows port 80, and that works correctly, but I still can't get it to foward port 80 to the LAMP's port 80. Internally, everything works fine (I can connect via local static IP address).

So i'm thinking it could be something to do with some network or firewall setup on the LAMp server. I've been using WebMin to move around in it, and the LAMP serverĀ“s firewall setting is apparently set to "Allow all traffic".

So my question is, can anyone tell me what I'm doing wrong or lead me in the right direction?

Best Answer

Some possibilities to investigate:

  1. If you can login to your firewall, try connecting to the LAMP port 80 from that machine to ensure that your firewall can speak to the server properly.
  2. Check that your LAMP server is not filtering any traffic out. You will want to disable all firewall rules.
  3. Check that your LAMP HTTP server is really not connected. Sometimes, incoming traffic is connected but outgoing replies are not routing correctly.
  4. You may want to set the LAMP server as a DMZ zone in your firewall so that two-way traffic is allowed to flow between the Internet and the LAMP.

Good luck!