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 🙂

1 Comment

  1. backup is a must. apply bugfix patches from wordpress soon as possible.

Leave a Reply

Your email address will not be published. Required fields are marked *