Help - Search - Members - Calendar
Full Version: Mirroring my website
The Planet Forums > Control Panels > Other
alexinfiniti
How can i have a particular account on my server mirrored on a server / hosting account elsewhere? I basically want to upload HTML updates to my SM server and have them reflected on a hosting account elsewhere?

Isn't there an SSH command or CRON job i can run to do this? In particular, is there anyway of getting the servers to share file lists and see which pages were updated and which need to be transferred?

Thanks in advance for any input on this!

icon_smile.gif
JohnT
If it's just static files, rsync will do the job nicely.

http://rsync.samba.org
alexinfiniti
thanks so much! Do you know if that can also transfer MySQL databases?
JohnT
Keeping MySQL up to date is easy to do with replication, if you can direct all of your database inserts and updates to one server. It gets a bit more complicated if you're concerned about security (which you should be).

http://www.mysql.com/doc/en/Replication.html

If both servers are in the same datacenter, and connected together directly through a second NIC card, security is not an issue. That link is guaranteed secure, since it's not on the public Internet.

If that's not the case, however, you need to look into stunnel, CIPE, PPTP or IPSec to secure the connection between the servers. MySQL 4.0 and higher also has SSL support built-in, but I've never used it, so I can't comment on it.

You could also consider using cron to do a scheduled mysqldump into a text file, transfer that file with scp or rsync, and then import it into the second server. That could get a bit messy, though.
outtasking
we are using rsync + mysql replication extensively for backup and security purposes, it works excellent.

If primary domain goes down, automatically dns switchs to secondary location and domain access continues working

regards
intel352
outtasking, would you mind outlining how you achieve such automation?

i've known it's possible for awhile, but haven't happened across any documentation to do the same thing myself.
ezClassifieds
QUOTE (JohnT)
If it's just static files, rsync will do the job nicely.
http://rsync.samba.org


Is rynch something to use instread of the WHM backup solution. I am new to this backup game. Please help. Interested in backuping up my dedic. server.
alex042
You can also do a load balancing type of scheme where you could add 'a' records in DNS for both servers and have both sites active at the same time where the DNS server should pull up one or the other. This way if one server goes down, the other site should open. But you'll want to make sure both sites are in pretty close sync or 1/2 the time people go the site, it they may get an old copy from one server or the other. (This is something I haven't tried yet, but in theory should work)
intel352
so just have 2 sites that both share the same db live or something. along with file syncronization for any physically changed files

i wonder if something like sitecopy or 'mirror' or whatever, would work.
tekprio
This will work perfectly well and is the recommendation solution, provided that the site is (mostly) static. If you have need for database access and can't afford to do replication, it can be configured with an explicit IP or subdomain name (just don't use localhost), or hosted on a separate server altogether. That way, database access and updates are at one location only. It is a simple solution for those with tight budget.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.