Mirror a Composr site on a different server

Post

Posted
Rating:
#4666 (In Topic #942)

ideas on how to make this happen

Hello,

I am thinking of creating a "mirror" of my website onto a different server mainly as a backup but also incase of earthquake problems of Japan.

Mirror site - Wikipedia

There is no noted system or method it seems.

Has anyone done this? Suggestions? Ideas?

My goal is to mirror my composr website to a remote server.

 

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#4669
I did a quick search and found this: https://www.howtoforge.com/mirroring_with_rsync

I have not read through it though, but I hope it helps, in someway.

Post

Posted
Rating:
#4671
wow very nice, thank you! This looks perfect. I will give it a go and report back later.

 

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#5339
update:

i have this working now using the "rsync", so it copies everything over but NOT the _config.php as it needs to have the proper base URL and not the cache folders. I then copy over the database as well.

I realized my mirror site was automatically using the full mirror URL (mirror.example.com)  as the canonical link so I used this as a fix:

in your main site header template change the canonical link to:

<link rel="canonical" href="https://composr.app/forum/topicview/browse/general-chat-2/mirror-composr-site.htm" />

so on the main site it does not find the subdomain "mirror" so all is good, but on the mirror site, it strips out the subdomain "mirror"

now hopefully search engines will realize my main site is my HQ and the mirror is not.
 

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#5345
That's cool.

As a note, usually during development I'll write code in _config.php to put out different settings based on hostname, like:

Code

switch (gethostname()) {
   case 'some-host':
      break;

   case 'some-other-host':
      break;
}
0 guests and 0 members have recently viewed this.