Setup a wordpress multisite network on AWS EC2 (3)

AWS RDS is awesome. But it doesn’t come with a database management tool. All the searching results pointed to this tutorial from Ben Kuhl.

A short summary: First setup your phpMyAdmin on EC2.

Then in the config.inc.php file, add the following line after the existing server setup or setup loop:

$cfg['Servers'][$i]['auth_type'] = 'HTTP';
    $cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = 'xxxxx.l2kj35ncj3.us-east-1.rds.amazonaws.com';

PHPMyAdmin uses $cfg[‘Servers’][$i] so that it can support multiple servers on one installation.  Having more than 1 server will give you the option to select a server when you login.  After that last you’ll want to add the following code, but of course with your own Amazon RDS instance URL.

In my case, I don’t have a config.inc.php file, so I made a copy from the config.sample.inc.php, and here is what it looks like now:

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/*
* AWS RDS server
*/
$i++;
$cfg['Servers'][$i]['auth_type'] = 'HTTP';
$cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'xxx.rds.amazonaws.com';

Then… it works like a charm!

Salute to Ben Kuhl!

Advertisements

Setup a wordpress multisite network on AWS EC2 (2)

WordPress provided the BitNami Multisite stack, but it includes LAMP stack in the install. I don’t want to mess up the existing Apache, so I decided to do the manual install. Plus, it should be more fun to DIY.

Basically the setup followed http://www.slideshare.net/mrjain/installing-wordpress-on-aws

Skipped the EC2 Setup. Setting up RDS is easy. The difference from using the EC2 MySQL is here:

Don’t make the wp-config.php from wp-config-sample.php by manually input the localhost MySQL database info.

Instead, go to the mapped URL, which is pointed to the WordPress path via Apache’s Name base Virtual Host. Then follow the screen instruction to create the config file with RDS’ endpoint address.

Then the normal wordpress site should be ready to run.

The next will be two side notes on how to manage the RDS database with phpMyAdmin and how to setup FTP users, then we will come back to the real setting up WordPress Multisite.

%d bloggers like this: