In some rare cases, you may want to run two (or more) different websites on a single Joomla installation, so you will have different databases but same filesystem. The reason for doing so is to maintain just one Joomla installation (e.g. upgrade, secure, host, etc…) instead of two ore more. At first glance, this seems to be impossible, but for those who are experts in Joomla, it’s feasible. We are fortunate enough that we had this request several times before, and here’s how we accommodated it:
- We copy the all the tables, and then we duplicate them in the same database with a different alias, for example, we use jos2_ instead of jos_ as the table alias for the new tables.
- We duplicate the configuration file. The new configuration file will be an exact copy of the original configuration.php file but with the small difference that instead of using jos_ as a table prefix it will be using jos2_ as the table prefix. We also modify the $sitename parameter, and optionally the $log_path and the $tmp_path parameters.
- We get the current website using the $_SERVER[‘HTTP_HOST’] defined variable.
- We modify the file /includes/framework.php and /administrator/includes/framework.php to point to the right configuration file based on the current website.
– We modify a few Joomla settings in the database (in the new created tables) based on the client’s request (for example, changing the title of the website, etc…)
That’s it! Yes, it’s not impossible, but it’s very delicate and can take some time for testing and for ensuring that everything’s OK. Note, for changing the template, the user can login to a website and change the template, and that change will not affect the template of another website.
In case you are running into problems doing the above, then feel free to contact us, we are, as always, eager to help, and our fees are very reasonable…
How component installations are handled? Though databases are different but filesystem/folders are the same. For e.g. one component is installed on one site and is not installed on second site, and you want to install that component to second site.
Hi Dmitry,
This is where it gets a bit complicated. In your scenario you will need to remove the component from the filesystem and re-install it again on the second site (this way, it’ll be on both sites).