Page 1 of 1

Acessing Apache webserver behind a port foward

Posted: Thu May 20, 2010 8:59 am
by toastedtcakes
Hi All,

Hoping some one has done this before :-)

I have a website on a server which at present is only accessed internally on our lan.
We have a dedicated colt line to our headoffice which also supply our internet access through their isp.
I have asked the IT chap there to set up a port forward to the webserver so it can be accessed from anywhere not just internally.

If I then use the external IP that has been setup it will get to the login page but as soon as I try and login it just times out.

I'm sure I need to do some more configuring to get this to work but do not know how exactly.

If anyone could shed some light it would be greatly appreciated.

Many Thanks
toastedtcakes

Re: Acessing Apache webserver behind a port foward

Posted: Thu May 20, 2010 1:46 pm
by JakeJ
1. Does the same page work just fine internally?
2. Is the page it is supposed to go to after log in on another server?
3. Is there something hinky with your authentication that it only allows access from the local LAN? (perhaps it's trying to collect netbios info or something)

You've got to try to keep the two components separate in your mind. 1) The actual web server and how it's configured. 2)Your application and 3)Networking. Trouble shoot your problem from each of those areas.

Re: Acessing Apache webserver behind a port foward

Posted: Thu May 20, 2010 1:49 pm
by Eran
Is it possible the log-in is using a different port, such as 443? (for SSL connections)

Re: Acessing Apache webserver behind a port foward

Posted: Thu May 20, 2010 2:22 pm
by AbraCadaver
Also, do you hardcode the IP or hostname in the code via headers, links or form actions? These would definitely not work from the Internet:

Code: Select all

// login successful
header('Location: http://10.10.1.115/success.php');

Code: Select all

<!-- login form, submit to authenticate -->
<form action="http://web-server/authenticate.php">
If you use some internal DNS and you have 'web-server.example.com' pointed to '10.10.1.115', then you could add an external DNS record to point it to the public IP that is forwarded to 10.10.1.115.

Re: Acessing Apache webserver behind a port foward

Posted: Fri May 21, 2010 6:24 am
by toastedtcakes
Thanks for all the replies, very useful indeed.

I believe it could be the fact I have hardcoded the IP into my code. I am confident the network side of things is ok now, spent some time last night running tests and checking configs on our side and the belgium side.

Many thanks for all your help everyone, I'm off to try again :-)