Results 1 to 16 of 16
-
07-07-2009, 03:16 AM #1Newbie
- Join Date
- Jun 2009
- Posts
- 22
How do I setup a site on 2 servers. 1 for mysql 1 for web?
Hello,
How do I setup a site to use two servers? One as a mysql server and the other as a web server.
At the moment I have the site on one server. When I get the second server what steps do I need to take to make this possible?
How do I secure the mysql server to only allow the web server to connect to it?
Do I need a control panel (i.e. cPanel) software on the mysql server?
Thank you for your time.
-
07-07-2009, 04:00 AM #2Web Hosting Guru
- Join Date
- Jun 2008
- Location
- UK
- Posts
- 266
well there's a lot of different ways - you don't need a control panel if you don't want one - having said that, some panels like whm let you set up a seperate mysql server very easily.
securing the mysql server would be done through it's firewall - ie you'd only allow mysql connections from the web servers IP address.WebCertain - SEO, PPC, PR - The services you need to increase your site traffic. Specialists in over 35 languages and country-specific SEO! www.webcertain.com
-
07-07-2009, 05:38 AM #3Newbie
- Join Date
- Jun 2009
- Posts
- 22
webcertain,
I just noticed WHM has the option to setup a seperate mysql server.
Now, after I have my new server, with the OS and mysql server software how do I setup the database on that server?
Thanks.
-
07-07-2009, 05:45 AM #4Web Hosting Guru
- Join Date
- Jun 2008
- Location
- UK
- Posts
- 266
well, you either ssh in and use the mysql command line, or you get yourself a mysql client (or sometihng like phpmyadmin installed on the server), to manage the database(s) with.
WebCertain - SEO, PPC, PR - The services you need to increase your site traffic. Specialists in over 35 languages and country-specific SEO! www.webcertain.com
-
07-07-2009, 06:01 AM #5Newbie
- Join Date
- Jun 2009
- Posts
- 22
OK got it. Thanks!
Any other/better mysql clients than phpmyadmin?
-
07-07-2009, 08:43 AM #6Junior Guru Wannabe
- Join Date
- Oct 2006
- Location
- India
- Posts
- 62
Hi,
As per my experience phpmyadmin is the best available app to manage your mysql databases. Simple and effective.
Once you have done with your db server, make sure that you allow access to only those users which are requesting connections from your web server. And, howto grant access to remote users to your mysql db is clearly defined over here : http://www.crazyadmins.com/forum/viewtopic.php?f=4&t=16
I hope this will be helpful for you in configuring things.Sony Koithara ,
CrazyAdmins.com -> where admins go c r @ z y!!!
-
07-07-2009, 06:36 PM #7Newbie
- Join Date
- Jun 2009
- Posts
- 22
koithara,
Yes I think that will come in handy. Thanks!
-
07-07-2009, 07:01 PM #8Temporarily Suspended
- Join Date
- Jul 2009
- Location
- SLASH ROOT
- Posts
- 26
Make sure your code on the webserver is directed to the MySQL DBs you will be putting the second server. On securing the MySQL server, you will have to allow remote connections. This being said, you could allow only connections to come in from your webserver(specifically from a single IP address even).
Further block all ports on the MySQL server, while allowing only the one that it listens on(by default this would be 3306). This could be done on any firewall.
---------------------------
Sr.Systems Engineer
WHRSS
We grow by helping you grow
-
07-07-2009, 10:36 PM #9Newbie
- Join Date
- Jun 2009
- Posts
- 22
webcertain,
One question about your suggestion about phpmyadmin. I already have phpmyadmin on the webserver. Did you mean I should install it on the mysql server as well? Thanks!
whrss2,
Thank you for your help! How do I allow connections to the mysql server only from the IP of the webserver?
Thanks again.
-
07-07-2009, 11:49 PM #10Junior Guru Wannabe
- Join Date
- Oct 2006
- Location
- India
- Posts
- 62
you are welcome...
Sony Koithara ,
CrazyAdmins.com -> where admins go c r @ z y!!!
-
07-08-2009, 10:33 AM #11Temporarily Suspended
- Join Date
- Jul 2009
- Location
- SLASH ROOT
- Posts
- 26
You can allow remote connections on the MySQL server by using the following commands :
-------------------------
These edits are to be made on the MySQL configuration file : /etc/my.cnf
Make sure this line is commented/removed :
# skip-networking
Modify the line :
bind-address=the_database_server_ipaddress
-------------------------
Now log into MySQl as the super user.
-------------------------------
$ /etc/init.d/mysql restart
$ mysql -u root -p
If you want to grant access to a new database :
mysql> CREATE DATABASE new_DB;
mysql> GRANT ALL ON new_DB.* TO *@'webserver_IPaddress' IDENTIFIED BY 'PASSWORD';
If you want to grant access to an existing database :
mysql> update db set Host='webserver_IPaddress' where Db='exist_DB';
mysql> update user set Host='webserver_IPaddress' where user='exist_DB_user';
OR
Grant access to all users from the webserver to all databases :
mysql> GRANT ALL ON *.* TO *@'webserver_IPaddress' IDENTIFIED BY 'PASSWORD';
-------------------------------
Now allow remote connections from only your web server located at "webserver_IPaddress"
--------------------------------
iptables -A INPUT -i eth0 -s webserver_IPaddress -p tcp --destination-port 3306 -j ACCEPT
iptables -A INPUT -s your_ipaddress -p tcp --dport 22 -j ACCEPT <--This is to allow you SSH access.
iptables -A INPUT -j DROP <----This would block all access to the server(Caution!!!)
--------------------------------
Hope this helps out.
----------------------------
Sr. Systems Engineer
WHRSS
We grow by helping you grow.
-
07-09-2009, 04:01 AM #12Newbie
- Join Date
- Jun 2009
- Posts
- 22
Is apache required on the mysql server?
-
07-09-2009, 04:35 AM #13Custom Hosting Master
- Join Date
- Jan 2007
- Posts
- 2,602
-
07-09-2009, 04:47 AM #14Newbie
- Join Date
- Jun 2009
- Posts
- 22
-
07-09-2009, 05:56 PM #15Newbie
- Join Date
- Jun 2009
- Posts
- 22
Thanks to everyone for their replys. The user eth1 has taken care of this and he receives my recommendation.
-
07-09-2009, 11:56 PM #16Web Hosting Guru
- Join Date
- Mar 2009
- Posts
- 254
Similar Threads
-
Synchronizing MySQL powered site across 2 dedicated servers
By nemomaritime in forum Hosting Security and TechnologyReplies: 11Last Post: 11-20-2008, 06:24 PM -
How many servers needed for a php/mysql site with 1million page views a day
By jmakhan in forum Hosting Security and TechnologyReplies: 11Last Post: 05-31-2008, 04:31 AM -
best way to mirror servers or go from one to multiple servers on a mysql/php site
By deras in forum Hosting Security and TechnologyReplies: 5Last Post: 10-01-2005, 02:07 PM -
Looking to setup new site, new to servers also...
By VilleValo in forum Dedicated ServerReplies: 4Last Post: 12-26-2004, 11:59 PM -
*Hiya Corp Hosting**NEW**Instant Setup Nocster Servers, No Setup, Servers Start $55**
By FredTT in forum Dedicated Hosting OffersReplies: 6Last Post: 10-26-2003, 10:31 AM