LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 03-23-2013, 06:46 PM   #1
dj_nexxus
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
Apache Webserver Mirror


Good day all,
I have a forum running on Slack 14 using apache, PHP, and mysql what I would like to do is have a second server on the network and mirroring the primary Server and allow me 2 options from there.

1: the ability to switch to this secondary server should something happen to the first
and
2: Share incoming load to both servers,

is there a way to implement either one or both of these features? and can someone help me get on track to doing the same?

Thanks
 
Old 03-23-2013, 07:00 PM   #2
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 49
You may want to try this Load balancing technology.

http://www.openlogic.com/wazi/bid/18...proxy_balancer
 
Old 03-25-2013, 04:53 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,251

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
I'm assumng you only have one server at the moment and that your forum uses php and MySQL.

The issue will be with the database, you'll have to ensure that you have correct MySQL replication and that your forum supports a master/slave environment. Alternatively you could point both instances of your forum at the one host and then switch to using the replicated database manually if you have a problem.

Also note that if you want to load balance across servers and your forum allows uploads you'll have to take care of them in some way or another, either by storing them in the database or ensuring your forum software can rsync to a remote server as part of the upload.

With more information on your choice of forum software I could give you some more pointers.
 
Old 03-27-2013, 01:44 PM   #4
dj_nexxus
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thank You for that great information TenTenths, My Server is Slackware 14 and I am running a phpbb board on it, at the moment it is one server, but as the userbase grows I would like to have a backup system that is a direct mirror of the one online should something happen, and just as a matter of redundancy I would also like to mirror the site, on another machine offsite, should something happen, (Lost connection, Power failure etc..) I was thinking through some sort of cron script, I could make all the servers sync to the master at regular intervals and then probably include in the script a databse backup of the master system and an immediate restore on the slave systems to keep everything up to date? not sure if that could work?
 
Old 03-27-2013, 02:18 PM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,251

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
If you're looking for a backup server rather than load balancing then it becomes easier. Your ideas about cron scripting are correct.

For your actual website/attachments/etc.
Use a cron rsync of your website folder, can do this as often as you want, but probably every 15 minutes would be OK. Exclude website log files and anything you don't specifically need.

Database has other options
MySQL replication - Good: Database is up to date. Bad: If a query breaks your database then your backup database will also get broken.
MySQL dump - Good: Can store this on the local and backup server and only read it in to your backup when you need it. Bad: Will be out of date by however long you leave between dumps.
MySQL replication with nightly dump done on backup server. - Best option, that way you have an up to date database and you have older backups to "roll-back" to.
 
Old 03-27-2013, 08:33 PM   #6
dj_nexxus
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks man, any tricks of the trade when dealing with cron? I am going to start research on using cron...
 
Old 03-28-2013, 02:08 AM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,093

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
Good cron HOWTO http://www.adminschoice.com/crontab-quick-reference
Technically, for speed and broken link recovery, use rsync http://linux.die.net/man/1/rsync (optionally over ssh) instead of dimple scp for the non-DB stuff.

Last edited by chrism01; 03-28-2013 at 02:09 AM.
 
Old 03-28-2013, 05:17 AM   #8
dj_nexxus
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks Chris, will check it out for sure, I am living breathing and eating slackware these past few nights...lol
 
Old 03-28-2013, 06:59 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,251

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Quote:
Originally Posted by dj_nexxus View Post
Thanks man, any tricks of the trade when dealing with cron? I am going to start research on using cron...
Well if you get really stuck I'll post the script I use for the website rsync, I could give you it now but where's the fun in that
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i want my own webserver with apache and no-ip baxzius Linux - Newbie 1 04-18-2010 05:13 AM
Apache Webserver on Slackware - Failed to Start Apache - 'no listening sockets .." CCTVGuru Linux - Server 4 10-11-2009 01:14 AM
Apache master and Mirror configuration purshyn Linux - Server 0 02-11-2007 12:35 AM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
Apache webserver trusouthrnplaya Linux - Networking 1 03-30-2003 11:34 AM


All times are GMT -5. The time now is 10:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration