Mirror a Composr site on a different server
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.
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.
I have not read through it though, but I hope it helps, in someway.
wow very nice, thank you! This looks perfect. I will give it a go and report back later.
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.
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.
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:
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;
}
5 guests and 0 members have recently viewed this.
