Using Joomla Bitnami Stack as an example
[This applys only after a Bitnami stack package installation in your local environment. Can be appropriated for any Bitnami Stack like Wordpress or Drupal for both Wamp, Mamp or Lamp installations]
Rename the Joomla! application folder. We are going to use joomla1 in this example. The sudo command would be only necessary if you installed it as root user (what happens in Cloud images and Virtual Machines). The /opt/bitnami path is the installation path in Cloud Images and Virtual Machines
sudo mv /opt/bitnami/apps/joomla /opt/bitnami/apps/joomla1
After that, you need to modify the joomla configuration files for Apache (in /opt/bitnami/apps/joomla/conf) to use the new path.
/opt/bitnami/apps/joomla1/conf/httpd-prefix.conf
Alias /joomla1/ "/opt/bitnami/apps/joomla1/htdocs/"
Alias /joomla1 "/opt/bitnami/apps/joomla1/htdocs"
Include "/opt/bitnami/apps/joomla1/conf/httpd-app.conf"
/opt/bitnami/apps/joomla1/conf/httpd-app.conf
....
<Directory "/opt/bitnami/apps/joomla1/htdocs">
...
Include "/opt/bitnami/apps/joomla1/conf/htaccess.conf"
/opt/bitnami/apps/joomla1/conf/htaccess.conf
<Directory "/opt/bitnami/apps/joomla1/htdocs">
/opt/bitnami/apps/joomla1/conf/httpd-vhosts.conf (just in case you want to use VirtualHost
...
DocumentRoot "/opt/bitnami/apps/joomla1/htdocs"
Include "/opt/bitnami/apps/joomla1/conf/httpd-app.conf"
...
To finish with the Apache configuration, we have to modify the path in the /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf file
Include "/opt/bitnami/apps/joomla1/conf/httpd-prefix.conf"
In case you are using VirtualHosts instead of prefix, comment the line above and add the following line to /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf
Include "/opt/bitnami/apps/joomla1/conf/httpd-vhosts.conf"
MySQL Configuration
Now open phpMyAdmin (check this wiki entry to know how to access it remotely), select the bitnami_joomla database and rename it. We will use bitnami_joomla1.
phpmyadmin2.png
Rename Database using phpMyAdmin
After that, we have to modify the database configuration in Joomla! to use the new database.
/opt/bitnami/apps/joomla1/htdocs/configuration.php
...
public $user = 'bn_joomla1';
// DB username
public $password = 'DATABASE_PASSWORD';
// DB password
public $db = 'bitnami_joomla1';
// DB database name
...
public $ftp_root = '/opt/bitnami/apps/joomla1/htdocs';
public $ftp_enable = '1';
public $tmp_path = '/opt/bitnami/apps/joomla1/tmp';
public $log_path = '/opt/bitnami/apps/joomla1/logs';
...
Finally, to let the user bn_joomla1 use the new database, we have to give him access.
sudo /opt/bitnami/mysql/bin/mysql -u root -p
Password: ****
mysql> grant all privileges on bitnami_joomla1.* to 'bn_joomla1'@'localhost' identified by 'DATABASE_PASSWORD';
Where DATABASE_PASSWORD is taken from configuration.php (public $password = 'DATABASE_PASSWORD')
Now restart the apache server so that it uses the new configuration.
sudo /opt/bitnami/ctlscript.sh restart apache
Your first joomla should be accessible using http://YOUR_DOMAIN/joomla1.
Installing new Joomla! site
Now, download a new Joomla! module from the Bitnami Website and install it in the instance. While writing this guide, the latest version was Joomla! 3.3.0. Please, change the link below for the correct one.
wget https://bitnami.com/redirect/to/35442/bitnami-joomla-3.3.0-0-module-linux-x64-installer.run
chmod a+x bitnami-joomla-3.3.0-0-module-linux-x64-installer.run
sudo ./bitnami-joomla-3.3.0-0-module-linux-x64-installer.run
Choose /opt/bitnami as installation path when asked (or your own path if you are using a native installer).
And that's all, now you have two Joomla! sites using the same Apache and MySQL servers.