Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: MySQL connection issues
PostPosted: Sat Sep 27, 2008 1:33 am 
Offline
Newbie

Joined: Tue Sep 16, 2008 4:41 pm
Posts: 2
I have 2 Linodes. 1 is running Apache 2, PHP, Ruby and the other is a strict MySQL DB server and Postfix server. What I would like to know is what do I have to do so they can talk to each other via their private IP's. I want to be able to send DB data transfer over the private IP. I have already setup the private IP's and they are pingable from each machine.


Top
   
 Post subject:
PostPosted: Sat Sep 27, 2008 1:51 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
Sounds like all you have to do is configure MySQL to listen on the private interface, and then tell your PHP application that its database lives at that IP address.


Top
   
PostPosted: Sat Sep 27, 2008 1:53 am 
Offline
Junior Member
User avatar

Joined: Sat Sep 06, 2008 5:43 pm
Posts: 21
Location: Los Angeles, CA
telder4336 wrote:
I have 2 Linodes. 1 is running Apache 2, PHP, Ruby and the other is a strict MySQL DB server and Postfix server. What I would like to know is what do I have to do so they can talk to each other via their private IP's. I want to be able to send DB data transfer over the private IP. I have already setup the private IP's and they are pingable from each machine.


Since you already have the private IPs up and functionaly you need to create hostnames for each private IP (something like app.private and db.private). These should be added to either your DNS server (assuming both Linodes use the same DNS server) or the local /etc/hosts file on each Linode.

You then simply configuration your application to talk to db.private as the mysql db host.

You will of course have to allow your db user to connect to the mysql db from the private IP address of the application server (this goes beyond the knowledge of mysql that I posses off the top of my head to tell you how you would do this).

If you are paranoid you could/should then configure iptables on your DB Linode to reject all connections from its public IP address except ssh.

If you are super paranoid, you configure your DB Linode to reject all connections from its public IP address and you connect to it via Lish or ssh from the app server. You could also removes its public IP address entirely, but this makes updates a pain.

_________________
Chet Burgess


Top
   
 Post subject:
PostPosted: Sat Sep 27, 2008 4:59 am 
Offline
Senior Member

Joined: Fri Sep 12, 2008 3:17 am
Posts: 166
Website: http://independentchaos.com
I do believe there was a fellow earlier talking about his DB behind his webserver and how he secured it from the internet. Might want to take a look at that.

As for cburgess, the best idea would be to ssh tunnel from your webserver to your db server.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group