gibbonuk Posted September 6, 2011 Share Posted September 6, 2011 Ok, this is more about the method as apposed to the code but obviously related. Im currently doing it one way not sure if its the best option or not, so just need advising. I have a project where by I have multiple servers around the uk, (basic computer configured as a webhost). Each have a mysql database which holds data collected every minute. (its not alot of data, 3 rows, each a few values) Then I have a one central server here with me which has my web application hosted where the user can visit the webpage hosted on the central server and look at data from any one of the databases scattered around uk. The way in which im currently doing this is having the remote basic servers that collect data open port 3303 which allows me to directly access the SQL database from the central server, but I have a feeling thats not really how it should be done, plus it leaves an open database port available, or is it ok to do it this way? The reason I did it like this was so all code is managed here on the central server, all it is doing is collecting data directly from the servers as and when. The other option I can think of is to have a php file sit on each server that simply requests the data and saves them into an array. This file can then be INCLUDED into the webpage on the central server? So when the user logs on and wants to look at a certain servers data, it will include the remote php file which collects the data locally? This though does mean if i want to make any changes to the whole thing, I would need to somhow change all the php files that reside around the uk on the servers, not a huge deal as I can just remotly take over the servers and thansfer new files but more work nonetherless. The other way I thought would be similer to above, except dont INCLUDE it, but have the remote php file post back the data from a request. I am litterally not sure which is correct, or if it matters? Or if there are better ways Hope you help. Thanks Andy Quote Link to comment https://forums.phpfreaks.com/topic/246525-could-somone-tell-me-which-method-is-correct/ Share on other sites More sharing options...
flappy_warbucks Posted September 6, 2011 Share Posted September 6, 2011 OK, so one server connects to multible SQL servers correct? And you are worried that someone may gain access to the server. What you *could* do is set up the SQL servers so that they only accept incoming connections from your web server (and poss dev machine). this means the the SQL servers will actively deny requests from anything other then your server. Quote Link to comment https://forums.phpfreaks.com/topic/246525-could-somone-tell-me-which-method-is-correct/#findComment-1265875 Share on other sites More sharing options...
gibbonuk Posted September 6, 2011 Author Share Posted September 6, 2011 Yes thats correct at the moment. And yes i guess i am, not that the data is to any relevence to anyone and im sure would be dissapointed, its good to still include some security. How do i go about configuring it to allow only certain connections? As it stands all i would need is my one central server and local connections to be allowed. Is there a guide, the server setup is somthing ive learnt as ive gone on. Thanks Andy Quote Link to comment https://forums.phpfreaks.com/topic/246525-could-somone-tell-me-which-method-is-correct/#findComment-1265878 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.