Old:4.0-Mona: Multi-Servers

From The Uniform Server Wiki
Revision as of 12:43, 21 June 2013 by BobS (talk | contribs) (BobS moved page 4.0-Mona: Multi-Servers to Old:4.0-Mona: Multi-Servers without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 

The Uniform Server 4-Mona

Install – Multi-Servers

With the introduction of Uniform Server 4.1-Mona running multi-servers is made extremely easy using its inbuilt plugin. This plugin allows you to move the servers to different ports renaming executables and services to avoid conflicts.

Although this was possible with 4.0-Mona it required editing a number of files which was prone to error.

Why would you want to run several servers on the same PC? It allows you to experiment within a single environment and explore front and backend servers. Another use, with each server being independent you can host a single application allowing you to have a personal MediaWiki and say another with Wordpress both running from their own USB memory sticks.

Background

Unlike earlier versions of Uniform Server all scripts in 4.1-Mona directly obtain port information from Apache and MySQL configuration files. In addition executable names are not assumed they are checked at source. Hence if any of these parameters are changed they are automatically picked up allowing the servers to be moved.

Uniform Server’s security features track these changes preventing false security alerts.

Top

Running move server script

I recommend starting with a fresh install of Uniform Server (just extract it to any folder). The script reads current server configuration and increments their values these are both displayed. Incremented values are only recommendations you can override these if you wish.

Run Script:

  • Navigate to folder UniServer\udrive\plugins\move_servers
  • Double click on Run.bat
  • Press enter at each input prompt.
  • That’s all you need to do, a typical run looks similar to this:
 Current Apache port = 80         Proposed port [81] :
 Current SSL port    = 443        Proposed port [444] :
 Current MySQL port  = 3306       Proposed port [3307] :
 Current Apache name = Apache.exe Proposed name [Apache1.exe] :

 ===== SERVICE Path and Service names ====

 Current Path = c:/UniServer   Proposed path = [c:/UniServer1] :
 Current Apache name = Apache2 Proposed name = [Apache3] :
 Current MySQL  name = MySQL Proposed name = [MySQL1] :

 ===== Controller Executable name  ====

 Current = UniController.exe Proposed [UniController1.exe] :

 ===== eAccelerator  ====

 If running a single server do not disable eAccelerator.
 For multi-servers enter YES

 Disable_eAccelerator type YES or N [YES] :

 Commit type Y or N [Y] :

You can now copy this server to a USB memory stick or run the service script to install as a service.

Alternatively run it from its current location.

To create another multi-server install a fresh copy of Uniform Server v4.1-Mona and run the move script twice. Again this server can be installed on a USB memory stick, installed as a service or run from its current location.

Note 1: For each new multi-server run the move-server script appropriate number of times.

Note 2: With the exception of ports 135 and 445 the script does not check for ports in use (would lead to confusion) hence there may be a conflict, run the script again and manually enter your new values. The two ports that are checked are skipped and the next value used.

Note 3: Running more than a single server in either Basis or Disk-root mode with eAccelerator cause a conflict hence the need to disable it. However it may be enabled for all servers running as a service and one running in Basic or Disk-root.

Top

Power example

This is an extreme example however does demonstrate the power of Uniform Server Mona.

The following shows how to set-up five servers, runs two as a service, one basic on hard drive, one disk-root and one basic on a USB memory stick.

  1. Create five folders named test1 to test5
  2. Extract a copy of Uniform Server 4.1 to folder1
    1. Navigate to folder test1\UniServer\udrive\plugins\Services
    2. Double click Run.bat
    3. Let it install and run as a service.
  3. Extract a copy of Uniform Server 4.1 to folder2
    1. Navigate to folder \test2\UniServer\udrive\plugins\move_servers
    2. Double click Run.bat
    3. Press enter at all prompts (accepts defaults) – Moves the server to different ports
    4. Navigate to folder test2\UniServer\udrive\plugins\Services
    5. Double click Run.bat
    6. Let it install and run as a service.
  4. Copy of folder Uniform Server from folder2 to folder3
    1. Navigate to folder \test3\UniServer\udrive\plugins\move_servers
    2. Double click Run.bat
    3. Press enter at all prompts (accepts defaults) – Moves the server to different ports
    4. Start Servers using UniController
  5. Copy of folder Uniform Server from folder3 to folder4
    1. Navigate to folder \test4\UniServer\udrive\plugins\move_servers
    2. Double click Run.bat
    3. Press enter at all prompts (accepts defaults) – Moves the server to different ports
    4. Copy Folder test4 to a USB memory stick (alternatively leave where it is)
    5. Start Servers using UniController
  6. Copy of folder Uniform Server from folder4 to folder5
    1. Navigate to folder \test5\UniServer\udrive\plugins\move_servers
    2. Double click Run.bat
    3. Press enter at all prompts (accepts defaults) – Moves the server to different ports
    4. Copy the contents of folder test5\UniServer\udrive to USB top-level
    5. Copy test5\UniServer\UniController.exe to USB top-level
    6. Copy test5\UniServer\disk_start.vbs to USB top-level
    7. Start Servers using UniController

You now have five running servers.

Note: If you cannot remember what ports were assigned run UniControllers test facility; for services check Apache and MySQL configuration files.

Top

Manually move servers

You can move the servers manually I have included this section to provide an insight into what the move server script performs.

Configuration summary

Parameter Original configuration New Configuration
Apache port 80 81
SSL port 443 444
MySQL port 3306 3307
Apache name Apache.exe Apache1.exe
Service path c:/UniServer c:/UniServer1
Service Apache name Apache2 Apache3
Service MySQL name MySQL MySQL1
Unicontroller name UniController.exe UniController1.exe

Manually move

To move a server manually perform the following:

Service - Optional

Skip this section if you don't want to run as a service

  1. Edit file UniServer\udrive\plugins\Services\w2c1.pl
    1. Replace one occurrence of c:/UniServer with c:/UniServer1
    2. Replace one occurrence of Apache.exe with Apache1.exe
    3. Replace one occurrence of "Apache2" with "Apache3"
    4. Replace one occurrence of $res=`net start Apache2`; with $res=`net start Apache3`;
    5. Replace one occurrence of --install MySQL with --install MySQL1
    6. Replace one occurrence of $res=`net start mysql` with $res=`net start MySQL1`
  2. Edit file UniServer\udrive\plugins\Services\files\Install.bat
    1. Replace four occurrences of Apache2 with Apache3
    2. Replace three occurrences of MySQL with MySQL1
  3. Edit file UniServer\udrive\plugins\Services\files\Uninstall.bat
    1. Replace two occurrences of Apache2 with Apache3
    2. Replace three occurrences of MySQL with MySQL1

Required changes

  1. Edit file \udrive\usr\local\php\php.ini
    1. Comment the following lines as shown:
      ; extension=eaccelerator.dll
      ; eaccelerator.allowed_admin_path=/home/admin/www/plugins/eaccelerator/control.php
      ; eaccelerator.debug = 0
  2. Navigate to folder UniServer
    1. Rename UniController.exe to UniController1.exe
  3. Edit file UniServer\udrive\home\admin\program\unicon.txt change text from UniController.exe to UniController1.exe
  4. Navigate to folder UniServer\udrive\usr\local\apache2\bin
    1. Rename Apache.exe to Apache1.exe
    2. Create a new file named unicon.ini
    3. Edit file unicon.ini and add this section:
      [APACHE]
      Apache3.exe
  5. Edit file UniServer\udrive\usr\local\apache2\conf\httpd.conf
    1. Change Listen 80 to Listen 81
    2. Change two occurrences of ServerName localhost:80 to ServerName localhost:81
  6. Edit file UniServer\udrive\usr\local\apache2\conf\ssl.conf
    1. Change two occurrences of 443 to 444
  7. Edit file UniServer\udrive\usr\local\mysql\my.cnf
    1. Change two occurrences of 3306 to 3307
  8. Edit file UniServer\udrive\home\admin\www\redirect.html
    1. Change http://localhost/apanel/ to http://localhost:81/apanel/

Top

Summary

When manually moving a server although there are a number of steps to perform it is relatively easy.

Using 4.1-Mona's in-built script it is extremely easy to move a server requiring just a few key presses.

Top