Skip to content →

Set up two instances of Uniform Server, each with several websites

Last updated on March 26, 2017

Print Friendly, PDF & Email

What is Uniform Server?

Uniform Server, or UniServer, is server that you  load onto to your laptop, or desktop, so that you can develop websites off line.

Moreover, unlike WAMP and XAMPP and similar local servers, UniServer does not install itself on your machine (provided you run it as a program and not as a service – it comes with both choices).  You unpack UniServer into a conventional folder on a USB, e.g. E:/UniServer/all its files, or onto your hard drive C:/UniServer/all its files.

In practical terms, if you want to move your server and its websites to another computer, you just copy the folder to a USB and then copy the folder on the USB to the next computer.  You can also zip up the folder, copy it and unzip it into a new folder on the next computer.

The importance of Uniserver is that it is a local server, private from the internet, and completely portable. You can zip it up and move it from computer to computer without worrying about installing and rebuilding your websites all over again.

What is a multiple instance of Uniserver?

The instructions for running a multiple instance of Uniserver are a little confusing.

We have two things that we might like to achieve —

First, we might want to run two websites on one copy of Uniserver.  This is very easy and I will outline the steps below. Even if you only intend to run one website, it is worth setting up two websites just to explore and understand the file structures of Uniserver.

The second thing we might want to achieve is to run two servers. We might want to run two instances of Uniserver. Or, we might want to run Uniserver and Wamp, for examples.

The reasons why running two instances of a server is an issue is that when two servers run on our laptop or desktop, they compete for the use of ports. The default port for an Apache server is 80 and the default port for our MySQL server is 3306.  When we have two servers running on our computer, they both try to access the same port.  Indeed, when we first install a server, the server often clashes with Skype and we have to adjust Skype settings so it does not try to access port 80.

Multiple instances of Uniserver, in the way its documentation describes multi-instances, means being able to run two instances of Uniserver at the same time.  To do this, we will set one Uniserver to port 8s and 3306, and the second server to ports 81 and 3307.

[Note, on my computer, I set WAMP server to ports other than 80 and 3306 and leave the Uniserver on 80 and 3306 because I expect more experienced people to use WAMP and less experienced people to be using Uniserver.]

How do I run two websites on one instance of UniServer?

1 Unpack Uniserver and Run as a Program

Once you have unpacked UniServer into a folder, e.g. C:/Uniserver (make sure there are no spaces in the name), then go to the folder and run as a program.

2 Use the menu to Start both Servers

A big blue icon with a “1” opens in your tray and a little menu box opens on your screen.

Start BOTH the Apache server and the MySQL servers.

3 Change your password for the root user for MySQL and all your MySQL databases

As soon as you have started both servers for the first time, Uniserver asks you to change your password for the MySQL server. Do so now. Apparently you can do so later, but that has never worked well for me.

Confusingly, the current password is “root” – and so is the default username “root”.  Change the password form “root” to “mysecret” or whatever.   You now have a database called “mysql” with user “root” and password of “mysecret”.

4 Orient yourself by finding the database that you have just created

To see the database, look in the file structure for “usr” and keep tracking down until you find “mysql”.

5 Make another database, if you need it, or just make one to ensure you understand the file structure

If you will be running more than one website on your Uniserver, go to phpAdmin in the little menu box and make a new database for each website.  Each website will have a user name “root” and a password “mysecret” and they will each have a folder alongside the first database “mysql”.

If you make a database just to know you can and don’t really need it, you can tidy up by going to phpAdmin and deleting the database.  Confirm that its folder has vanished from the file structure.

6 Download Drupal or WordPress or something to run your website

If you are using Drupal, download and unpack the latest version of Drupal into a folder in C:/uniserver/www/your_new_website.  Check the files are in /your_new_website. If they are in one folder below, e.g. /your_new_website/drupal-7-22 then copy the entire file structure up one level to /your_new_website.

7 Download Drupal or WordPress again into another folder

If you are running a second website on a second database, unpack Drupal, or whichever CMS you are using into a second folder /www/the_second_website.  Make sure the file structure is in this folder and not one folder below.

8 Install the websites

Go back to the menu box for Uniform Server and select www.  You will see your two websites (or folders rather).  Select the first one and follow the install instructions.

Insert the name of the database, the username (root) and your database password (mysecret). Then add the details you will use to log in to the website when asked.

Do this for both websites.

You have now installed TWO websites  on ONE instance of Uniserver which is running on the default ports of 80 and 3306

To see your websites, type localhost/your_new_website into the browser bar. Note the name after the / corresponds to the name of the folder in /www.

How do I install two instances of Uniserver?

1 Unpack UniServer software into a second folder

To install a second instance of Uniserver, we unpack it into a SECOND folder such as C:/UniServer2/all its files.

2 Change the port numbers

We start as before with

  • Run as a program
  • Change the password from “root” to “mysecret”

Now, before we continue to do anything else, select “multiple servers” in the menu box.

You will see two columns: old and new. The new settings have incremented all the old settings by one.  Select the button at the bottom right that is partially obscured. This button sets this version of Uniform Server as port 81 for Apache and port 3307 for MySQL.

Also, notice that the icon changes from “1” to “2”.

When you are running Uniform Server “1”, it has standard port settings of 80 and 3306. When you are running Uniform Server “2”, called from C:/UniServer2/, then it has port settings of 81 and 3307.

3 Set up empty databases and download website software

You can make new databases using phpAdmin, as before.

You can also download your website software into folders in /www/website_1 and /www/website_2 as before.

4 Install your website software

But now there is another important change to what you do.

When you install Drupal (and probably other software such as WordPress), state the name of the database that you made in phpAdmin. Give the username (root) and password (mysecret). Then look at Advanced Options. Leave the host name as “localhost” but now add the port number. This is the port number for the database — which in our case is now 3307.

Note well, that we usually leave the database port blank and it reverts to the default of 3306. For the second server “2” (not the first server “1”) we need to fill in the number.

Do this and continue installing as before.

One more change: when you call the websites on the second server from the browser bar: type localhost:81/your_website_name. There was no need to type localhost:80/website_name for the first server because 80 is the default port.

Now you can run server “1” which servers a handful of websites and server “2” which serves another set of websites, at the same time, because they are using different ports.  And you know what to type in the browser bars.

Turn off your UniServers

When you are finished using a Uniserver, choose the correct icon (“1” or “2”), go to the menu box, and turn off both servers.

How to change the settings of Skype

If you have Skype running and your local server will not run, then log into your Skype and go to Tools/Options/Advanced/Connect and uncheck the box ,which says use Port 80 and 443. SAVE,

Skype functions perfectly well without Port 80 and the conflict with your server is immediately resolved.

Congratulations – you are able to install UniServer into two separate folders working on two different pairs of ports. And you are able to install multiple websites on each server and tell the website which MySQL server

Published in WAMP/MAMP/Servers

One Comment

  1. […] It is quite common to install WAMP on a box that already had Skype installed – and the two clash because the both “listen” to port 80.  The answer is simply to log into Skype and uncheck the box that says listen to port 80. Skype listens to another port as well – so no harm is done.  I wrote up the steps in full for unchecking port 80 on Skype here. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: