WordPress with one database, same domain, two identical installation on two different machine/network(ipv4/ipv6)

Here is the case:

I have already wordpress/blog installation running on httpd with ipv4.(with no ipv6 enabled).
I want everyone with native ipv6 be able accesing my blog.
I have one server already connected to ipv6 via he.net tunnel brokers on different region.

It’s also have httpd listen on both ipv4/ipv6.

So here’s what i have done.

    * I made a backup of wordpress installation on original server.
$ tar cjf wordpress.tar.bz2 wordpress
    * Copy and extract  wordpress backup to ipv6 enabled
      server.(in my case it's extracted on /var/www/html/)
$ tar xjf wordpress.tar.bz2
    * Edit wp-config.php

since wordpress using database on original server. I have to create one user, that can access the database from network.(i’m not going to explain how to do it, it’s not beyond this article scope).

define('DB_NAME', 'database');
define('DB_USER', 'user');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'ip of original machine');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
    * Create virtualhost on httpd, same as original server.

        ServerName   www.domain.tld
        ServerAlias  domain.tld
        UseCanonicalName Off
        ServerAdmin  "email@domain.tld"
        DocumentRoot "/var/www/html/wordpress/"
        CustomLog  /var/log/httpd/www.domain.tld-access_log common
        ErrorLog   /var/log/httpd/www.domain.tld-error_log

        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS)
        RewriteRule .* - [F]
    * Make sure your httpd/apache compiled with ipv6 enabled
$ httpd -V
Server version: Apache/2.0.52
Server built:   Nov 15 2008 03:52:33
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
    * restart httpd
# /etc/init.d/httpd restart
    * done

Now your blog can be accessed via ipv4 either ipv6 :)

Tags: , , ,

Incoming search terms for the article:

2 wordpress 1 database (22), 2 wordpress on one db (2), use same wordpress database on different installations (2), wordpress two themes one database (2), use 1 database for 2 wordpress blogs (1), two wordpress themes one database (1), two wordpress same domain same theme (1), two wordpress same domain (1), two wordpress one database (1), two wordpress installs using the same database (1), two wordpress blogs with the same users (1), two wordpress blogs one database (1), two domains one wordpress (1), one database two wordpress (1), using 1 database with 2 wordpress (1)

Leave a Reply