Main menu

Install multiple CMS for development on your apache server

This guide will show you how to install multiple CMS on your apache server. This can be used for development or customer presentations.

Step 1. Create directory and copy CMS

We are going to create a directory called ‘joomla1‘ under DocumentRoot of Apache directory.

sudo mkdir /var/www/joomla1
cd /var/www/joomla1

Now follow my guide to copy a Joomla CMS in your newly created directory at /var/www/joomla1 but substituting /var/www in my guide to /var/www/joomla1.

Now next CMS-directory

sudo mkdir /var/www/joomla2
cd /var/www/joomla2

Now follow my guide to copy another Joomla CMS in your newly created directory at /var/www/joomla2 but substituting /var/www in my guide to /var/www/joomla2

Dont forget to make apache owner of the www-directory

cd /var
sudo chown -R www-data:www-data www

Step 2. Change Apache-configuration

We have to make changes in apache ports.conf-file to listen to a few more ports.

sudo nano /etc/apache2/ports.conf

Add this after Listen 80:

NameVirtualHost *:8080
Listen 8080
NameVirtualHost *:8081
Listen 8080

You can add more ports if you like.

Next, create a separate Virtualhost-file in your Apache sites-available-directory.

cd /etc/apache2/sites-available/
cp default joomla1
sudo nano joomla1

Change the following Virtualhost entries:

port to, for example, 8080 in joomla1-file and 8081 in joomla2-file and so on, ServerName to your local ip-address, DocumentRoot to match exact location of your files, the same to Directory and :

<VirtualHost *:port>
ServerName 'your-ip-address-of-your-server' DocumentRoot /var/www/joomla1 <Directory /var/www/joomla1>

You have to to the exact same thing to your joomla2-file but change the port entry to 8081.

You need to enable the newly created virtualhost entries using following command

sudo a2ensite joomla1
sudo a2ensite joomla2

Finally, restart the Apache service to reflect new changes.

sudo service apache2 restart

Now  you can access your different CMS-sites at http://your-ip-address-of-your-server:8080 and http://your-ip-address-of-your-server:8081

Good luck