[resolved] 2 identical WordPress installs on 2 load balance servers - accessing the same db (4 posts)

  1. paswebteam
    Posted 7 years ago #

    Hello, here's what I am trying to do:

    I need to have 2 WordPress installs on 2 different servers (one on each of a load balanced server setup - no rsync or replication, all replication is manual) that access the same database and display the exact same content to the end user. How do I do this? Here's the details:

    * Both servers have a unique IP (server1 and server2)
    * All replication between servers is manual (annoying)
    * Database is on a 3rd server (server3)

    From an end user perspective, both servers have the same domain. The trouble lies where wp_options has WP_SITEURL and WP_HOME set on a domain - how does this work when you have one database but 2 identical installs accessing it? Can I just edit wp_config.php to have WP_SITEURL and WP_HOME populated based on SERVER[HTTP_HOST] ? Should I set those to the end user domain (blah.com)?

    Also from a WordPress Admin perspective, when an author logs in to wp-admin/ to create a post, is this going to matter when there are 2 different installs?

    Any help would be greatly appreciated.

  2. Matt Mullenweg
    Posted 7 years ago #

    If you want to installs serving the same content, it's easy. Just put the same DB connect details in both, it'll just work. (The only thing to watch out for is file uploads.) Both servers can serve the same virtual host, there's no need for different URLs.

  3. paswebteam
    Posted 7 years ago #

    when you say to watch out for file uploads, you mean from within the rich text editor right? (things like images, etc)

  4. BLT-FQX
    Posted 7 years ago #

    Yes, your uploaded files(like images) will be on one server, I guess.
    So you have to sync them manually.

    But I have further questions.
    Can I set two different domains to make a mirror?
    Config file must be modified, but is it possible?

Topic Closed

This topic has been closed to new replies.

About this Topic