Setup multiple Wordpress site on Bitnami - Amazon EC2

Let’s assume that you want to have and point to 2 different Wordpress instances in a sigle Bitnami - Amazon EC2 instance. This Bitnami - Amazon EC2 instance has also been installed with Wordpress already.

Configure Apache to accept 2 domains

Make sure to uncomment (delete the # character in the beginning) this line in /opt/bitnami/apache2/conf

	Include conf/extra/httpd-vhosts.conf

Go to directory /opt/bitnami/apache2/conf/extra and edit file httpd-vhosts.conf:

cd /opt/bitnami/apache2/conf/extra
vi httpd-vhosts.conf

as follow:

<VirtualHost *:80>
	ServerAdmin [email protected]
	DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
    ServerName domain1
	<Directory />
    	Require all granted
	ErrorLog "logs/"
    CustomLog "logs/" common

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/opt/bitnami/apps/wordpress2"
    <Directory />
        Require all granted
    ErrorLog "logs/"
    CustomLog "logs/" common

You might notice that in /home/bitnami/apps directory, we also have wordpress directory. However, this is only a symlink to the real one in /opt/bitnami/apps/wordpress. Therefore, we will set DocumentRoot to /opt/bitnami/apps/wordpress as above.

Go to directory /opt/bitnami/apps and create directory wordpress2

cd /opt/bitnami/apps
mkdir wordpress2

Create a temporary index.html in /opt/bitnami/apps/wordpress2 with this content:

    <title>Welcome to domain2!</title>
    <h1>Success!  The domain2 virtual host is working!</h1>

Restart apache

cd /opt/bitnami
sudo ./ restart apache

At this point, when you go to You should see the simple text:

Success!  The domain2 virtual host is working!

Install additional wordpress instance

Create database for new Wordpress instance

Get into MySQL prompt:

mysql -u root -p

Type password for mysql when asked.

Create database for wordpress2:

CREATE USER [email protected];
SET PASSWORD FOR [email protected]= PASSWORD("password_for_seconduser");
GRANT ALL PRIVILEGES ON Wordpress2.* TO [email protected] IDENTIFIED BY 'password_for_seconduser';

Install new Wordpress instance

Download and decompress wordpress

tar xzvf latest.tar.gz

Create wp-config.php

cd wordpress
cp wp-config-sample.php wp-config.php

Copy to web root directory /opt/bitnami/apps. At this point, remember to delete formerly created wordpress2 directory.

cd /opt/bitnami/apps
rm -R wordpress2

sudo rsync -avP ~/wordpress/ /opt/bitnami/apps/wordpress2

Go to newly copied /opt/bitnami/apps/wordpress2 and edit wp-config.php

//  **MySQL settings - You can get this info from your web host**  //
/ **The name of the database for WordPress */
define('DB_NAME', 'Wordpress2');

/** MySQL database username */
define('DB_USER', 'seconduser');

/\*\* MySQL database password* /
define('DB_PASSWORD', 'password_for_seconduser');	

At this point, you can access to, input the information above when asked to finally install wordpress.


Related Posts