Site in a Linode, database in other Linode
Hey, everybody!
Would you know a way or some tutorial on how to have a website on a Linode and your database in another Linode?
The Tom of the support team said that it was possible yes, but would not have in view some tutorial, suggested that I ask for help here in the community.
Would anyone have something to give me? Any help is welcome!
2 Replies
Hey There!
We don't have a step by step tutorial, but I'd be happy to help as much as I can.
You will want to create the DB Linode and make sure to add a private IP to both your web server and your DB server. Also, ensure that your reboot your Linode after that change and ensure that Network Helper is enabled so it can automatically configure the private IPs.
Install MySQL on the new DB server
Configure MySQL to allow connections from your web server
Locate and edit your MySQL configuration file:
sudo vim /etc/mysql/my.cnf
Locate "bind-address" within the configuration file and add your db server private IP:
bind-address = $databaseip
Force the change by restarting MySQL:
sudo service mysql restart
From there, you can configure your application/web server to communicate through DB servers private IP. You may need to make additional changes, but that should help you get started with a basic setup.
I hope that helps!