Jump to content

Could somone tell me which method is correct?


gibbonuk

Recommended Posts

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.