# apache2 / port forwarding woes [solved]

## Lunpa

well, to be honest, I don't know what is causing such a problem, but here is what it is:

I have apache2 running on my main box (lets refer to said box as "aeva").

I have aeva behind a router/switch (acts like a router, but the ports behave like a switch)...

The router is configured to forward port 80 (amoungst others) to aeva.

For some reason when pointing my browser to my global ip in a web browser, the port isn't forwarded, and I get the router's config page instead of my web site.

Now, as some background, I recently switched from debian to gentoo, and apache worked just fine in debian (though a few important things didn't ;).  I also have not touched the router config since then, so I suspect its something local.

Localy, I had and fixed a domainname problem, as similar to the one in this post.

for apache2, I emerged it, ran the rc-update command, added the ServerName variable to the end of my http.conf, and have since rebooted.

Any ideas as to where I botched?

[edit]

even wierder, I put myself in dmz, and it acts the same still...

however, I asked a friend who is outside of my network to point his browser to my global ip address, and he sees my site normaly (besides the fact that I have to figure out the cgi-bin again)... that is with AND without the DMZ enabled.

So, while others see my site normaly, why can't I, with the exception of local ip/ loop back?

Normaly, to get to the router's config, I'd point the browser at the network ip (192.168.1.1), and to see my site I would use either the loop back, aeva's network ip (192.168.1.2), global ip, or dns name.

why would this be different now?

----------

## dev-urandom

Thats the way that it works. The public ip belongs to your router. If you ping it from outside or inside, you'll hit the same router. So when you try to reach the public ip, you'll be hitting the router's config page. 

If you really want to see how your pages look from the outside. one workaround that you can try is to add the public domain name of your roueter to aeva's host file somethnbg like 

```

192.168.0.3 aeva someone.com 

```

That way, your apache virtual host (assuming you have that setup) would be happily serving you the same content as the rest of the world. This works for multiple domain names, so its worth the time setting up  :Wink: 

----------

## humbletech99

If you're pointing your browser at the public ip port 80 and it gets the router config page instead of getting forwarded to the server, it would appear to be a problem with the router. I would double check the router configuration anyway, since this is where the buck seems to be stopping.

----------

## Lunpa

well, thats intresting...

I changed the line in my /etc/hosts from

```

127.0.0.1          aeva.scribblecafe.org      aeva      localhost

```

to 

```

127.0.0.1         aeva       scribblecafe.org     localhost

```

to see what would happen, and now in the login for my consoles, it says something like "this is aeva.(none) at linux <version stuff>", but the web browser works as I would expect it to:

network ip of router = config page

global ip address = forwarded to aeva.

So, how do I get to have both; the domain thingy showing up in things like the console, and the communication with the router working in an expected way?

[edit]

hmmm, I see what happened, I just made scribblecafe.org an alias for my loopback.

also note that the global ip still points to the router for me  :Sad: 

----------

## humbletech99

ok, so after you undo this change to hosts you'll get your console thingy back, now on to the other:

I'm almost positive that this is a problem with your router configuration. Have you tried switching off the http on the router on the external interface? If all else is correct, maybe it's getting there first and stopping it on the external interface (you don't want it there anyway, do you?).

What router are you using?

Also, is it possible for you to browse from any other machine to your public ip and get the apache server? If it's just this one machine (which would be strange) then you could always just cheat it with the hosts file.

----------

## Lunpa

hmm, upon close examination, restoring my backup of the router's last known configurating fixed it.

odd... I wonder how it got broken in the first place?

Well, none the less, thanks much for the insight  :Smile: 

----------

## humbletech99

you're welcome, I was positive it would be the router, maybe you changed something on it ages ago and forgot about it...

----------

## Lunpa

who knows ^_^

good thing I make backups! haha.

----------

