inicenter logo
Project: Home Web Server:
UniServer 3.4 logo
  Uniform Server Introduction
uniform server logo

There is no need to read this page you can jump straight to installation. However, if you would like an insight into the Uniform Server concept read on.

What makes the Uniform Server package unique is its ability to run from any folder on any hard drive this includes a USB memory drive. You can move the folder to any other location and the servers still function correctly. Let me explain why this solution is so elegant.

Problem

When installing a standard windows program you need to specify an absolute path for example a fixed hard drive letter (e.g. C, D, E etc) and a named folder (installation programmes use defaults if none specified). The installation process creates references (short cuts etc) that point to this folder in addition may set parameters in the windows registry. Other elements installed can be shared with other programmes. This program will access the registry and other shared locations for correct operation. The only way to change these references is by uninstalling and reinstalling the program to a new location. Move or rename this folder manually and the program will stop working.

Solution

Apache and MySQL are Unix programs ported to windows hence they use initialisation files (text files) and not the registry. The Uniform Server team has used this to great advantage in overcoming problems mentioned above. In addition, they use a virtual disk to run the servers. If you currently use drive W: (default for Uniform Server) you can select an alternative and run the servers from there. Now that is powerful and why I like Uniform Server.

Myth

It uses a large amount of memory to implement the virtual disk. Wrong it uses a very small amount of memory. The misconception I have seen mentioned on the Internet is that Uniform Server is loaded into and runs from a virtual RAM disk it does not.

XP, DOS and BAT

XP is a pretty user interface (OK it is a little more complex than that) just below the surface are a myriad of other goodies like the world of DOS and batch files. Batch files are text files containing DOS commands they have a file extension .bat Never seen your file extensions! Turn them on, no not that way try this: open Windows Explorer

Tools > Folder Options > View > (Un-check) Hide Extensions for known file types

XP has a unique icon for batch files the little cog symbol
Note: The cog is also shown for .cmd file extension. These command files are enchanced XP batch files.
To run a batch or command file double click on its name or icon.

Note: For backward compatiblity with older OS (Win95 Win 98) use .bat and do not use XP specific commands.

Batch files may be run from other batch files or from the command line. Ok so what has this to do with Uniform Server the answer is virtual drives.

Creating a virtual drive

All physical or virtual drives are assigned a letter A to Z. Drives letters A and B are reserved for floppy drives (now becoming extinct), C drive normally holds XP (or other operating system), D drive for CD’s, plug in a USB memory stick and it will be assigned the next letter E in this case. That leaves F to Z for any other assignment Uniform Server uses the letter W because it is unlikely to be used even in a large system eith many drives.

A virtual drive acts and feels like a real drive in reality it does not physically exist it is a mapping to a real device such as a memory stick, part of internal RAM or more importantly a folder on a real drive.

The DOS command SUBST that performs this mapping looks like this:

SUBST Associates a path with a drive letter.
SUBST [drive1: [drive2:]path] and  SUBST drive1: /D
drive1: Specifies a virtual drive to which you want to assign a path
[drive2:]path Specifies a physical drive and path you want to assign to a virtual drive.
/D Deletes a substituted (virtual) drive.
Type SUBST with no parameters to display a list of current virtual drives.

There are numerous DOS commands lets focus on how to use this one.

Using SUBST

The following quick tutorial shows you how to use the SUBST command. If you have never used a command window or batch files you learn this as well. Just follow the steps. I make two assumptions you know how to use windows explorer to create a folder, copy and move files and how to use note pad.

Command Window

Step Action Result
1 Create a folder on C drive named fred1  
2 Inside this folder create a folder named fred2  
3 Inside this folder create a folder named fred3

OK not rocket science but gives us something to work with.

4 Open a command window.

a) Click on start click on run    (A window pops up)
{Short form start > run save telling you to click)

b) Type in cmd and press OK

The window allows you to type in raw commands.

5 Enter the command

a) Type in subst w: c:\fred1

b) press Enter key

You have just created your virtual disk!

6 Look at your disks you will see one with some name and (W) next to it. Go on have a peek into it you will find:
7 You will find your drive contains one folder fred2 inside this you will find a folder fred3. More importantly you will not find a folder named fred1 because this is your top level i.e. drive W.
8 Not sure what I mean play with drive w; add some folders and files do the same with c:\fred1 and look at the results in both drives What ever you do in either will be reflected in both. However, the real data is stored on the C drive because W does not exist (its virtual)
9 Kill off drive W

In the command window (start it if you closed it see step 4)

a) Type in subst w: /D

Now look for drive W it will have been deleted.

The data on drive C will remain it was this disk you changed even if you used drive W (to add folders and files).

Thats the power of a vertual drive.

The next steps show you how to harness even more power using batch files.

Batch files

Step Action Result
1 Open windows note pad.

a) start > all programs > accessories > notepad

b) type the two lines as shown

c) Save the file as createW.bat in folder fred1

2 Look in folder fred1 you will see the file
createW.bat notice the icon that indicates the file is a batch file
3 Double click createW.bat icon this run the batch file. A command window opens displaying the instructions executed. The first instruction creates the virtual drive W confirm by looking in my computer. The second instruction “pause” prevents a command window closing until a key is pressed.
4 Open windows note pad again.

a) start > all programs > accessories > notepad

b) type the two lines as shown

c) Save the file as killW.bat in folder fred1

5 Double click killW.bat icon this run the batch file. A command window opens press any key to close it. The first instruction deletes virtual drive W confirm by looking in my computer.

With the two batch files you can create and delete drive W at will.

6 Automatically close a command window.
This is no big deal just delete the pause command in both files.
Alternatively comment the line out by
adding :: or REM at the beginning of the command.
:: pause or REM pause
The pause command is useful when debugging. It is a quick way to prevent a command closing.

Dreaded long path names
The above example was contrived in the real world the folder you want to assign would normally be deeper down in your folder structure. Typing such a path is a choir however if you run a batch file one folder level up from the folder you wish to assign and use only the folder name in the path a batch file will automatically create the full path. Take a look at this example

Step Action Result
1 Want to assign folder test2 to drive letter W.
Our batch file is run from folder fred1

a) Edit file createW.bat in folder fred1
b) change the path to fred2
2 Double click createW.bat to run it. The folder test2 is assigned to drive W.
If you were to move folder fred1 (and all its contents) to another drive or to a different folder running the batch file in fred1 will still create drive W with the correct path to folder fred2.
Uniform Server uses this method.

Conclusion

The real reason for writing this page to dispel the notion that Uniform Server is loaded into memory before it can be run. Not true the programs are stored on hard disk or memory stick. When the servers run they use memory like any other software. All Uniform Server programs are self-contained requiring no special installation or registry entries. A virtual drive creates a reference to the real location of these programs and pretends to be a different drive.

Where to next

Enough of this lets install! Uniform Server

 Uniform Server Installation 

image top

• UniCenter Site Content Copyright © 2006-2007  Mike Gleaves  All Rights Reserved  •

Copyright & Links

Copyright 2002-2007 The Uniform Server Development Team All rights reserved.

The Uniform Server: Home | Forum | Wiki | Blog