Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

and thank you for your help so far.

Here is my problem:

I have two remote dedicated servers, one webserver that runs apache, and one db server that runs mysql.

The apache server is visible on the internet of course, but the second server is only visible to the apache server because they are connected with LAN.

I need to connect to the remote mysql server through internet from my home-pc , but only apache server is visible to my home-pc. How can i setup port-forwarding from my apache server to the mysql server so i will be able to "see" the mysql server from my home-pc?

This question is a follow-up from my first question in which you answered me and helped me a lot by telling me to do "port-forwarding".

I looked over the internet, and i cant find a good how-to to do port-forwarding. I'm an experienced programmer, but have little experience on hardware and networks. I can understand though what must be done, so i just need a litle help to sort things out :)

I hope you can help me guys, Thank you in advance

p.s. machine that Apache is running is on CentOS, mysql server also CentOS. p.s2 webserver runs WebHostManager i dont know if that makes any difference or it can be made easily through this, i just mention it :)

share|improve this question

You don't. You SSH into the web server, creating a tunnel in your SSH tool that connects to the database server. You then connect to the local port with your database tool.

share|improve this answer
will the link i just posted above will do the work??? (thank you for your answer) – karman888 Dec 2 '10 at 10:40
It should. Just make sure you get the correct remote hostname and port. – Ignacio Vazquez-Abrams Dec 2 '10 at 10:41
thank you for your help. i really apreciate it mr Ignacio – karman888 Dec 2 '10 at 10:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.