Acessing Apache webserver behind a port foward

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
toastedtcakes
Forum Newbie
Posts: 2
Joined: Thu May 20, 2010 8:40 am

Acessing Apache webserver behind a port foward

Post 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
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Acessing Apache webserver behind a port foward

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Acessing Apache webserver behind a port foward

Post by Eran »

Is it possible the log-in is using a different port, such as 443? (for SSL connections)
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Acessing Apache webserver behind a port foward

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
toastedtcakes
Forum Newbie
Posts: 2
Joined: Thu May 20, 2010 8:40 am

Re: Acessing Apache webserver behind a port foward

Post 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 :-)
Post Reply