Sei sulla pagina 1di 97

1

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

 1 Overview

 1.1 Control architecture

 1.2 Apanel

 1.3 Installation

 1.4 Hidden

 2 Summary of features

 3 Uniform Server releases

 4 V5.0-Nano Folder Structure Overview

 5 UniTray - Quick start servers

 5.1 Server Status - Diagnostics

 6 Apanel Uniform Server 5.0-Nano. PHP 5.2.10


Uniform Server 5.1-Nano. PHP 5.3.0
 7 Alternative control

 8 Running multi-Servers on same PC

 9 Related Information

 9.1 How to install some popular applications

 9.2 Plugins

 10 Security related information

 10.1 Password protect folders/files plus ssl

 10.2 Run your own CA (Certificate Authority)

 10.3 CAcert

 11 Other Topic Links

 12 Summary

Uniform Server 5.0-Nano

Overview

Uniform Server has undergone a major architecture change to a certain extent this is
transparent. The focus has been on ease of use and maximum flexibly while still
retaining a small footprint. A fundamental change has been the removal of Perl for
server control now replaced with PHP CLI. Advantages are both Apanel and server-
control now share a common language along with a common set of PHP functions.

1
2
Batch files no longer perform any control functionality they are used in the main to run
PHP scripts and provide pop-up information windows.

Control architecture

Control architecture has been rebuilt from the ground up; it now uses a mix of dynamic
absolute paths and relative paths. Significance of this, for portability a virtual drive is
no longer required. Service installation no longer requires a server relocation and
conversion. Uniform Server now runs in either mode, as a standard program or a
service or a mix of either in the folder it is extracted to. This folder in its entirety can be
relocated and servers run from there for example a USB memory stick.

Net result is a more consistent architecture allowing independent control of each server.
UniTray has had a chequered past, originally offered as a plugin now integrated into
this version of Uniform Server. It’s a dual menu (tray icon), left and right mouse
buttons selects either of two menus allowing the servers to be run in either in standard
program mode or as a service respectively. For convenience common menu options are
duplicated in both menus.

Apanel

Although Apanel has been enhanced it retains its ease of use and ability to fine-tune
the servers. It dynamically tracks user options selected and presents menu options
appropriate to that selection. For example if you choose not to run the MySQL server all
associate menu options are hidden.

Installation

After unpacking Uniform Server to any folder you can run the servers either as a
standard program or run as a service straight out of the box. That’s the real power of
this new architecture just click and go. Move the server to a new location for example
another folder, hard drive or USB memory stick and again you are ready to run.

Hidden

Hidden behind the scenes is more flexibility, you can choose what to run and what to
display at start-up. The defaults assume you wish to run or close both servers at the
same time either in standard program mode or in service mode.

2
3
In reality you can select a mix that best suites your requirement, options are selectable
in a single control file.

Summary of features

 Integrated SSL support  Integrated portable Cron

 Automated self-signed Certificate and Key  Integrated DtDNS IP Updater

generation  Run from any location (does not require a virtual

 Name/password access to secure server drive)

 Server status - Includes diagnostics  Run as standard program or as a service

 Server status - IP address as seen from Internet  Alternative batch file control.

 Server status - Accessibility check from Internet  Run multi-servers on same PC

 MySQL Password recovery  Integrated UniTray

 Main components upgraded  Apanel updated.

 Server Control - Uses PHP scripts. No longer  Perl Mini or Full plugin

uses Perl

Uniform Server releases

For reference, I have shown the current Uniform Server stable releases and their main
components.

Uniform Server 3.2a Uniform Server 3.3 Uniform Server 3.5 Apollo Uniform Server 4.0 Mona
Apache 2.0.54 Apache 2.0.55 Apache 2.0.59 Apache 2.2.11
MySQL 4.1.12a MySQL 5.0.17 MySQL 5.0.37 MySQL 5.1.30-community
PHP 5.0.4 PHP & Extensions 5.1.1 PHP Version 5.2.3 PHP 5.2.8
phpMyBackupPro 1.7.1 phpMyBackupPro v.2.1 phpMyAdmin 3.0.1.1
phpMyAdmin 2.6.3-rc1 phpMyAdmin 2.6.4-pl4 phpMyAdmin 2.10.2 ActivePerl 5,10,0,1003
ActivePerl 5.8.7.813 ActivePerl 5.8.7.815 ActivePerl 5.8.8.820 eAccelerator 0.9.5.3
eAccelerator 0.9.5.1 SSL pre-installed (ssl_098j)

Uniform Server 4.1 Mona Uniform Server 4.2 Mona Uniform Server 4.3 Mona Uniform Server 4.4-Mona
Apache 2.2.11 Apache 2.2.11 Apache 2.2.11 Apache 2.2.13
MySQL 5.1.33-community MySQL 5.1.34-community MySQL 5.1.35-community MySQL 5.1.38-community
PHP 5.2.9-1 PHP 5.2.9-2 PHP 5.2.10 PHP 5.3.0
phpMyAdmin 3.1.3.1 phpMyAdmin 3.1.3.1 phpMyAdmin 3.2.0 phpMyAdmin 3.2.2-rc1
ActivePerl 5,10,0,1004 ActivePerl 5,10,0,1004 ActivePerl 5,10,0,1004 ActivePerl 5,10,0,1004
eAccelerator 30953_5.2.9.1 eAccelerator 30953_5.2.9.2 eAccelerator 30953_5.2.10 eAccelerator 0.9.6-rc1
SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k)
Uniform Server 4.5-Mona Uniform Server 4.5a-Mona Uniform Server 5.0-Nano Uniform Server 5.1-Nano
Apache 2.2.14 Apache 2.2.14 Apache 2.2.13 Apache 2.2.13
MySQL 5.1.41-community MySQL 5.1.41-community MySQL 5.1.38-community MySQL 5.1.38-community

3
4
PHP 5.3.1 PHP 5.2.12 PHP 5.2.10 PHP 5.3.0
phpMyAdmin 3.2.4 phpMyAdmin 3.2.4 phpMyAdmin 3.2.2-rc1 phpMyAdmin 3.2.2-rc1
ActivePerl 5,10,0,1004 ActivePerl 5,10,0,1004 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005
ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006
eAccelerator 0.9.6-rc1 eAccelerator 0.9.6-rc1 eAccelerator 30953_5.2.10 eAccelerator 0.9.6-rc1
SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k)
Uniform Server 5.2-Nano Uniform Server 5.3-Nano Uniform Server 5.4-Nano Uniform Server 5.5-Nano
Apache 2.2.14 Apache 2.2.14 Apache 2.2.14 Apache 2.2.14
MySQL 5.1.39-community MySQL 5.1.39-community MySQL 5.1.41-community MySQL 5.1.41-community
PHP 5.2.11 PHP 5.3.0 PHP 5.3.1 PHP 5.3.1
phpMyAdmin 3.2.2 phpMyAdmin 3.2.2 phpMyAdmin 3.2.3 phpMyAdmin 3.2.4
ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005
ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006
eAccelerator 0.9.6-rc1 eAccelerator 0.9.6-rc1 eAccelerator 0.9.6-rc1 eAccelerator 0.9.6-rc1
SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098l)
UTF-8 Compatible UTF-8 Compatible
Uniform Server 5.5a-Nano Uniform Server 5.6a-Nano Uniform Server 5.6b-Nano Uniform Server 5.6-Nano
Apache 2.2.14 Apache 2.2.14 Apache 2.2.15 Apache 2.2.15
MySQL 5.1.41-community MySQL 5.1.44-community MySQL 5.1.44-community MySQL 5.1.44-community
PHP 5.2.12 PHP 5.2.13 PHP 5.2.13 PHP 5.3.2
phpMyAdmin 3.2.4 phpMyAdmin 3.2.5 phpMyAdmin 3.3.0 phpMyAdmin 3.3.0
ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005
ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006
eAccelerator 0.9.6-rc1 eAccelerator 1.0-dev eAccelerator 1.0-dev eAccelerator 1.0-dev
SSL pre-installed (ssl_098k) SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098l)
UTF-8 Compatible UTF-8 Compatible UTF-8 Compatible UTF-8 Compatible
Uniform Server 5.6.1-Nano Uniform Server 5.6.3-Nano Uniform Server 5.6.4-Nano Uniform Server 5.6.5-Nano
Apache 2.2.15 Apache 2.2.15 Apache 2.2.15 Apache 2.2.15
MySQL 5.1.45-community MySQL 5.1.45-community MySQL 5.1.46-community MySQL 5.1.46-community
PHP 5.3.2 PHP 5.3.2 PHP 5.3.2 PHP 5.3.2
phpMyAdmin 3.3.1 phpMyAdmin 3.3.2 phpMyAdmin 3.3.2 phpMyAdmin 3.3.3
ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005 ActivePerl 5,10,0,1005
ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006 ActivePerl 5,10,0,1006
eAccelerator 1.0-dev eAccelerator 1.0-dev eAccelerator 1.0-dev eAccelerator 1.0-dev
SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098l) SSL pre-installed (ssl_098l)
UTF-8 Compatible UTF-8 Compatible UTF-8 Compatible UTF-8 Compatible

Note: 5.6.2-Nano was a security update (bug fix)

V5.0-Nano Folder Structure Overview

The following provides a quick overview of V5.*-Nano's main server areas.

4
5
A) Top-Level B) Alternative control:
Server control:

 Batch file start/stop service or


 Start.exe - Starts
program
UniTray
 Batch file UniTray start/stop
 help.bat -
 Start_2.exe - Start UniTray without
Unitray menu
pop-up
information
E) UniServer control scripts
C) CGI Scripts
Place all your CGI scripts
in this folder  key_cert_gen - Scripts to generate

new server certificate and key


 Perl Scripts - .pl
 main - Scripts to run servers either
D) Secure Web Root as a standard program or service.
Folder
 move_servers - Script to change

 Place all server ports rename executables and

site/pages to be service

encrypted  perl - Scripts to change shebang

in this folder. and convert to Unix format

 Uses Open SSL  php_dev_production - Switch

098k php.ini to either development or

production
F) Server programs
 restore_mysql_password - Script to

 Destination for restore MySQL back to root

Perl plugins  tray_menu - UniTray program,

Either mini or full Perl configuration file and tray images

H) Web Root Folder G) Local Folder

 Place all other  Apache Server, configuration and

site/pages in this logfiles.

folder. Location of server certificate and key.

This is the Standard  MySQL Server, configuration file

Web-Server folder and databases.

 PHP interpreter and configuration

file.

5
6
UniTray - Quick start servers

At first sight both menus give the impression Uniform Server is complex to run.
However majority of menu items are for connivance allowing you to select and run
additional features should you want to use them.

The first two menu items control both servers; that’s all you need to start and
stop the servers.

The third menu item allowing you to control individual servers offers finer control.

LEFT MENU RIGHT MENU


Run servers as a standard program Run servers as a service

Quick Start guide

Run Servers as standard Program

 Start UniTray: In folder UniServer double click on Start.exe tray icon created.
 L3) Check servers are runnable: Left or Right click tray icon > click Server Status.
All ports must be free to use.
 L1) Start Uniform Server. Left click tray icon > click Start UniServer
 L2) Stop Uniform Server. Left click tray icon > click Stop UniServer
 L4) Close UniTray. Left or Right click tray icon > click Exit

6
7
Run Servers as a Service

 Start UniTray: In folder UniServer double click on Start.exe tray icon created.
 R3) Check servers are runnable: Left or Right click tray icon > click Server Status.
All ports must be free to use.
 R1) Start Uniform Server. Right click tray icon > click Install and Run all Services
 R2) Stop Uniform Server. Right click tray icon > click Stop and Remove All Services
 R4) Close UniTray. Left or Right click tray icon > click Exit

Note: Double click on tray icon to open Apanel in default browser.

Server Status - Diagnostics

Server Status provides a mixed bag of information:

 Before starting servers checks to see if ports are in use which would prevent the
servers starting
 Displays what ports servers are configured for.
 Displays what servers are running and in what mode (standard program or
service)
 With servers running displays IP address as seen from the Internet.
 Checks servers are accessible from the Internet, uses the above IP address

Apanel

Apanel allows you to fine-tune the servers hence reduces the need to go in and edit the
server configuration files manually.

It has been enhanced with the folowing additional features:

Apanel new features:

 Auto tracking of user selected server control options.

Note:

The MySQL password should always be set using Apanel, setting it with phpMyAdmin
results in MySQL lockout.

In this situation use the MySQL password recovery feature.

7
8
Alternative control

Esoteric batch files no longer exist; the ones you will find in folder alternative control
have been reduced to a bare minimum. These now call PHP scripts that perform the
real work.

Running multi-Servers on same PC

Uniform Server's architecture has always supported running multi-servers 5.0-Nano


makes this task easier.

Although the Mona series had this capability it was difficult to distinguish which one was
running. This has been addressed by using numbered tray icons for each server
(UniTray) started.

Related Information

How to install some popular applications

Please note all these applications can be installed and run from a USB memory stick.
Some require a small amount of editing to removed hard coded paths.
Packages that require Cron jobs are catered for by portable-cron this requires three
additional files.

Package Installed Size


Drupal 6.15 45.7 MB - Run from a USB memory stick - Requires Portable cron
Joomla 1.5.15 64.5 MB - Run from a USB memory stick
MediaWiki 1.15.1 80.6 MB - Run from a USB memory stick (Do not run on PHP 5.3.1)
Moodle Moodle 1.9.7+ 104 MB - Run from a USB memory stick - Requires Portable cron
WordPress 2.9 47.7 MB - Run from a USB memory stick
Xoops 2.4.2 61.0 MB - Run from a USB memory stick

Note: For each of the above packages there is a corresponding plugin downloadable
from SourceForge.
These plugins are specific to Uniform Server 5.5-Nano including 5.5a-Nano and will
not run on other versions.
Download details are provided on each page.

8
9
Plugins

The following lists plugins avaiable for Uniform Server Nano series:

Plugin Name Description Compatability


V5.0_mini_perl Installs Perl core program with a collection of commonly used Perl modules. Plugin Options: All

 V5.0_mini_perl - ActivePerl 5.10.0.1005

 V5.1_mini_perl - ActivePerl 5.10.0.1006

V5.0_full_perl Installs Perl core program and full set of Perl modules. Plugin Options: All

 V5.0_full_perl - ActivePerl 5.10.0.1005

 V5.1_full_perl - ActivePerl 5.10.0.1006

V5.0_AWStats_2.0 AWStats is a free powerful and fully featured tool that generates advanced server statistics, All
graphically.

This plugin requires PERL to be installed use either Mini or Full Perl plugins see above..

V5.0_AWStats_1.0 AWStats is a free powerful and fully featured tool that generates advanced server statistics, All
graphically.

For completeness this plugin includes V5.0_mini_perl.

Webalizer English Webalizer is a fast application that generates server statistics from Apache’s access log file. All

Analysis results are converted into standard WebPages with data presented in both text and
graphical format.

Webalizer Multi Webalizer is a fast application that generates server statistics from Apache’s access log file. All
Languages
Analysis results are converted into standard WebPages with data presented in both text and
graphical format.

USV5_FileZillaFTPd Adds FileZilla Server to 5-Nano series. Runs as a standard program or as a service. Core V5.0-V5.4
portable-FileFillaFTPd can be used independently of UniServer.
V55_FileZillaFTPd Adds FileZilla Server to 5.5-Nano. Runs as a standard program or as a service. Core portable- V5.5 V5.5a V5.6
FileFillaFTPd can be used independently of UniServer. Includes language files for UniTray V5.6b
V55_UniServer_CA This plugin is slightly unusual it starts off as a Uniform Server plugin where you can install a CA V5.5 V5.5a V5.6
and server certificate including a server key to the Apache server. After completion the entire V5.6b
plugin is transferred to a USB memory stick enhancing security by removing the CA’s key from
your PC
V55UniServer_USB This plugin integrates portable Firefox into Uniform Server 5.5-Nano’s architecture. This allows V5.5 V5.5a
Uniform Server to be run independently of the host PC. To achieve this it uses Portable Firefox
and a PAC file. (PAC file prevents issues with Vista and W7 "hosts" file).
V56UniServer_USB This plugin integrates portable Firefox into Uniform Server 5.6-Nano’s architecture. This allows V5.6 V5.6b
Uniform Server to be run independently of the host PC. To achieve this it uses Portable Firefox
and a PAC file. (PAC file prevents issues with Vista and W7 "hosts" file).
V56_ZCON This plugin is an alternative controller for Uniform Server 5.6-Nano. It incorporates features from V5.6 V5.6b
UniTray and Apanel with a user interface similar to UniController.
V5.0_Zend_Optimizer Some application encode PHP scripts using Zend Guard to run these scripts on Uniform Server ?

V5.1_Zend_Optimizer requires the installation of Zend Optimizer. This plugin provides a quick way to install Zend

9
10

Optimizer on Uniform Server Nano. Tobe released

Security related information

The following topics and tutorials show how to harness the power of SSL built into
Uniform Server.

Password protect folders/files plus ssl

Authentication Covers Apache’s basic authentication, viable over the Internet when secured using SSL. The
techniques shown eliminate the need for additional programming and remove the requirement to
have mod-rewrite enabled. A full-blown secure server is not required! Double logins are eliminated.

Run your own CA (Certificate Authority)

UniServer CA Introduction. A complete tutorial how to use UniServer,s CA plugin to create root CA and server
certificate for the Apache server. Also covers personal certificates for accessing secure
areas of the server.

CAcert

CAcert A complete tutorial on how to obtain a free signed server certificate from CAcert certificate authority.

Other Topic Links

DtDNS Introduction - Shows how to obtain an account at DtDNS for users with a dynamic IP address

PHP CLI Introduction - Short code snippets for running PHP CLI scripts.

PHP cURL Introduction - Short code snippets as used in Server Status diagnostics and DtDNS updater PHP CLI

USB self-contained server - How to avoid the hosts file. Uses V4.0-Mona (V4.1-Mona), Firefox and PAC

Summary

Uniform Server 5.0-Nano is a significant upgrade although the main architecture has changed along

with the main components and many new features added control remains simple. Just a few mouse

clicks will have the servers running either as a standard program or service. Scratch the surface a

10
11
little and you will find a wealth of flexibility allowing you to tailored the servers. Dig deeper and you

have access to a set of common PHP function allowing you to redesign server control should you wish.

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 Download

 2 Quick Start

 2.1 Install and run

 2.1.1 Run as a Service (Vista and W7)

 2.1.2 Method 1
Uniform Server 5.0-Nano. PHP 5.2.10
 2.1.3 Method 2
Uniform Server 5.1-Nano. PHP 5.3.0

 2.2 Putting the Server on-line

 2.3 Enable SSL

 2.4 Putting the SSL Server on-line

 3 Move Servers

 4 Web Root Folders

 5 Related Information

 6 Summary

5.0-Nano Installation and run guide

Uniform Server 5.0-Nano has a single installation option: extract to any folder, and
two operation modes, either as a standard program or service.

Portability is nothing more complex than copying folder UniServer to where you
want to run the servers. That includes any hard drive or USB memory stick.

Can’t run UniServer because it clashes with an existing server? Three mouse clicks and
a few key presses reconfigures the server allowing it to coexist with an existing host
server.

Uniform Server tries not to impose any restrictions, hence has numerous user
configurable features allowing you to tailor the servers. This page explores some of
these after first covering the basics.

11
12

Download

Download Uniform Server 5.*-Nano from Sourceforge choose either


UniServer5_*.exe or UniServer5_*.zip. The .exe is a self-extracting 7-zip archive,
and is much smaller.

For 5.0, 5.1, 5.2 and 5.3 there are two parallel versions, the main difference being the
version of PHP:

 UniServer5_0.exe or UniServer5_0.zip - PHP 5.2.10


 UniServer5_1.exe or UniServer5_1.zip - PHP 5.3.0
 UniServer5_2.exe or UniServer5_2.zip - PHP 5.2.11 --- See supplementary
section for details
 UniServer5_3.exe or UniServer5_3.zip - PHP 5.3.0 --- See supplementary
section for details.

Note versions 5.4 and 5.5 use PHP version 5.3.1

 UniServer5_4.exe or UniServer5_2.zip - PHP 5.2.11 --- See supplementary


section for details
 UniServer5_5.exe or UniServer5_2.zip - PHP 5.2.11 --- New See supplementary
section for details

12
13

Quick Start

Install and run

1. Save UniServer5_*.exe to any folder.

2. Double click UniServer5_*.exe. It's a self-extracting

archive and unpacks to the current folder (where you saved

the file).

Note: The exe does not install anything to the registry or

other areas of a PC. It just creates folder UniServer and

extracts all folders and files to this folder.

3. Navigate to folder UniServer A).

4. Run (double click on) Start.exe. This starts Unitray.

5. Left click on the tray icon, and click on Start

UniServer (top menu), which starts both Apache and MySQL

servers.

6. If not already running, your browser will automatically

start and display Intro page.

7. Stop the servers. Left click on the tray icon, and click

on Stop UniServer (second menu item).

Note 1:

When the servers are run or stopped you will be challenged by your
firewall: always ALLOW ACCESS to the Internet even when running
the servers locally for development.

Note 2:

The Web root folder H) UniServer\www contains example pages (intro


page). With the exception of file .htaccess, delete its content and copy
your Web site (folders and pages) to this folder. To view your web site,
run the servers and type http://localhost into your browser.

Note 3:

The server is fully portable. For example, copy folder UniServer A) and
all its content to a USB stick and run the servers from there.

13
14
Note 4:

Run as a service. At step 5, right click and use the top menu to install
and run as a service. Use the second menu item to stop and uninstall
services.

Run as a Service (Vista and W7)

Method 1

The simplest way of getting UniServer up and working on Windows 7 and I presume the
same will apply for Vista is by doing as follows.

1. Go to folder UniServer folder.


2. Right click on Start.exe and select Run as administrator.
3. Right click on the system tray icon UniTray and select Install and run all
services.

After a couple of seconds Apache and Mysql should now run as expected.

Method 2

If you really want to be lazy and are happy to always grant UniServer Run as
administrator privileges then use the following method:

1. In folder UniServer right click on Start.exe and choose Properties


2. Click the compatibility tab.
3. Tick the box Run this program as administrator.

Now in future you can just run Start.exe as normal by double clicking it and it will
always automatically be run as an administrator.

Note: You only need to perform the above if you want to install Apache and MySQL as
a service.

If you want to just use them as a normal program then there is no issue and you don't
need to run as administrator, you can just choose to run them as standard programs by
left clicking on the system tray icon (UniTray) and selecting 'Start Uniserver'.

Putting the Server on-line

14
15
To allow Internet or Intranet access, edit file .htaccess located in the root folder
www H):

1) Locate these lines: 2) Disable local only access by commenting each line with an hash "#" as shown

Order Deny,Allow #Order Deny,Allow


Deny from all #Deny from all
Allow from 127.0.0.1 #Allow from 127.0.0.1

Note 1: After saving the file, there's no need to restart server. Changes are
automatically picked-up by Apache, and your servers are now on-line.

Note 2: The Secure Web root folder D) UniServer\ssl contains example pages that will
be encrypted when served. With the exception of file .htaccess, delete its content and
copy your Secure Web site (folders and pages) to this folder. You need to enable SSL
for pages to be served from this folder.

Note 3: If you experience difficulties in accessing your server from the Internet, check
out this section.

Also check out the DtDNS page for a free domain name and how to resolve a dynamic
IP address.

Enable SSL

Before serving encrypted pages, the server requires a certificate and key. These are
created by running a script as follows:

Left click tray icon > Advanced > click "Server Certificate and Key Generator"

 You are prompted for three pieces of information (CN, OU and O); press enter to
accept the defaults.
 For Apache to pick-up the new configuration, Restart the servers

To view your secure web site, run the servers and type https://localhost into your
browser.

Note: The script can also be run from Apanel.

Putting the SSL Server on-line

15
16
To allow Internet or Intranet access, edit file .htaccess located in the SSL root folder
D):

UniServer\ssl\.htaccess

1) Locate these lines: 2) Disable local only access by commenting each line with an hash "#" as shown

Order Deny,Allow #Order Deny,Allow


Deny from all #Deny from all
Allow from 127.0.0.1 #Allow from 127.0.0.1

Move Servers

One of Uniform Server’s unique features is the capability to run more than one
complete server on the same PC. When running a server from a USB memory stick, you
can use this to great advantage and prevent server clashes. You will have noticed
UniTray’s icon displays one (meaning standard ports). Moving UniServer increments
this digit and so on for each server move. In reality, it’s not just a port change but a
complete server update. Running server status displays the server characteristics.

Move Servers:

1. Stop all running Uniform Servers


2. Start UniTray: In folder UniServer, double click on Start.exe creating the
tray icon.
3. Move servers: Left click tray icon > Advanced > click Move Servers
multi-server operation.
4. In the pop-up window at all prompts press enter to accept defaults.
5. The tray icon will display 2, if you already use a server with this number
repeat steps 3 and 4 each server must have a unique number.

 After moving the servers you need to use the new ports to either access server
pages or to install new scripts.
 To find these: Left click tray icon > Server Status

The first time you move the servers, the ports will have the following values: Apache
port = 81 and MySQL port = 3307

 To access the index page, add the port as shown: http://localhost:81/


 When installing new scripts, MySQL server host will be: localhost:3307

16
17

Confused? No problem. Take a look at these two pages. They provide real applications
and hopefully will clarify any issues:

 Installing Joomla
 Installing MediaWiki

Web Root Folders

There are two Web Root folders, “www” and “ssl”. Folder www is where you place your
regular web site. Pages served from this folder are not encrypted. Any sites or pages
you want served encrypted are placed in folder ssl.

 www uses standard port 80 (on Unix systems this folder is generally named
htdocs)
 ssl uses standard port 443

Note: Moving the servers increments these ports, invalid ports are skipped

Related Information

1. Home Web Server - Provides details for running a server


2. Quick Install Guide - Worth a read

Summary

Although UniServer has significantly changed, it still remains easy to use.

A central control architecture reduces complexity and adds more flexibility.

This flexibility and control are covered on the next page Control and Alternative
control.

17
18

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 Batch files

 2 Start_2.exe

 3 Common Core Control

 4 Batch files
Uniform Server 5.0-Nano. PHP 5.2.10
 4.1 Relocating batch files
Uniform Server 5.1-Nano. PHP 5.3.0

 5 Script Parameters

 5.1 Example 1

 5.2 Example 2

 6 Batch files and UniTray

 6.1 Example 1

 7 Summary

Control and alternatives

Uniform Server’s control architecture has been designed to be as flexible as possible.

It is recognised not everyone likes tray icons instead prefer batch file control this also
prevents tray icon clutter.

This page covers control and control alternatives.

Batch files

Batch files found in folder UniServer\alternative_control offer this alternative control


they can be run from that folder.

18
19
If you wish can be copied to the server’s top folder UniServer however in order to run
they require minor modification as explained below.

The batch files can be tweaked to automatically close after a predefined time and or
start UniTray. Details are provided under section Batch files and UniTray.

Start.exe

Before looking at batch files you will have noticed file Start_2.exe this is an alternative
to Start.exe.

Like Start.exe it starts UniTray however without the annoying pop-up to inform you it
has done so. If you would like to use this file copy it to folder UniServer and optionally

 Delete Start.exe
 Rename Start_2.exe to Start.exe choice is yours.

The only reason for deleting and renaming is to reduce clutter and keep things
consistent.

Common Core Control

Uniform Server has a single central control architecture located in folder


UniServer\unicon\main all server control requests are passed to this core for
processing.

Unitray, batch files and Apanel all make requests to this core it has the advantage of
reducing complexity of external scripts.

Core control is designed around four CLI scripts these are split into two groups,
standard program and service. Each group is further split into two files start-stop
and install-uninstall service respectively. Two-tracker (Apache and MySQL) files
control interaction between these.

Standard Program Run as a Service Tracker Files

start_servers.php service_install_run.php apache_tracker.txt

19
20
stop_servers.php service_stop_uninstall.php mysql_tracker.txt

Fig 1
location_tracker.txt
Core Control;

The above scripts access a common set of functions these have been written in vanilla
PHP making them easier to understand and changeable.

Note: Location tracker is not interactive between the above scripts. It is shown only to
emphasise its importance.

Batch files

The esoteric nature of previous UniServer batch files have been addressed.

Batch file control is nothing more than a single line, which calls the appropriate PHP CLI
script with an optional parameter.

The following batch files:

 Start_Server.bat
 Stop_Server.bat
 Service_Install_Run.bat
 Service_Stop_Uninstall.bat

Can be reduced to a single control line as shown respectively:

 ..\usr\local\php\php.exe -n ..\unicon\main\start_servers.php
 ..\usr\local\php\php.exe -n ..\unicon\main\stop_servers.php
 ..\usr\local\php\php.exe -n ..\unicon\main\service_install_run.php
 ..\usr\local\php\php.exe -n ..\unicon\main\service_stop_uninstall.php

Each line runs the PHP script interpreter php.exe two parameters are passed -n and
the script to be run.

–n Instructs the interpreter not use a configuration file.

Relocating batch files

20
21
After copying each batch file to folder UniServer you need to remove “..\” from each
line.

Note “..\” means move up one level from the current location.

With the files already moved to this location the “..\” is redundant. Hence the lines now
look like this:

 usr\local\php\php.exe -n unicon\main\start_servers.php
 usr\local\php\php.exe -n unicon\main\stop_servers.php
 usr\local\php\php.exe -n unicon\main\service_install_run.php
 usr\local\php\php.exe -n unicon\main\service_stop_uninstall.php

Script Parameters

An optional parameter passed to a script provides selection of various control options.


Defaults are used when a script is run with no parameter. A parameter passed to a
script overrides defaults.

Defaults can be changed in file UniServer\unicon\main\includes\config.inc.php They


are binary coded as follows (extract from config.inc.php):

#############################################################################
# User Variables:
# $server_standard - Controls server when run as a standard program
# $server_service - Controls server when run as a service
#
# $server_standard - Options are binary coded as follows:
# Bit function
# Apache 1 1 - Run Apache server 0 - no change ignore
# Mysql 2 1 - Run MySQL server 0 - no change ignore
# Index page 4 1 - Start Index page 0 - no change ignore
# MySQL Console 8 1 - Display console 0 - no change ignore
# Cron 16 1 - Run cron 0 - no change ignore
#
# $server_service - Options are binary coded as follows:
# Bit function
# Apache 1 1 - Run Apache as a service 0 - no change ignore
# Mysql 2 1 - Run MySQL as a service 0 - no change ignore

21
22
# Index page 4 1 - Start Index page 0 - no change ignore
#
# Defaults:
# $server_standard = 7;
# $server_service = 7;
###########################################################################

Note: You add up the binary coded values to give the required default value.

Example 1

If you wish to run only the Apache server when running as a standard program edit the
batch files:

 Start_Server.bat
 Stop_Server.bat

Change the respective lines as follows:

 usr\local\php\php.exe -n unicon\main\start_servers.php 1
 usr\local\php\php.exe -n unicon\main\stop_servers.php 1

Example 2

Apache and MySQL servers can be run without automatically displaying the index page
using a parameter value of 3 as shown below:

 usr\local\php\php.exe -n unicon\main\start_servers.php 3
 usr\local\php\php.exe -n unicon\main\stop_servers.php 3

Note 1:

Changing the defaults in file config.inc.php affect Apanel, UniTray and batch files

(assumes batch files are not using parameters to override defaults).

Batch files and UniTray

The batch files contain additional commands these have been disabled using “rem”
(remark) removing the rem enables the command.

22
23
For example:

 Changing: rem Start.exe


 To: Start.exe starts UniTray when the batch file is run.

When a batch file is run its window remains open until a user presses any key.

This allows a user to view any error messages.

To have the window automatically close, disable the pause command using a “rem”

 Change: pause
 To: rem pause

Doing this you have no time to read any displayed text if you wish to read text enable
the delay command by removing the “rem”.

 Change: rem unicon\program\unidelay.exe 3


 To: unicon\program\unidelay.exe 3

Note: The above sets a delays of three seconds change to your own preference.

Example 1

This example uses UniServer\alternative_control\Start_Server.bat its current


configuration looks like this:

..\usr\local\php\php.exe -n ..\unicon\main\start_servers.php 1
rem Start.exe
rem ..\unicon\program\unidelay.exe 10
pause

Move the file to folder UniServer and edit to look like this:

usr\local\php\php.exe -n unicon\main\start_servers.php 3
Start.exe
unicon\program\unidelay.exe 10
rem pause

1. Only the MySQL and Apache server started (parameter 3)

23
24
2. Start.exe - UniTray is started
3. unicon\program\unidelay.exe 10 - A ten second delay allows text to be
read
4. rem pause - Pause is disabled hence window closes after 10 seconds

Summary

Uniform Server uses a central control core with binary coded server control providing
maximum flexibility with minimum complexity.

External control elements (batch files and UniTray) can override default options by
passing a parameter to the core. UniTray uses this technique for starting both servers
or single server control.

There are two additional scripts DtDNS and Cron designed to enhance control
functionality.

 DtDNS provides automatic IP updating for users that have an account this
effectively turns a dynamic IP address into a static IP address.
 Cron provides a background tick, on each tick runs a through a list of scripts
defined by a user. This includes running the DtDNS script.

24
25

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 DtDNS account

 2 Login - Create Hostname

 2.1 Create Hostname


Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 2.2 Manage existing hostnames

 3 Script Configuration

 3.1 Manual Update

 3.2 Cron - Automatic update

 4 Summary

Uniform Server and DtDNS

Majority of domestic Internet connections are via a dynamic IP address, one that
changes every time you connect to the Internet. This means you cannot run a web
server unless you purchase a, static IP address from your ISP (Internet service
provider). Even with a static IP you require and entry in a DNS server that converts
your domain name into this IP address allowing other users to access your server.

An alternative is to use a free service such as DtDNS they provide accounts that allow
you to obtain a domain name and tracking software to automatically update your IP
address as it changes. A big advantage of their free service they automatically enable
Wild cards by default.

25
26
Uniform Server supports the DtDNS service by integrating a, simple PHP scrip to
automatically update hostname IP address at DtDNS. Script is configurable allowing you
to update all five free hostnames. The script can optionally be run by cron making the
whole task transparent.

Note: The script is portable hence popping the servers on a USB memory stick means
you can have them on-line and accessible within ten minutes (DNS propergation time)
if new PC host has been configured to allow Internet server traffic.

Note: This script has been rewritten now includes a configuration file refer to
supplementary section (5.2-Nano and 5.3-Nano) for details.

DtDNS account

Creating an account at DtDNS is extremely easy.

 Go to DtDNS home page.


 To the right of log in click Create an Account

There are two pages to fill in, enter the following details:

Page 1:
Desired
1) This name is used for logging into your account
Username
2) Your Name Your real name (Internal use)
Desired
3) A password for logging into your account
Password
Confirm
4) As above
Password
5) E-mail Address A real active e-mail is required, activation code sent to this e-mail address
6) Confirm E-mail As above
7) Optional Skip the Optional Information section if you wish fill it in.
Two CAPCHA
8) Enter the two CAPCHA words (if these are difficult to read click the new challenge button)
words
Page 2:
9) Username Enter your Username as entered in 1).
Enter code sent to your email. (Note: The email contains a link to page 2 hence you can close
10) Enter code
the page and wait for the e-mail.)

Login - Create Hostname

General information:

Available Free Domain Names


 A DtDNS account is limited to five free hostnames.
3d-game.com etowns.net
 A hostname is concatenated with a domain name. 4irc.com etowns.org
 I have listed available domains on the right. b0ne.com flnet.org

26
27
 Your full URL for example bbsindex.com gotgeeks.com
chatnook.com scieron.com
 If you chose books as hostname darktech.org slyip.com
deaftone.com slyip.net
 And select from the drop down menu effers.com
dtdns.net suroot.com
effers.com
Will look like this:

http://books.effers.com

Wild Cards:

After creating a hostname wild cards are enabled by default. This allows you to use a
URL such as

http://www.books.effers.com - Note www. is the wild card part this can be anything
you like for example:

 http://www.books.effers.com
 http://www-internation.books.effers.com
 http://local.books.effers.com
 http://www.home.books.effers.com

books.effers.com resolves to your IP address you can use the wild card on your
server to resolve to different sites.

Create Hostname

To create a new hostname at DtDNS

Login

 Go to | Login page
 Enter Username: as set in step 1)
 Enter Password: as set in step 3)
 My Services page displayed
 Click on Hostnames this opens the Hostname Manager

Create hostname

27
28
 Enter a desired Hostname
 From the drop down menu select a Domain
 Click Add Hostname
 Enter the two CAPCHA words (if these are difficult to read click the new
challenge button)
 Click Add Hostname button
 This is added to your list of host names

Manage existing hostnames

To manage existing hostnames, simply click the entry in the list for example see below.

Hostname Domain IP Address Type


uni23 dtdns.net 89.119.35.45 Active Dynamic
books effers.com 87.129.30.174 Active Dynamic

Click a hostname link opens its corresponding configuration page. Here you can change
various settings, including the IP address.

Note: After adding a new host the IP address is set to your current IP address. You can
manually change it on the configuration page or request an IP update see later.

Script Configuration

You need to configure the script, which can be found in folder:

UniServer\plugins\dtdns_updater\dtdns_updater.php

In the user configuration section locate these lines:

 $id_pw[] = "books.effers.com,fred123"; // Change


 $id_pw[] = "books.effers.com,fred123"; // Change or delete
 $id_pw[] = "books.effers.com,fred123"; // Change or delete

Substitute books.effers.com with your real host and domain names, replace the
password fred123 with the one you set in step 1)

If you have only a single host delete the other two lines. Otherwise modify them for
each additional host as above. Add additional lines as required.

28
29
<?php
/*
###############################################################################
# Name: The Uniform Server DtDNS Updater v 1.0
# Developed By: The Uniform Server Development Team
# Modified Last By: Mike Gleaves (Ric)
# Web: http://www.uniformserver.com
###############################################################################
*/
//error_reporting(0); // Disable PHP errors and warnings
// Comment to Enable for testing

chdir(dirname(__FILE__)); // Change wd to this files location


include_once "../../unicon/main/includes/config.inc.php";
include_once "../../unicon/main/includes/functions.php";

run_location_tracker(); // Have servers moved if moved update configuration


print"\n";

//######################## User Configuration #################################


// Add as many lines as required with the following format:
// $id_pw[] = "hostname,password";
// For example:
// $id_pw[] = "books.effers.com,fred123";
// $id_pw[] = "power.dtdns.net,gun22powder";
//-----------------------------------------------------------------------------

$id_pw[] = "books.effers.com,fred123"; // Change


$id_pw[] = "books.effers.com,fred123"; // Change or delete
$id_pw[] = "books.effers.com,fred123"; // Change or delete

//###################### END User Configuration ###############################

$test = false; // Test true = display IP address and host names


// false = no display

foreach ($id_pw as $value) { // Iteratate through array


$idpw_array = explode(",",$value); // Split id pw pairs

if(get_ip_dns($idpw_array[0])){ // Was IP from DNS returned


if(get_ip_current()){ // Yes: Current IP returned

if($test){ // Test code


print "DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]<br/>\n";
}

if($ip_dns != $ip_current){ // Are IP's different


dtdns_update($idpw_array[0],$idpw_array[1]);// yes: Update required
}
}
}
}// End foreach

//=== Get IP from DNS server ==================================================


// Input: ID = Hostname:
// Output: Return value true = IP was obtained
// Output: Return value false = IP not obtained or error
// Output: $ip_dns either IP address or host name

29
30
function get_ip_dns($hostname){
global $ip_dns; // IP address saved from DNS server
$ip_dns = gethostbyname($hostname); // Get IP address of hostname
if($ip_dns == $hostname){ // Is hostname returned (not IP address)
return false; // yes: failed to get IP address
}
else{ // no: IP obtained
return true; // set success
}
}
//============================================== END Get IP from DNS server ===

//=== DtDNS Host Update Page ==================================================


// Input: $id = Hostname:
// Input: $pw = User password
// Output: Return value true = sucess false = failed

function dtdns_update($id,$pw){
$id_val = urlencode($id); // User Host on DtDNS
$pw_val = urlencode($pw); // User password
$client_val = urlencode('UniServerV1'); // Optional - But added it
$url = 'https://www.dtdns.com/api/autodns.cfm'; // DtDNS update page

// Build complete URL


$str= $url."?id=".$id_val."&pw=".$pw_val."&client=".$client_val;

// Access page using Curl SSL


$ch=curl_init(); // Initialize Curl get handle
curl_setopt($ch,CURLOPT_URL,$str); // Set Curl URL option
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // no verify
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10); // timeout set to 10 sceonds
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // curl_exec ouputs a string
$buffer = curl_exec($ch); // run above, save to buffer
curl_close($ch); // Close Curl frees memory

// Test returned page


if(preg_match("/now\spoints\sto/",$buffer)){// Is returne value "now points to"
return true; // yes: update OK
}
else{ // no: Failed
return false;
}
}
//============================================== END DtDNS Host Update Page ===
?>

Manual Update

You can run the following batch file to manually force an update, remember to leave
around ten minuets before performing another manual update.

It takes around ten minutes for the DNS to propagate, additional updates within this
period are regarded as an abuse and you may find your IP banned.

Batch file: UniServer\plugins\dtdns_updater\Run_dtdns_updater.bat

30
31
Contains:

COLOR B0
@echo off
cls

rem ### working directory current folder


pushd %~dp0

..\..\usr\local\php\php.exe dtdns_updater.php

rem ### restore original working directory


pause
popd
EXIT

Cron - Automatic update

Cron provides a periodic tick Uniform Server's default is every ten minutes.

DtDNS automatic updater has been pre-configured however it is disabled by default.

To enable Cron edit file UniServer\unicon\main\run_cron.php

Locate these two line in section List of scripts to be run

// $cmd = 'start ..\..\usr\local\php\php-win.exe


..\..\plugins\dtdns_updater\dtdns_updater.php';
// pclose(popen($cmd,'r')); // Start detatched process

and uncomment as shown below

31
32
$cmd = 'start ..\..\usr\local\php\php-win.exe
..\..\plugins\dtdns_updater\dtdns_updater.php';
pclose(popen($cmd,'r')); // Start detatched process

Notes:

 When the server is first started Cron is run and the IP addreess updated if
different
 Every ten minuets Cron is run and the IP address are checked if different are
updated.
 Cron only runs when the servers are running however you can force an update
using the batch file mentioned above.
 Cron can be manually or automatically started see next page for details.

Summary

For a home web server the free account at DtDNS is ideal at least it gives you an
opportunity to test their service. Perhaps it will encourage you to purchase a real
domain and use some of their paid services.

The next page looks at Cron in more detail.

32
33

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 Cron

 2 Portable Cron

 3 Configuration

 3.1 Server Scripts

 3.2 CLI Scripts

 3.3 Configurable section


Uniform Server 5.0-Nano. PHP 5.2.10
 4 Periodic tick
Uniform Server 5.1-Nano. PHP 5.3.0

 5 Running Cron

 5.1 UniTray

 5.2 Batch files

 6 General Notes

 6.1 Binary coded

 6.1.1 Example of use

 6.2 Portable Cron and Service

 7 Summary

5.0-Nano Portable Cron

Uniform Server’s portable Cron has been integrated into 5.0-Nano. The script has been
pre-configured to run three scripts Drupal Cron, Moodle Cron and DtDNS auto IP
updater. These are effectively one to two line templates that require enabling to run the
appropriate applications Cron script.

Portable Cron is binary mapped into UniServer’s control space; value assigned is 16 this
method makes it easier to integrate with existing control blocks.

33
34
Starting Cron periodically runs scripts that are listed in file run_cron.php, period being
defined by a sleep function default is every ten minuets. This simple approach is
effective however if you wish to add more flexibility this page provides additional
information.

First I explain basic operation and use.

Note: This script has been rewritten now includes a configuration file refer to
supplementary section (5.2-Nano and 5.3-Nano) for details.

Cron

Cron originated from a Unix environment it is a job scheduler allowing scripts to be run
automatically at a certain time or date.

Cron (chronograph) has become a more general term referring to a periodic tick.

Portable Cron

For a permanent installation of UniServer running as a service you can set-up Windows
to schedule a task similar to Unix Cron check out How To Schedule Tasks in Windows
XP for details?

This is not practical when running UniServer from a USB memory stick. UniServer 5.0-
Nano resolves this with a small script scheduler referred to as portable Cron.

It’s fully integrated into UniServers’s control architecture allowing it to be run from
either batch files or UniTray.

To run a script or scripts a small amount of configuration is required as explained


below.

Configuration

Each script that requires running is added to the Cron script run_cron.php located in
folder UniServer\unicon\main

There are three examples two for server scripts (Drupal and Moodle) and one for CLI
script (DtDNS updater.

Consider the three as templates allowing to to add other scripts.

34
35
Server Scripts

These are generally single pages that require running.

Enable a line by removing the two forward slashes. Insert a script’s full url (effectively
this is what you would type into a browser to run an applications Cron script).

The two enabled example lines as follows:

$dummy = file("http://localhost/moodle/admin/cron.php"); // Uncomment to


enable
$dummy = file("http://localhost/drupal/cron.php"); // Uncomment to
enable

The variable $dummy is just that and is never used.

Note 1: If you have installed the above applications to different folders use the
appropriate folder names.

Note 2: If you have moved the servers remember to add a port number to the url.

For example moving the servers once, Apache port becomes 81 and the above two lines
need to change as follows:

$dummy = file("http://localhost:81/moodle/admin/cron.php"); // Uncomment to


enable
$dummy = file("http://localhost:81/drupal/cron.php"); // Uncomment to
enable

CLI Scripts

CLI scripts may require more than a single line to run. The DtDNS script for example
uses two lines.

The DtDNS automatic updater has been pre-configured and is disabled by default.

These two lines in section List of scripts to be run

35
36
// $cmd = 'start ..\..\usr\local\php\php-win.exe
..\..\plugins\dtdns_updater\dtdns_updater.php';
// pclose(popen($cmd,'r')); // Start detatched process

Need to be un-commented as shown below

$cmd = 'start ..\..\usr\local\php\php-win.exe


..\..\plugins\dtdns_updater\dtdns_updater.php';
pclose(popen($cmd,'r')); // Start detatched process

First line defines a command (script) to be run. If you wish this can expanded into
several lines depends on complexity. Last line is required to detached the process and
must be included otherwise the Cron script is killed.

Configurable section

For completeness I have included the configurable section below:

//########################################################################
###########
//### List of scripts to be run
#
//########################################################################
###########

// To enable Moodle Cron uncomment the next line


// $dummy = file("http://localhost/moodle/admin/cron.php"); // Uncomment
to enable

// To enable Drupal Cron uncomment the next line


// $dummy = file("http://localhost/drupal/cron.php"); // Uncomment
to enable

// To enable DtDNS updater uncomment the next two lines


// $cmd = 'start ..\..\usr\local\php\php-win.exe
..\..\plugins\dtdns_updater\dtdns_updater.php';

36
37
// pclose(popen($cmd,'r')); // Start detatched process

//########################################################################
###########
//### END List
#
//########################################################################
###########

Periodic tick

Starting Cron immediately runs all scripts defined in the list. After this, scripts will run
periodically defined by variable $cron_time currently set to 10 minuets.

This is a reasonable value and should be adequate for most applications. Consider this
to be a minimum value, ideally increase it to a higher value to reduce processor
overhead.

Running Cron

Start the servers and run cron from either the batch files or UniTray

UniTray

 Start: Left click tray icon > Advanced > click Run Portable Cron
 Stop: Left click tray icon > Advanced > click Stop Portable Cron

Batch files

Navigate to folder UniServer\alternative_control

 Start: Double click Start_Cron.bat


 Stop: Double click Stop_Cron.bat

Note: There can be a delay of up to one second before cron stops.

37
38
General Notes

Binary coded

Control architecture, to specifically target Cron it has been binary coded with a value of
16. This caters for impendent or combined control.

Example of use

If you wish to start and stop Cron when starting and stopping both servers from
UniTray

edit file UniServer\unicon\tray_menu\UniTray1.ini

Change these two lines (Note lines are split so as not to break Wiki formatting):

From:

Type: item; Caption: "Start UniServer (Apache MySQL)"; Action: shellexecute;


FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain
%\start_servers.php 7";
ShowCmd: hidden; Glyph: 9

Type: item; Caption: "Stop UniServer (Apache MySQL)"; Action: shellexecute;


FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\stop_servers.php
7";
ShowCmd: hidden; Glyph: 11

To:

Type: item; Caption: "Start UniServer (Apache MySQL)"; Action: shellexecute;


FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain
%\start_servers.php 23";
ShowCmd: hidden; Glyph: 9

Type: item; Caption: "Stop UniServer (Apache MySQL)"; Action: shellexecute;


FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\stop_servers.php
23";
ShowCmd: hidden; Glyph: 11

38
39
Only change required is the parameter value passed to a script. Although I have shown
UniTray it also applies to batch files contained in folder UniServer\alternative_control

Note: Binary 1+2+4+16 = 23

1 - Run Apache server


2 - Run MySQL server
4 - Start Index page
16 - Run cron

Portable Cron and Service

Portable Cron may be run when servers are installed as a service.

However will not restart after restarting PC, you need to manually run Portable Cron
again.

Note:

Reason for the above is logical, it assumes you have installed the services and are
running Uniform Server as a production server. Hence you require finer control and are
using Windows to schedule tasks see How To Schedule Tasks in Windows XP for details?

Summary

If you are reading this sequentially Cron is optional. However security is a must read, a
default Uniform Server installation is to lock it down to local access only.

Before allowing external access change the MySQL server password covered on the
next page.

39
40
5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers
| Perl | UniTray | Security and passwords | Known Issues | Support

Contents

[hide]

 1 Home page

 1.1 Change MySQL Password

 2 Security Center

 2.1 User Management Security

 2.2 Server Security

 2.2.1 Local View

 2.2.2 PHP Safe Mode


Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 2.2.3 Admin Panel Access

 2.2.3.1 Put Apanel on-line

 2.2.4 Server Access

 2.2.4.1 Put Server on-line

 2.2.4.2 Personal Server

 2.2.5 Server Access (SSL)

 2.2.5.1 Put Secure Server on-line

 2.2.5.2 Personal Secure Server

 3 Summary

Security features - Security Center

Regarding security Apanel provides two pages of importance Home (initial opening
page) and Security Center at first sight they look intimidating and give the impression
Uniform Server is insecure especially with all those red links on each page.

Before continuing I must stress Uniform Server is locked down allowing local access
only. If connected to the Internet or Intranet the servers are inaccessible hence are
very secure. This configuration is ideal when using Uniform Server as a development
server but pretty useless for a production Web server (Well! No one can view your Web
site).

If you are not indenting to put the servers on-line you can safely ignore the above two
pages. Even with your servers on-line most of these warnings can be ignored with one
exception always set the MySQL password.

40
41
Its import to understand Uniform Server security features you will then appreciate
these pages provide reminders that you have not set something correctly.

Home page

At the bottom of this page you are presented with a Security Checklist

 Change the username/password for the Admin Panel here


 Change the username/password for the server here
 Change the username/password for the SSL server here
 Change the root password for mysql by editing here
 Run the Security Console and see if everything is OK.

This is a reminder that all the usernames and passwords contain their defaults values
which is ”root”

With the exception of MySQL password there is no need to worry about these until
you enable a server feature that uses them.

Change MySQL Password

Now would be a good time to change the MySQL password, click the here link. This
opens MySQL Server Configuration page. It displays the current MySQL password
root change this to a new value and click Change a confirmation page is displayed.
Return to the Home page the checklist entry for MySQL password has been removed
confirming you are not using the default.

If you had viewed the security center page first under User Management Security
the link to the right of MySQL Server would have displayed unsecure. Clicking this
link would have taken you to the MySQL Server Configuration page. After changing
the password it displays secure

Note 1: The new password takes effect immediately however I would recommend
stopping the servers and closing your browser. This removes any potential problems
associated with sessions and browser cache.

Note 2: The remaining list of entries for name/password; function in a similar way,
once changed, are removed from the list and the corresponding link on the security
center page changes accordingly.

41
42
You can work down this list and change the name/password pairs; they have no effect
until you enable a particular server feature, covered further down this page.

Security Center

This page is accessed either from the Home page or the left menu link Server
Security

It summaries the server security status for enabled features and provides additional
information.

User Management Security

Under this (first) section there are five entries as follows:

1. Admin Panel username/password


2. Personal Server username/password
3. Personal Secure Server (SSL) username/password
4. Server Certificate and Key (SSL) Unsecure indicates no server certificate
5. MySQL Server password

To the right of these you will see either Secure indicating that option has been enabled
or a link named Unsecure indicating that option has not been enabled. The link offers
a short cut to enable that option if you wish to do so.

I have covered the MySQL password this sets the MySQL password for user root. The
first three entries just set a name/password pair. These do not become effective until
the corresponding feature has been enabled see next section.

The fourth entry Server Certificate and Key (SSL) enables the SSL server. A new
server Certificate and key are created this enables the SSL server; for full details check
out Enable SSL

Server Security

Under this (second) section there are five entries as follows:

42
43
Local View

Due to the fact that some PC's have a different hostname set rather than localhost, we use the IP method
here. This checks to make sure that you are viewing the Admin Panel (this) from local.

Requires no explanation.

PHP Safe Mode

This checks to see if PHP is running in SAFE MODE. Now, PHP does not have to run in
SAFE MODE, but if you want the extra security, you can set it by clicking on the UNSECURE
link.

The explanation is clear just want to add that some third party scripts will not run if
safe mode enabled.

Admin Panel Access

While this is another feature that is not throughly important as other features are in place
against outside access to the Admin Panel, this checks to see if your Admin Panel is secured
using the Auth method. Please change this by editing the
C:/UniServer/home/admin/www/.htaccess file.

Apanel is currently locked down for local access only. It is not name/password
protected hence the Unsecure status.

Annoying

It really becomes annoying if you enable password protection when only local access is
allowed.

To prove my point edit file UniServer\home\admin\www\.htaccess

1) Locate these lines: 2) Uncomment the lines by removing the hash “#” as shown

#AuthName "Uniform Server - Admin


Panel 2.0" AuthName "Uniform Server - Admin Panel 2.0"
#AuthType Basic AuthType Basic
#AuthUserFile AuthUserFile
C:/UniServer/htpasswd/home/admin/ C:/UniServer/htpasswd/home/admin/www/.htpasswd
www/.htpasswd Require valid-user
#Require valid-user

Now every time you access Apanel you need to enter a name and password.

More annoying
43
44
What’s more annoying! Can you remember the name/password you entered for Admin
Panel! I assumed you worked through the list mentioned on the Home page and forgot
it.

Well you have just enabled a feature that uses it and locked yourself out.

Using Apanel you can view the current name/password pairs they are displayed in each
set-up page however being locked out that’s not an option. You could disable the above
lines which would give you access alternatively open this file
UniServer\htpasswd\home\admin\www\.htpasswd to view current settings.

One reason for showing this, notice the file path maps (home\admin\www\) to the
location of the .htaccess file. This applies to the other password files.

Essential

Note: It is essential to enable this feature if you put Apanel on-line

Put Apanel on-line

Although I never recommend this you can put Apanel on-line allowing access from
either the Internet or Intranet.

Edit file UniServer\home\admin\www\.htaccess

1) Locate these lines: 2) Disable local access only by commenting each line with an hash "#" as shown

Order Deny,Allow #Order Deny,Allow


Deny from all #Deny from all
Allow from 127.0.0.1 #Allow from 127.0.0.1

Server Access

If you are running your server in Production Mode, Skip this one. If not and you would like to
add more security to the server by blocking it using the Auth method, then change this in by
editing the C:/UniServer/www/.htaccess file.

Server (www) is currently locked down for local access only. It is not name/password
protected hence the Unsecure status.

Put Server on-line

44
45
Production server means you have put your server on-line to do this edit the following
file: UniServer\www\.htaccess

1) Locate these lines: 2) Disable local access only by commenting each line with an hash "#" as shown

Order Deny,Allow #Order Deny,Allow


Deny from all #Deny from all
Allow from 127.0.0.1 #Allow from 127.0.0.1

Note: No need to restart the server changes are Automatically picked up by Apache.

Personal Server

A personal server means you have restricted access using a name and password.

To enable this feature edit file: UniServer\www\.htaccess

1) Locate these lines: 2) Uncomment the lines by removing the hash “#” as shown

#AuthName "Uniform Server - Admin


Panel 2.0" AuthName "Uniform Server - Admin Panel 2.0"
#AuthType Basic AuthType Basic
#AuthUserFile AuthUserFile
C:/UniServer/htpasswd/home/admin/ C:/UniServer/htpasswd/home/admin/www/.htpasswd
www/.htpasswd Require valid-user
#Require valid-user

Now every time a user browsers your server from either the Internet or Intranet is
challenged for a name and password.

Server Access (SSL)

If you are running your server in Production Mode, Skip this one. If not and you would like to
add more security to the server by blocking it using the Auth method, then change this in by
editing the C:/UniServer/ssl/.htaccess file.

Server (ssl) is currently locked down for local access only. It is not name/password
protected hence the Unsecure status.

Put Secure Server on-line

Production server means you have put your server on-line to do this edit the following
file:

UniServer\ssl\.htaccess

1) Locate these lines: 2) Disable local access only by commenting each line with an hash "#" as shown

45
46
Order Deny,Allow #Order Deny,Allow
Deny from all #Deny from all
Allow from 127.0.0.1 #Allow from 127.0.0.1

Note: No need to restart the server changes are Automatically picked up by Apache.

Personal Secure Server

A personal secure server means you have restricted access using a name and
password.

To enable this feature edit file: UniServer\ssl\.htaccess

1) Locate these lines: 2) Uncomment the lines by removing the hash “#” as shown

#AuthName "Uniform Server - Admin


Panel 2.0" AuthName "Uniform Server - Admin Panel 2.0"
#AuthType Basic AuthType Basic
#AuthUserFile AuthUserFile
C:/UniServer/htpasswd/home/admin/ C:/UniServer/htpasswd/home/admin/www/.htpasswd
www/.htpasswd Require valid-user
#Require valid-user

Now every time a user browsers your server from either the Internet or Intranet is
challanged for a name and password.

Note: All data and name/password are encrypted before being sent.

Summary

Security-center is a powerful Apanel feature, it collects all user configurable security


options in one place. It acts as a reminder and provides short cuts (links) to change
passwords. It also allows you to confirm you have enabled a security feature.

The next page covers how to enable SSL this has been fully integrated into 5.0-Nano
making the whole process easy.

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0

46
47
[hide]

 1 Creating a new server certificate and key

 1.1 Apanel option 1

 1.2 Apanel option 2

 1.3 Manuall option

 1.4 UniTray option

 1.5 Common to all options

 2 General notes

 3 Browser issues and Problems

 3.1 FireFox 3.0.11

 3.2 IE 7

 4 How to put SSL server on-line

 5 Name/Password protected server

 5.1 Change name and password

 6 Name/Password protected single folder

 7 Name/Password protected multi folders

 8 Related Information

 9 Summary

How to enable SSL on Uniform Server 5.0-Nano

The server has been pre-configured to run SSL, place any pages/site you wish to be
encrypted in the root folder ssl.

Uniform Server does not include a test server certificate/key pair hence a default
installation has SSL disabled. The reason is one of security a certificate/key pair must
be unique to that server after creating a new server certificate/key pair SSL is
automatically enabled in Apache's configuration file.

Creating a new server certificate and key

To create a new server certificate and key use one of the following options:

Apanel option 1

 Left menu, scroll down to Plugin Manager


47
48
 Click link Server Key & Cert Gen
 A new page opens Server Certificate and Key Generation
 Click link Generate.

Apanel option 2

 Left menu, click link Server Security a new page opens Security Center.
 Scroll down to section Server Certificate and Key (SSL)
 To the right the link will display Unsecure click this link
 It takes you to page Server Certificate and Key Generation as per
Apaneloption 1

Manuall option

 Navigate to folder unicon\key_cert_gen


 Double click on Run.bat

UniTray option

 Left or right mouse click on UniTray Icon


 Mouse-over Advanced and click Server Certificate and key Generator

Common to all options

The certificate and key generation script will prompt for three pieces of information.

If you are running a local test server just press enter to accept the defaults.

If you have a real domain name for example www.fred.com enter that at the CN

Three pieces of information requested:

 CN (common name prompt) Enter localhost or real domain name


 OU (organisation unit) Not strictly required hence enter something that meets
your requirements
 O (organisation) Not strictly required hence enter something that meets your
requirements

General notes

48
49
Note 1: Once the server certificate and key have been generated re-start the servers for the new configuration to be
picked up by Apache.

Note 2: View secure, pages by typing: https://localhost/ into your browser. Or


if you have a real domain name: https://www.mydomain.com/

Note 3: You can change the defaults for CN, OU and O edit file: unicon\key_cert_gen\ssl_gen.php
Locate this section:

// Get user input


//********* Edit defaults
*****************************************************

$str1 = &prompt_user(" CN Common Name. Your full domain name ",


"localhost");
$str2 = &prompt_user(" OU Organization Unit (eg, section) ", "Secure
demo");
$str3 = &prompt_user(" O Organization Name (eg, company) ",
"UniServer");
print "\n ";

//********* Do not Edit below this line


***************************************

If your site is accessed by typing this into a browser mydomain.net and your company is Fred and has a
section Software the lines are as follows:

// Get user input


//********* Edit defaults
*****************************************************

$str1 = &prompt_user(" CN Common Name. Your full domain name ",


"mydomain.net");
$str2 = &prompt_user(" OU Organization Unit (eg, section) ", "Fred");
$str3 = &prompt_user(" O Organization Name (eg, company) ",
"Software");
print "\n ";

//********* Do not Edit below this line


***************************************

Note 4: It is strongly recommend obtaining a signed certificate by a trusted CA check out Uniform Server’s Wiki for
details.

SSL Part 2: CAcert Signing Process

You will require the certificate signing request this is located in folder
unicon\key_cert_gen file name server.csr

Note 5: If you need to create a new key and certificate repeat the above.

Browser issues and Problems


49
50
Using self-signed certificates your browser will issue error messages.
This section looks at two browsers, FireFox 3.0.5 and IE7 which provide examples of
the type of error messages and how to resolve them.

FireFox 3.0.11

On viewing a secure page in FireFox you will be greeted with this little chap and the
following error message:

Secure Connection Failed


The certificate is not trusted because it is self signed.
(Error code: sec_error_ca_cert_invalid)

Solution is to import the certificate into your browser as follows:

1. Click link Or you can add an exception…


2. Click link Add Exception (opens new pop-up)
3. Click link Get Certificate (top right)
4. Box bottom left Permanently store this exception Check this box
5. Click link Confirm Security Exception

This saves the Certificate and allows you to view the secure server unrestricted.

Note: to the left of https://localhost


the symbol turns blue. Blue indicates.
a secure encrypted connection.

Click this icon.


A drop down is displayed the information
shows the connection is secure.

What about Which is run by unknown!

A standard SSL certificate even signed by a CA will not resolve, “Which is run by
unknown” issue. What is required is something known as an Extended Validation (EV)
SSL certificate this raises the security level to green. You can purchase this type of
signing however it comes at a high price because both the site and site owner require
verification.

50
51
IE 7

On viewing a secure page in IE you will be greeted with a read sheild and the following
error message:

There is a problem with this website's security certificate


The security certificate presented by this website was not issued by a trusted certificate authority.
Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server.

On the alert page click the link Continue to this website (not recommended).
This allows the page to be displayed notice the navigation bar turns "red"

Import the certificate:

1. Click the icon Certicicate error

to the right of the navigation bar.

A pop-up is displayed Untrusted Certificate.

2. At the bottom of this pop-up Click view

Certificates

A new pop-up is displayed Certificate

1. Click Install Certificate

Follow the instructions

2. Either refresh the page or Restart IE

When page is viewed a normal secure

navigation bar is display .

51
52

How to put SSL server on-line

The server has been locked down allowing only local access. You can develop sites
while connected to the Internet knowing that external access has been restricted.

To enable external access either on a local network or from the Internet you need to
edit file:

UniServer\ssl\.htaccess

Locate the following lines:

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

These lines restrict access to localhost (port 127.0.0.1)

 Order Deny,Allow
 Deny from all
 Allow from 127.0.0.1

Comment the lines out by adding a hash "#" as shown

#Order Deny,Allow
#Deny from all
#Allow from 127.0.0.1

There is no need to restart the server, your server is now externally accessible.

Note 1: All lines with a comment are disabled and ignored by Apache.

Note 2: There is a corresponding .htaccess file for the unencrypted server this is
located in root folder www edit this file as above to put-this part of the server on-line.

Name/Password protected server

The entire SSL server can be name/password protected as follows:

52
53
Edit file UniServer\ssl\.htaccess

Locate the following lines:

#AuthName "Uniform Server - Secure Server Access"


#AuthType Basic
#AuthUserFile /htpasswd/ssl/.htpasswd
#Require valid-user

To enable name/password protection un-comment the lines by removing the hash "#"
as shown

AuthName "Uniform Server - Secure Server Access"


AuthType Basic
AuthUserFile /htpasswd/ssl/.htpasswd
Require valid-user

No need to restart the servers .htaccess files are automatically picked up.

Access a secure page on the server, e.g type https://localhost into your browser. If
you have a real domain name use that.

You will be challenged for a name and password. The defaults are root and root.

Change name and password

You have two methods of changing the name and password either using Apanal or
manually as follows.

Apanel

1. Start Apanel either from Unicontroller or by typing http://localhost/ananel


into your browser.
2. Using the left menu navigate to section Configurations and click link
Private Secure Server Config.
3. This opens the Private Secure Server Configuration (SSL) page and
displays the current name and password, change these and click the Change
button.

53
54
Manually edit password file

1. Edit file UniServer\htpasswd\ssl\.htpasswd


2. Change the current name and password (in that order) to your new values

Note: Use a single colon ":" between name and password do not enter any spaces or
carriage returns at the end of the password.

Name/Password protected single folder

To protect a single folder and not the entire SSL server copy the .htaccess file to a
folder you want protecting.

Edit the copied .htaccess file as explained above, the four lines look like this

AuthName "Uniform Server - Secure Server Access"


AuthType Basic
AuthUserFile /htpasswd/ssl/.htpasswd
Require valid-user

Make sure you have not changed the .htaccess file in SSL otherwise the entire server
will remain under name/password control. Hence the lines must be commented out
asshown:

#AuthName "Uniform Server - Secure Server Access"


#AuthType Basic
#AuthUserFile /htpasswd/ssl/.htpasswd
#Require valid-user

Note: The name and password are those used for the main SSL server hence change
these as described above.

Name/Password protected multi folders

It is possible to assign a user their own protected folder with a unique name/password
pair. For example take these three users John, Mike and Ruth

First create three new folders in UniServer\udrive\htpasswd\ssl

 UniServer\htpasswd\ssl\john

54
55
 UniServer\htpasswd\ssl\mike
 UniServer\htpasswd\ssl\ruth

Copy file UniServer\htpasswd\ssl\.htpasswd into each of the above folders.

Edit each copied .htpasswd file to have a new name/password pair you want to assign
to each use.

Now create three new folders in UniServer\ssl

 UniServer\ssl\john
 UniServer\ssl\mike
 UniServer\ssl\ruth

Copy the unmodified file UniServer\udrive\ssl\.htaccess to each of these new folders.

Edit each .htaccess file in turn, enable password protection and change path to new
location of corresponding .htpasswd file. I have shown an example for john:

AuthName "John please enter your name and password"


AuthType Basic
AuthUserFile /htpasswd/ssl/john/.htpasswd
Require valid-user

Note 1: All files and sub-folder in Johns folder are protected by his name/password pair.

Note 2: John has decided to share the information in his protected area with Ruth but
not with Mike. Hence John's .htpasswd file will look similar to this:

John:xxxxxxx
Ruth:yyyyyyy

Note 1: Do not enter any spaces after John's password only a carriage return is
allowed. After Ruth's password do not enter any spaces or carriage returns.

Note 2: You can add any number of name/password pairs to a .htpasswd file.

Related Information

Authentication: Introduction -- How to restrict access directories files etc..

55
56
SSL Part 2: Generate CSR -- How to obtain a free certificate

Stunnel: SSL Certificate -- Background information

SSL Part 1: Key & Certificate -- Background information

Summary

The above has shown how easy it is to enable SSl on Uniform Server 5.0-Nano a few
mouse clicks is all it takes. Likewise its easy to password protect the server, folders and
files. Next page covers running more than one server on the same PC.

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 Overview

 1.1 Run script option 1

 1.2 Run script option 2

 1.3 Script
Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 2 Clone servers

 3 UniTray

 4 General Notes

 4.1 Important note MySQL port

 5 Related links

 6 Summary

Uniform Server 5.0-Nano Multi-Servers

One of Uniform Server’s unique features is the capability to run more than one
complete server on the same PC.

You can use this to great advantage and prevent server clashes.

Moving UniServer increments the tray icon displaying a new digit for each server.

56
57
In reality it’s not just a port change the servers are reconfigured.

Running server status displays the new server's configuration.

Overview

To run multi-servers on the same PC several items require changing such as server
ports, service names, Apache and UniTray executable names.

Manually changing these can be time consuming and prone to errors. The process has
been automated with the following script: move_servers.php

Run script option 1

The script is run from the following batch file Run.bat

 Close all running servers including UniTrays


 Navigate to folder unicon\move_servers
 Double click Run.bat and enter appropriate values.

Run script option 2

Alternatively you can run the script from UniTray:

 Assumes this is the only server currently running. If not close all other running
servers including their UniTrays.
 Use either the right or left menu
 Mouse-over "Advanced"
 Click Move Servers multi-server operation

Script

Unless you want to use specific ports and names accept defaults shown in brackets by
pressing enter.

Note: If you manually change service or Apache executable names

57
58
make sure these have eight or less characters.

The script uses existing names and either adds a digit to end of this name

or increments an exiting one. Ports are incremented, invalid ports are skipped.

When run for the first time output looks like 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] :
Current MySQL name = mysqld-opt.exe Proposed name [mysqld-opt1.exe] :

===== SERVICES Service names ====

Current Apache name = ApacheS1 Proposed name = [ApacheS2] :


Current MySQL name = MySQLS1 Proposed name = [MySQLS2] :

===== UniTray Controller ====


Current UniTray name = UniTray1.exe Proposed name [UniTray2.exe] :

===== eAccelerator ====

If running a single server do not disable eAccelerator.


For multi-servers enter Y

Disable_eAccelerator type Y or N [Y] :

58
59

Commit type Y or N [Y] :


#############################################################################
###

Clone servers

If you know in advance the number of additional servers that will be run create them at
the same time, just makes the task a little easier.

1. Extract a new copy of Uniform Server


2. Move the server using the above script.
3. Clone this server (copy to a new folder)
4. Move the server using the above script.
5. Repeat steps 3 to 4 for each new server.

UniTray

Unitray's icon is updated to reflect changes (digit increments)

If you wish to change the icon displayed edit the images however do not change thir
names (tray_image_1.dat-tray_image_9.dat)

These are used within UniTray's configuration file and are dynamically updated when
servers are moved.

General Notes

If all the servers are to be installed as a service

there is no need to disable eAccelerator.

If the servers are to be run as a standard program eAccelerator

must be disabled otherwise Apache will fail to start.

Remember to append the new port number to access server pages

for example if the server was moved to port 81 type the following into your browser:

 http://localhost:81/

59
60
Important note MySQL port

When installing third party software you may be given a choice of entering a port
number,

enter the one corresponding to the moved server (you can find this by running server
statusfrom UniTray)

If this option is not provided (generally not) then append it to the server

name e.g. localhost:3307

Related links

Running multi servers on the same PC prevents awaking a draconian dragon!

Not sure what a draconian dragon is follow the first two links.

DtDNS Introduction Design notes for DtDNS updater and how to avoid draconian dragons.

PHP cURL Tutorial explaining cURL basics. Techniques are used in Server Status. Also shows how to
Introduction avoid draconian dragons.

Summary

Having a capability of running more than one server on the same PC allows you to
simulate external servers, for more information follow the above related links.

I run my personal Media Wiki on icon 2 (servers moved one level) hence I can take my
USB stick and know it will not clash with an IIS server on another PC.

Next page covers running Perl on Uniform Server 5-Nano.

60
61

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 ActivePerl

 2 Plugins

 2.1 Download

 2.2 Install

 3 Support enabled
Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 3.1 Auto tracking

 3.2 Apanel support

 3.3 UniTray support

 3.3.1 Force shebang update

 3.3.2 Convert to Unix format

 4 Related Topic Links

 5 Summary

Uniform Server 5.0-Nano and Perl

61
62
Although for server control Uniform Server no longer uses Perl it remains fully
supported.

Perl is a very powerful scripting language to do it justice two plugins are provided full
and mini Perl.

Full-Perl as the name implies consists of the core program and all modules while mini-
Perl consists of the core program and a collection of commonly used Perl modules.

ActivePerl

Uniform Server's Perl plugins use ActivePerl from ActiveState current version is
ActivePerl 5.10.0.1006 it’s an industry-standard Perl distribution.

ActivePerl is multi platform, runs on Windows, Linux, Mac OS X, Solaris, AIX and HP-
UX.

Apart from being robust and reliable one of its main features is portability.

Plugins

There are two plugins to choose from either full or mini.

Perl Versions

 ActivePerl 5.10.0.1005
 ActivePerl 5.10.0.1006

The mini plugin is suitable for majority of smaller applications. Larger and more
advanced application download the full plugin.

Download

Downloaded the plugins from from Sourceforge choose one of the following:

ActivePerl 5.10.0.1005

File name Compressed Uncompressed Comments


Contains Perl core program with a collection of commonly
V5.0_mini_perl.exe 5.07 MB 16.5 MB
used Perl modules.
Contains Perl core program with a collection of commonly
V5.0_mini_perl.zip 7.13 MB 16.5 MB
used Perl modules.
V5.0_full_perl.exe 10.6 MB 52.2 MB Contains Perl core program and full set of Perl modules.

62
63
V5.0_full_perl.zip 16.0 MB 52.2 MB Contains Perl core program and full set of Perl modules.

ActivePerl 5.10.0.1006

File name Compressed Uncompressed Comments


Contains Perl core program with a collection of commonly
V5.1_mini_perl.exe 5.14 MB 16.9 MB
used Perl modules.
Contains Perl core program with a collection of commonly
V5.1_mini_perl.zip 7.21 MB 16.9 MB
used Perl modules.
V5.1_full_perl.exe 10.9 MB 54.1 MB Contains Perl core program and full set of Perl modules.
V5.1_full_perl.zip 16.5 MB 54.1 MB Contains Perl core program and full set of Perl modules.

Non-Perl users I hope will appreciate what a significant overhead it is even with mini-
Perl installed hence the reason for making Perl a plugin.

If space is at a premium Perl users can start with mini-Perl and add modules as
required from full-Perl.

Note: Don't mix modules from different versions.

Install

exe

By far the easiest way to install Perl is to download one of the executables and install as
follows:

 Copy file V5.#_mini_perl.exe or V5.#_full_perl.exe to folder UniServer


 Double click on file to run the self-extracting archive
 For Perl to be picked up restart the servers.

Creates two new folders bin and lib in folder UniServer\usr These contain the Perl
program and Perl modules respectively.

zip

Installing from a zip file requires a few extra steps as follows:

 Copy file V5.#_mini_perl.zip or V5.#_full_perl.zip to any folder.


 Extract to current path.
 Copy folders bin and lib to folder UniServer\usr
 For Perl to be picked up restart the servers.

63
64
These contain the Perl program and Perl modules respectively.

Support enabled

UniServer automatically detects the presence of Perl and enables functionality to


support it in both Apanel and UniTray.

Auto tracking

Perl scripts are placed in folder UniServer\cgi-bin and any sub-folders as appropriate.

Each script requires a shebang this must be an absolute path to the Perl executable for
example:

#!C:/Test/UniServer/usr/bin/perl.exe

Moving UniServer to another location automatically updates this shebang.

Server control on detecting a server move writes a new shebang to all files with a .pl or
.cgi extension.

An automatic update is initiated only when the servers are moved.

Important

After extracting a third party Perl script to cgi-bin you must either move the servers or
force a shebang update using UniTray. Alternatively you can manually edit each file.

Apanel support

With Perl installed a new menu option become available in Apanel. This displays the Perl
environment and additional information.

UniTray support

Force shebang update

Perl scripts contain a Shebang (first line) this informs a server where to find the Perl
program. Uniform Server is dynamic and tracks any path changes automatically
updating the Shebang.

64
65
However if the server remains static and you have added new scripts in the cgi-bin
folder the Shebang is never updated. Hence run the following menu item after installing
new scripts. It updates the Shebang in all files to the current Perl location.

left click tray icon > Advance > click "Perl Shebang Update cgi-bin"

Tip:

When writing Perl scripts you can use the following for the shebang:

#!

From UniTray run "Perl Shebang Update cgi-bin" and all pages will be updated with the
correct shebang.

Convert to Unix format

Perl scripts developed on Windows will not run on a Unix machine they require
conversion to Unix format.

Run the conversion script from UniTray as follows:

left click tray icon > Advance > click "Perl win2unix + Shebang Update"

This script copies all files in cgi-bin to a new folder \cgi-bin-unix\

Scripts in this new folder are converted from Windows to Unix format.

 Converts end of line: Dec(#10#13=>#13) Hex 0D0A to 0A


 Replaces Windows shebang with Unix shebang

Related Topic Links

Perl CGI Hello World - Short snippets to get you started with Perl

65
66
Summary

Uniform Server has been pre-configured for Perl hence after installing either of the
plugins Perl is ready to run scripts.

For convenience any Uniform Server plugin requiring Perl support such as AWStats
come complete with mini-Perl and any additional modules required to support that
plugin.

Next page covers UniTray

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 UniTray - Quick start servers

 1.1 UniTray Help

 1.2 Server Status - Diagnostics

 2 Configuration
Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 3 Start and Stop UniTray

 3.1 Stop_UniTray.bat

 3.2 stop_unitray.php

 3.3 stop_unitray()

 4 Variables not to be change

 5 Summary

Uniform Server 5.0-Nano UniTray

Aestan Tray was developed by Onno Broekmans and has stood the test of time. There
are alternatives but none have the flexibility and controllability as Aestan Tray. It is
extremely malleable hence has been integrated into Uniform Server to produce UniTray.

66
67
Should you not like UniTray’s offerings edit the configuration file to provide the solution
you want? Note the configuration file is dynamically updated hence certain items should
not be changed these are covered on this page after a basic introduction.

UniTray - Quick start servers

For connivance I have reproduced this section from the introduction page.

There are two menus corresponding to the left and right mouse buttons.

The left menu controls servers as a standard program while the right menu controls the
servers as a service.

Ergonomics are such that the order of complexity is from top to bottom with
commonality reproduced in both menus for connivance.

LEFT MENU RIGHT MENU


Run servers as a standard program Run servers as a service

Quick Start guide


Run Servers as standard Program

67
68
 Start UniTray: In folder UniServer double click on Start.exe tray icon created.

 L3) Check servers are runnable: Left or Right click tray icon > click Server Status.

All ports must be free to use.

 L1) Start Uniform Server. Left click tray icon > click Start UniServer

 L2) Stop Uniform Server. Left click tray icon > click Stop UniServer

 L4) Close UniTray. Left or Right click tray icon > click Exit

Run Servers as a Service

 Start UniTray: In folder UniServer double click on Start.exe tray icon created.

 R3) Check servers are runnable: Left or Right click tray icon > click Server Status.

All ports must be free to use.

 R1) Start Uniform Server. Right click tray icon > click Install and Run all Services

 R2) Stop Uniform Server. Right click tray icon > click Stop and Remove All Services

 R4) Close UniTray. Left or Right click tray icon > click Exit

Note: Double click on tray icon to open Apanel in default browser.

In reality server control makes no destitution between running as a standard program


or service you are free to mix the two (even from a USB memory stick).

Server control will attempt to perform the action requested, generally if the request is
invalid it gets silently ignored (trying to run the servers twice) or a warning message is
displayed (Perl shebang update with no Perl plugin).

This interlocking action attempts to prevent inadvertent server failure.

UniTray Help

Detailed information is provided for each menu option in file help.html.

To access this file either

 Double click on file UniServer\help.bat

Or

 From UniTray Left click tray icon > click Server Documentation
 Page displayed, click link help.html

68
69
Server Status - Diagnostics

Server Status provides a mixed bag of information:

 Before starting servers checks to see if ports are in use which would prevent the
servers starting
 Displays what ports servers are configured for.
 Displays what servers are running and in what mode (standard program or
service)
 With servers running displays IP address as seen from the Internet.
 Checks servers are accessible from the Internet, uses the above IP address

Configuration

UniTrays configuration file allows you to delete, add or modify menu items.

Location: UniServer\unicon\tray_menu\UniTray1.ini

Note: If you have moved the servers, the ini file will be renumbered accordingly.

Scanning down the file you will notice it is split into sections left, right and common
menus.

Suppose you want to start the servers without displaying the index page.

Locate the following line (Note: Line split to prevent breaking Wiki page ):

Type: item; Caption: "Start UniServer (Apache MySQL)";


Action: shellexecute; FileName: "%PHP%\php.exe";
Parameters: " -n %ServerConMain%\start_servers.php 7";
ShowCmd: hidden; Glyph: 9

Replace with this:

Type: item; Caption: "Start UniServer (Apache MySQL)";


Action: shellexecute; FileName: "%PHP%\php.exe";
Parameters: " -n %ServerConMain%\start_servers.php 3";
ShowCmd: hidden; Glyph: 9

69
70
Difference between the two lines is the parameter passed to the script
start_servers.php

Parameters are binary coded ( see Script Parameters) and override defaults changing
from 7 to 3 starts only Apache and MySQL servers.

The corresponding parameter for stop servers should be changed accordingly.

Start and Stop UniTray

With all those start stop files UniTray control looks complex in reality they are slight
variations of performing the same thing. If you follow a control path it ends in a single
function. This applies not only to UniTray it is the heart of UniServer’s control
architecture.

It’s probably worth following one of these paths for example UniTray’s stop.

Stop_UniTray.bat

All batch files are nothing more than a user interface to run a PHP CLI script.

UniServer\unicon\tray_menu\Stop_UniTray.bat containes the following line:

..\..\usr\local\php\php-win.exe -n stop_unitray.php

This line runs PHP interpreter which in turn runs the script stop_unitray.php

It uses relative paths for portability

stop_unitray.php

All PHP scripts run from a batch file perform as the first task a server move check.

If servers have moved they are reconfigured accordingly, the script then continues.

UniServer\unicon\tray_menu\stop_unitray.php containes the following lines:

run_location_tracker(); // Have servers moved update configuration accordingly


stop_unitray(); // Run stop function

stop_unitray()

70
71
All server control functions are located in file:

UniServer\unicon\main\includes\functions.php

After removing irrelevant information the function stop_unitray() looks like this:

global $us_con_tray_menu; // Location of UniTray


$UniTray_exe = get_unitray_exe(); // get program name
$UniTray_id = get_unitray_id(); // get id name

$cmd1 = "start ".$us_con_tray_menu."/".$UniTray_exe; // path to executable


$cmd2 = " -quit -id=".$UniTray_id; // set ID
$cmd =$cmd1.$cmd2; // Unitay does not
like / hence
$cmd = preg_replace('/\//','\\', $cmd); // Replace / with \

exec($cmd,$dummy,$return); // run command

Real point of showing this function, although it is the last one to be called from our
script the function itself assumes things have changed. The server is dynamic UniTray
exe may have been renamed likewise the ID in the configuration file may have been
updated. Hence these are read from source using the get functions.

Variables not to be change


I mentioned there are several variables in UniTray’s configuration file you should not
these are dynamically configured. I have listed these below:

ID=UniTrayController1 Digit incremented when server moved


TrayIcon=tray_image_1.dat Digit incremented when server moved
Dynamic variable passed UniTray start (top) Type: commandline; Name: top;
USRoot; Value: "%top%";
ParamName: "ustop"

Summary

UniTray is very versatile and easy to use don’t worry about any of the techno babble
just use it.

Next page covers security and passwords.

71
72

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents

[hide]

 1 Default installation

 2 Allowing external access

 3 Name Password protection


Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
 3.1 A) Admin Panel Configuration

 3.2 B) Private Server Configuration

 3.3 C) Private Secure Server Configuration

 4 MySQL Password

 5 Summary

Security and passwords

New users may find Uniform Server’s security features a little bewildering this page
attempts to explain their use and when passwords are required.

Default installation

72
73
After extracting Uniform Server 5.0-Nano it’s ready to run and very secure. Apache and
MySQL servers are locked down allowing only local access. No external access allowed
from either Intranet or Internet hence while connected to these you can safely develop
a web site.

Uniform Server 5.0-Nano achieves this lock down through the use of .htaccess files
placed in each folder that is protected. The file also protects any sub-folders in that
folder.

Each of these folders contains an .htaccess file:

\UniServer\home\admin\www – Control panel for the server


\UniServer\www – Server web-root folder (your web site )
\UniServer\ssl – Server secure web-root (your secure web site)

Open either of the .htacces files and you will find these three lines

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

The first line informs Apache to look for the next two lines and execute them in that
order (Deny and then Allow)

The second line denies access to every one (all)

The third line is very specific and allows access from IP address 127.0.0.1 this is the IP
address of the local machine. Hence Apache is locked down allowing only localhost
access. (IP address 127.0.0.1 is also referred to as the local loop back address)

Allowing external access

To put your servers on-line you need to allow external access this is achieved by
commenting (adding a hash “#” to the beginning of each line) the three lines as shown
below:

#Order Deny,Allow
#Deny from all

73
74
#Allow from 127.0.0.1

Alternatively you could delete the three lines.

With the lines commented everyone connected to the Internet or Intranet has access to
the folders that the .htaccess file was protecting.

Your web site or sites are placed in the folders:

\UniServer\www – Server web-root folder (your web site )


\UniServer\ssl – Server secure web-root (your secure web site)

These are now available and pages will be served by Apache from these folders.

However modifying the .htaccess file in folder \UniServer\home\admin\www you


will have allowed everyone access to your server’s control panel (kiss your servers
goodbye). OK I was after a dramatic impact there are additional security features that
prevents this however I recommend you do not place Apanel on-line, if you must! Make
sure you enable name/password protection.

Name Password protection

You may wish to prevent other Internet users accessing your server (a personal web
server) this can be achieved by forcing a user to enter a name and password. Uniform
Server has this facility pre-configured, Apanel allows you to set a name and password
for three specific areas of the server. Under Configurations (left menu) you will find
these three links:

 Admin Panel Configuration


 Private Server Configuration
 Private Secure Server Configuration

After setting a name and password they do not become effective unless enabled in
the appropriate .htaccess file, lets look at these in more detail.

A) Admin Panel Configuration

If you have placed Apanel on-line it must be protected with a name and password as
follows:

74
75
Edit file: \UniServer\home\admin\www\.htaccess

At the bottom of this file un-comment (remove the hash”#”) the last four lines as
shown

AuthName "Uniform Server - Admin Panel 2.0"


AuthType Basic
AuthUserFile /htpasswd/home/admin/www/.htpasswd
Require valid-user

First line is the text displayed in the browser pop-up

Second line informs Apache the type of authentication (Basic)

Third line is the location of the file containing the name/password pair

The forth line forces Apache to instruct a browser a name and password are required.

Change name and password using Apanel, click on the link “Admin Panel
Configuration” a new page opens showing current name/password. Enter new
name/password click change.

Alternatively edit file /htpasswd/home/admin/www/.htpasswd and enter a name and


password in the following format.

aname:apassword

Note: Do not add any additional characters or carriage return (enter key) after the
password.

Test: Enter the following into your browser

http://localhost/apanel/

or

http://your_domain/apanel/

In both cases you will be challenged for a name and password.

Note: Default name and password are root:root

B) Private Server Configuration


75
76
You can protect you web site with a name and password as follows:

Edit file: \UniServer\www\.htaccess

At the bottom of this file un-comment (remove the hash”#”) the last four lines as
shown

AuthName "Uniform Server - Server Access"


AuthType Basic
AuthUserFile /htpasswd/www/.htpasswd
Require valid-user

First line is the text displayed in the browser pop-up

Second line informs Apache the type of authentication (Basic)

Third line is the location of the file containing the name/password pair

The forth line forces Apache to instruct a browser a name and password are required.

Change name and password using Apanel, click on the link “Private Server
Configuration” a new page opens showing current name/password. Enter new
name/password click change.

Alternatively edit file /htpasswd/www/.htpasswd and enter a name and password in


the following format. aname:apassword

Note: Do not add any additional characters or carriage return (enter key) after the
password.

Test: Enter the following into your browser

http://localhost

or

http://your_domain/

In both cases you will be challenged for a name and password.

Note: Default name and password are root:root

C) Private Secure Server Configuration


76
77
You can protect you secure web site with a name and password as follows:

Edit file: \UniServer\ssl\.htaccess

At the bottom of this file un-comment (remove the hash”#”) the last four lines as
shown

AuthName "Uniform Server - Server Access"


AuthType Basic
AuthUserFile /htpasswd/ssl/.htpasswd
Require valid-user

First line is the text displayed in the browser pop-up

Second line informs Apache the type of authentication (Basic)

Third line is the location of the file containing the name/password pair

The forth line forces Apache to instruct a browser a name and password are required.

Change name and password using Apanel, click on the link “Private Secure Server
Configuration” a new page opens showing current name/password. Enter new
name/password click change.

Alternatively edit file /htpasswd/ssl/.htpasswd and enter a name and password in the
following format. aname:apassword

Note: Do not add any additional characters or carriage return (enter key) after the
password.

Test: Enter the following into your browser

https://localhost/

or

https://your_domain/

In both cases you will be challenged for a name and password.

Note 1: Default name and password are root:root

77
78
Note 2: Make sure you have generated a new server certificate and key as detailed
on this page.

MySQL Password

The MySQL server has been locked down for local access and protected by a password.
If you have not put Apache on-line there is no need to change the password (default
root). However it is good practice to change this at the earliest opportunity.

With Apache on-line there is a risk either through malicious intent or a rouge script to
gain access to the MySQL server’s root user hence change the password. Note access
remains local because user root has been restricted to local access.

To change the MySQL password use Apanel, click on the link “MySQL Server
Configuration ” a new page opens showing current password (default root). Enter
new password click change; there is no need to re-start the server.

Note 1: After changing either the MySQL port or password you may find server access
is no longer possible using phpMyAdmin. A common cause is your browser cache close
down servers and browser then restart.

Note 2: If for any reason the password becomes corrupted don’t panic use the
password recovery link, found under Apanel's Plugin Manager section (left menu).
Alternatively check out this page, how to manually create a new password.

Note 3: If you need to quickly back-up your databases no need to use phpMyAdmin or
any other tool just back-up folder UniServer\usr\local\mysql\data this contains all
databases.

Summary

In terms of security if you are using the server for development there is nothing to do.

If you are putting the servers on-line they need to be enabled first by editing each of
the .htaccess contained in each web-root folder (www and or ssl). Comment the lines
as shown:

#Order Deny,Allow
#Deny from all
#Allow from 127.0.0.1

78
79
If you want a personal server with name/password access uncomment the last four
lines in the above .htaccess files. Remember to change the name/password pairs using
Apanel or manually edit the appropriate file.

Note 1: All names and passwords are set to a value of root

Note 2: Additional information can be found on the Security features page this includes
Apanel's Security Center page

[[5.0-Nano: Known Issues | Next page] covers known issues and problems, where
applicable offers solutions.

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0

 1 MySQL host name 127.0.0.1 or localhost

 1.1 No registry dust and portable

 1.2 Registry dust and portability sacrificed

 2 Services not starting

 2.1 Solution 1

 2.2 Solution 2

 3 Servers not starting

 3.1 port 80 kill process XP Pro

 3.2 port 80 kill process XP Home

 3.3 Unistall IIS

 3.4 Disable IIS

 3.5 Move IIS to another port

 3.6 Move UniServer to another port

 3.7 Skype

 4 Server not accessible from Internet

 4.1 Server Status

 4.1.1 IP address

 4.1.2 Accessibility

 5 HOSTS File

79
80
 5.1 Cannot access server using localhost but 127.0.0.1 works

 5.1.1 Error message localhost/apanel has no data

 5.1.2 Localhost does not work on another PC

 6 VHOSTS

 6.1 VHOSTS Not working on another PC

 7 LAN

 7.1 Cannot access server from another PC

 8 Vista

 9 PHP Scripts

 10 phpMyAdmin (versions 3.3.0 and 3.3.1)

 11 MySQL root password (host 127.0.0.1)

 11.1 Problem

 11.2 Solution

Known issues and problems

This page contains known issues and problems, where applicable offers solutions.

MySQL host name 127.0.0.1 or localhost

The following applies to Windows 7 users.

No registry dust and portable

MySQL 5 supports only IPv4 unfortunately Windows 7 gives priority to IPv6 and returns
an IPv6 address for localhost hence a connection fails.

Uniform Server’s solution is to replace localhost with port address 127.0.0.1 this
forces an IPv4 connection.

 When requested for a MySQL host name use 127.0.0.1

Registry dust and portability sacrificed

I like alternatives and if you wish to use localhost as the MySQL host name perform the
following:

 Run regedit and create a DWORD entry at

80
81
 HKLM\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters called
“DisabledComponents”,
 Set value to 0x20. it sets IPv4 to be preferred over IPv6

Full details of this solution is found on Bob Strand’s website.

See page: hey-dude-wheres-my-localhost

Services not starting

If you receive the following errors cause is probably due to User Account Controls (UAC)

Apache error

Installing the ApacheS1 service


(OS 5)Access is denied. : Failed to open the WinNT service manager
The service name is invalid.
More help is available by typing NET HELPMSG 2185.

MySQL error

The service name is invalid. More help is available by typing NET HELPMSG 2185.

ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) </pre>

There are a couple of simple ways around it.

Solution 1

In my opinion the simplest way of getting UniServer up and working on Windows 7 and
I presume the same will apply for Vista is by doing as follows.

1. Download 'UniServer5_5.exe' to your machine.


2. Run 'UniServer5_5.exe' and choose a location to extract it to.
3. Go to the location you chose to extract Uniform Server to and open the
'UniServer' folder.
4. Right click on 'Start.exe' and select 'Run as administrator'.
5. Right click on the system tray icon (UniTray) and select Install and run all
services.

After a couple of seconds Apache and Mysql should now run as expected.

81
82
Solution 2

If you really want to be lazy and are happy to always grant UniServer 'Run as
administrator' privileges then you could also

1. Right click on Start.exe and choose Properties


2. Click the compatibility tab.
3. Tick the box 'Run this program as administrator'.

Now in future you can just run Start.exe as normal by double clicking it and it will
always automatically be run as an administrator.

Note: You only need to perform the above if you want to install Apache and MySQL as
a service. If you want to just use them as a normal program then there is no issue and
you don't need to run as administrator, you can just choose to run them as standard
programs by left clicking on the system tray icon (UniTray) and selecting 'Start
Uniserver'. (Extract from forum post by Ollie222)

Servers not starting

Q) Apache and or MySQL servers will not start why?

A) If port 80 is being used by another service or server Uniform Server will not start.
Before starting UniServer make sure you do not have another service running on Port
80.

Run Server Status from UniTray: Check ports are free to use.

If they are in use try the following solutions:

port 80 kill process XP Pro

You can kill the processes that use port 80 on XP Pro as follows:

1. Start the Command Prompt and then type netstat -ano | find
"LISTENING" | find ":80"
1. You'll see a bunch of stuff like "TCP x.x.x.x:80 x.x.x.x:0 LISTENING
number", what we're interested in here is number, if there are more
than one (which normally shouldn't happen), repeat the steps below for
each one

82
83
2. Type tasklist /SVC /FI "PID number", replace number with the one
you saw after executing the first command.
1. You'll see 3 lines of stuff, but we're only interested in the last line,
which should be something like program number service, if program is
Skype.exe, you can change the port it listens on; if <service> is not
N/A then proceed to the next step
3. Type net stop service, replace service with the one displayed after
executing the command above (it shouldn't have any spaces).
1. You should see something like "The xxxx service was stopped
successfully", this means that you've got rid of the service (probably IIS)
that was using port 80 (and thus making you unable to access Uniform
Server);

port 80 kill process XP Home

XP home does not support the tasklist command. A better alternative for both xp pro
and home is to use:

procexp.exe from Sysinternals

Microsoft acquired Sysinternals in July, 2006 free download: Process Explorer for
Windows

It is a single file and well worth popping on your memory stick.

Using

The easiest way to use this tool is to obtain a list of what is running on port 80 using:

1. Start the Command Prompt and then type netstat -ano | find
"LISTENING" | find ":80"
1. You'll see a bunch of stuff like "TCP x.x.x.x:80 x.x.x.x:0
LISTENING number", what we're interested in here is number the PID
2. Now run procexp.exe look down the list of PID's and find the ones from
the above step. You now have the process name and possibly a description.
3. Right click on the file name and select Kill Process repeat for all the
above. Now start UniServer you will find it now works.

All you need to do now is decide what you want to do with the offending programs
(they will restart next time you reboot) either delete or change the listening ports.

83
84
Unistall IIS

XP Pro comes with Windows IIS (Windows Internet Information Server) pre-installed,
the following details how to remove it.
Note: XP Home does not have IIS installed hence not a problem.

To uninstall IIS using Add or Remove a Windows Component in Control Panel

1. From the Start menu, click Control Panel.


2. Double-click Add or Remove Programs.
3. Click Add/Remove Windows Components.
4. In the Components list click the Application Server check box.
5. Click Next.
6. Click Close when un-installation of IIS is complete.

Alternative method

To uninstall IIS using the Configure Your Server Wizard

1. From the Start menu, click Manage Your Server.


2. Under Managing Your Server Roles, click Add or remove a role.
3. Read the preliminary steps in the Configure Your Server Wizard and
click Next.
4. Under Server Role, click Application server (IIS, ASP.NET) and then click
Next.
5. In the Role Removal Configuration dialog, check the Remove the
application server role check box.
6. Complete the wizard, and then click Finish.

Disable IIS

If you must have IIS on your machine you have two alternatives as follows:

You can disable IIS by using the Internet Information Services applet in the
Administrative tools area of Control panel.

84
85
1. Select the Default Web Site element
2. Right click it
3. Now click Stop.

Move IIS to another port

If you want to run IIS on another port check out this page IIS back-end server

This solutions allows you to use ASP and other applications best suited to IIS

Move UniServer to another port

Alternatively if you want to run UniServer on another port check out this page Multi-
Servers

Skype

Skype is a little piece of software that lets you make free telephone calls anywhere in
the world to another Skype user. They like Uniserver have their own problems with
firewalls check out this link. Skype may and does use port 80 this conflicts with
Uniserver however it is quite an obliging piece of software in that it can share port 80 or
be moved on.

Shared port

I have not confirmed this works but worth a try:

1. Stop Uniserver
2. Stop Skype
3. Start Uniserver
4. Then start Skype

If this solution works let me know! However the preferred solution is that recommended
by Olajide:

Move it on

Move Skype to another port

1. Skype > Tools > Options > Connections

85
86
2. Change the port to something like 85(incoming). Check that both
Uniserver and Skype are happy or try another port.

PS I trust you have killed off... IIS that's another story.

Server not accessible from Internet

Q) I have tried every thing but my servers are not accessible from the Internet.

A) There can be any number of reasons why your server is not accessible from the
Internet. The path to your server is not direct a typical access follows this sequence

1. A user types into their browser a URL to access a page on your server.
2. The domain part of the URL needs to be converted to an IP address that
points to your server.
3. A browser sends a request to a DNS server to obtain this IP address
4. A browser uses the returned IP address to send a page request to your
server
5. If your server is connected to the Internet via a router the request is
routed to your internal network address on port 80.
6. This may be intercepted by a firewall and rejected if it has not been
configured to allow access.
7. Your server uses file .htacces to check allowed IP access if you have not
configured this file the request will be rejected (default is to allow only local
access).
8. Assuming you have enabled external access in file .htaccess the page is
served.
9. This may be intercepted by a firewall and rejected if it has not been
configured to allow Apache to act as a server.
10. The above assumes your ISP does not block the ports.

External access requires passing all ten steps resolving an access failure requires
pinpointing the cause. Uniform Server contains diagnostics that breaks the above chain
making it easier to isolate the cause.

Server Status

With the servers running run Server Status from UniTray note what is displayed for the
first two entries. One of two results are displayed for each entry as follows:

86
87
 Your Internet IP Address: IP address displayed or Not connected or error
 Accessible from Internet: YES or NO

IP address

Your IP address is obtained from an external page. If you can surf the Internet from a
browser you should see an IP address. Should an IP not be displayed it could be
because the external server is down!

Accessibility

Accessibility test uses the above IP address to access your server it removes the
dependence on a DN server. In addition it reads a page on your server
UniServer\home\access\www\index.html

The folder is not protected by an .htaccess file hence removes any issues associated
with .htaccess files.

Failing this test reduces to one or more of the following causes

 Port forwarding is not enabled in router


 Firewall blocking server
 ISP blocking port

Passing this test indicates you may have not enabled external access in file .htaccess.

A quick test is to enter your IP address into a browser e.g http://999.163.178.100 your
home page should be displayed.

If not check out this page to put your servers on-line.

If server is accessible using your IP address and still cannot be accessed using your
domain name indicates an issue at your DNS provider is the IP setting correct.

HOSTS File

For details see page New Users Quick hosts file

The hosts file is located in the system folder. The path may be different depending on
your setup, these paths are for typical default installations.

c:\windows\~system32\drivers\etc — Windows Vista


c:\winnt\system32\drivers\etc\hosts — Windows NT/2000/XP Pro

87
88
c:\windows\system32\drivers\etc\hosts — Windows XP Home

Should contain the following as a minimum:

127.0.0.1 localhost # loop back address


127.0.0.1 localhost:80 # loop back address

Cannot access server using localhost but 127.0.0.1 works

Q) I cannot access server using localhost however http://127.0.0.1 works

A) Check the hosts file contains these two entries:

 127.0.0.1 localhost
 127.0.0.1 localhost:80

Error message localhost/apanel has no data

Q) I type http://localhost/apanel it fails with error message localhost/apanel has


no data.

A) Try http://127.0.0.1/apanel/ as an alternative. If this works you most likely


have entries in the “hosts” file that are specific to IPv6 look for entries similar to these:

:. localhost
or
:. 127.0.0.1

Comment them out by adding a # (hash) at the beginning of each line for example:

# :. localhost
or
# :. 127.0.0.1

The "hosts" file should contain only these lines for IP 127.0.0.1

 127.0.0.1 localhost
 127.0.0.1 localhost:80

88
89
Localhost does not work on another PC

Trying to run servers on another PC and localhost does not work, see above.

I have moved my servers to a different port and localhost:81 on another PC does not
work.

You require an entry in the hosts file that looks like this:

127.0.0.1 localhost:81 # loop back address

Alternatively use http://127.0.0.1:81 to access the servers.

VHOSTS

VHOSTS Not working on another PC

Q I have several virtual hosts set using Apanel, they do not work on another PC.

A) Add corresponding entries in that PC's hosts file

LAN

Cannot access server from another PC

Q) Other users cannot access my server from their PC's on the same LAN or wireless
network. My server is working fine locally.

A) Check you have enabled external access in .htaccess.

 On the machine running the server


 Run a command prompt and type ipconfig /all
 Look for Host Name e.g fred123 this should be unique for each machine.
 Alternatively look for IP Address e.g 192.168.1.6

On other machines now try the following:

89
90
 Type the following into a browser http://fred123/
 Alternatively type the following into a browser http://192.168.1.6/

Vista

 Problem: Earlier versions of Vista have problems extracting .zip files


 Solution: Download the .exe files these are 7Z self-extracting archives

PHP Scripts

 Problem: Some third party PHP scripts fail to install with development php.ini
 Solution: Before installing third party scripts use UniTray and switch to
production php.ini (Default after extraction).
 For the new php.ini file to be picked up remember to restart server.

phpMyAdmin (versions 3.3.0 and 3.3.1)

 Problem: Missing import TAB


 Solution: Use the Query window

Note: Corrected in phpMyAdmin version 3.3.2 and Uniform Server 5.6.3

Although you can use the Query window (second icon top left) to import files I prefer an
import TAB. If you want to re-establish this tab proceed as follows:

Edit file: UniServer\home\admin\www\phpMyAdmin\libraries\server_links.inc.php

Locate this block:

$tabs['import']['icon'] = 's_sync.png';
$tabs['import']['link'] = 'server_synchronize.php';
$tabs['import']['text'] = $strSynchronize;

Replace with:

$tabs['synchronize']['icon'] = 's_sync.png';
$tabs['synchronize']['link'] = 'server_synchronize.php';
$tabs['synchronize']['text'] = $strSynchronize;

MySQL root password (host 127.0.0.1)


90
91
Versions affected, all Mona and Nano series.

Note: Version 5.6.2-Nano Updated

Problem

When changing MySQL root password “localhost” is correctly updated however host
“127.0.0.1” remains unchanged. This is undesirable and should be rectified straight
away.

Solution

Solution is to download the latest version of Uniform Server. However this may be
inconvenient. Existing installation are easily upgradeable as follows:

A] Edit file: UniServer\home\admin\www\mqsetup.php

Locate this code:

// Create query string (not sure if you need to flush privs)


$query = 'SET PASSWORD FOR \'root\'@\'localhost\' = PASSWORD(\'' . $nwpass .
'\')';
$result = mysql_query($query);

Just below it add the following code:

// Create query string


$query = 'SET PASSWORD FOR \'root\'@\'127.0.0.1\' = PASSWORD(\'' . $nwpass .
'\')';
$result = mysql_query($query);

$query = "FLUSH PRIVILEGES";


$result = mysql_query($query);

B] Start servers

C] From Unitray run restore MySQL password (root name and password both restored
to root)

D] From Apanel set a new MySQL root password or use the one you previously set.

91
92

5.0-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers |
Perl | UniTray | Security and passwords | Known Issues | Support
Contents Uniform Server 5.0-Nano. PHP 5.2.10
Uniform Server 5.1-Nano. PHP 5.3.0
[hide]

 1 MySQL Password

 2 Server Ports

 3 PHP mail function

 4 Core Components

 4.1 Apache

 4.1.1 Run msiexec

 4.1.2 Install

 4.2 PHP

 4.2.1 PHP 5.0-Nano

 4.2.2 PHP 5.1-Nano

92
93
 4.3 PERL

 4.4 MySQL

General support information for Uniform Server 5.0-Nano

This support page provides information for downloading full packages of the core
components. In addition includes small snippets of information that may be of use
these are in no particular order.

Note:

If you are going to download and install full versions of the core components check
introduction page for release details and correct package to download.

MySQL Password

 All passwords including MySQL default to root


 The default MySQL user name is root
 The MySQL server name is localhost
 All name/password pairs are set to root root

Server Ports

After moving the servers run Server Status to obtain the current port numbers.

Assume these are Apache port = 8080, Apache SSL port = 444 and MySQL port = 3310

 To access the index page type http://localhost:8080/


 To access the SSL index page type http://localhost:444/
 The MySQL server name localhost becomes localhost:3310

PHP mail function

If your scripts use PHP’s mail() function the default settings will not work.

There are several ways to resolve this check out PHP mail function page for details.

93
94
Core Components

Although grate care has been taken to include most commonly used modules with the
main distribution of 5.0-Nano. Occasions will arrise when you need a module that's not.
This section provides information for the core components used in 5.0-Nano I would
recommend you download these and save to individual folders for later use thus
allowing you to import any modules you require.

Apache

Visit Apache HTTP Server Project for latest information.

Apache is not distributed in a simple archive format in order to obtain the binaries you
have two options either install the downloaded package and pick-up the binaries or run
msiexec to extract the binaries.

Uniform Server 5.0-Nano uses the following Windows binaries:

Win32 Binary including OpenSSL 0.9.8k (MSI Installer): apache_2.2.13-win32-x86-


openssl-0.9.8k.msi

Download the above file from: Apache download page

Note: A useful link to Apache archive site for Win32 binaries

Run msiexec

First create a batch file named extract_msi.bat in the folder you saved the download
to and add this line:

msiexec /a apache_2.2.13-win32-x86-openssl-0.9.8k.msi

Save the file and double click to run. It appears as if you are installing the program
however it just extracts the files. Save to a folder of your choice, in this folder you will
find the Apache files these are several folders down.

Note: If the above fails use the following method:

Install

If you do not have msiexec install and extract the binaries as follows: The process is
easy, install, copy the installed folder to another location and finally uninstall.

94
95
Install package

1. Download: apache_2.2.13-win32-x86-openssl-0.9.8k.msi save to


any folder.
2. Double click to run the installation program.
3. Tick the I accept box click NEXT
4. Read the read me material click NEXT
5. A form is displayed enter some dummy information as follows:

 Network Domain: fred.com


 Server name: www.fred.com
 Admin email: fred@someone.com
 Click All users radio button
 Click Next

6. Click Typical radio button


Click Next
7. Folder path accept default: c:\Program Files\Apache Software
Foundation\Apache2.2\
Click Next
8. Review changes click Install
9. Wait for Install finish
10. Stop services using icon in system tray (bottom right)
11. Save main folder Apache 2.2 (created in default path 7) to another folder
(Apache2213_ref).
12. Open add remove programs and delete Apache.

Of importance you now have access to all Apache's modules allowing you to select the
ones you need.

PHP

PHP 5.0-Nano

Download site php.net

We are not interested in installing PHP on our PC hence download a zip package:

Windows Binaries section

95
96
 PHP 5.2.10 zip package [10,242Kb] - 18 June 2009

After downloading unzip to any folder, locate folder php-5.2.10-Win32\ext copy any
extensions you require to folder
uniform_server\udrive\usr\local\php\extensions.

PHP 5.1-Nano

Download site php.net

We are not interested in installing PHP on our PC hence download a zip package:

Windows Binaries section

 PHP 5.3.0 zip package [10,115Kb] - VC6 x86 Thread Safe (2009-Jun-30
08:52:55)
 File php-5.3.0-Win32-VC6-x86.zip

After downloading unzip to any folder, locate folder php-5.3.0-Win32\ext copy any
extensions you require to folder uniform_server\usr\local\php\extensions.

Note: Useful link Unsupported Historical Releases (Archive) Top

PERL

Download site Activestate download page.

We are not interested in installing Perl on our PC hence download a zip package

 5-Nano use version ActivePerl-5.10.0.1005-MSWin32-x86-290470.zip 25-


May-2009 08:32 17M
 5-Nano use version ActivePerl-5.10.1.1006-MSWin32-x86-291086.zip 24-
Aug-2009 14:43 18M

 After downloading unzip to any folder, and add libraries as required to folder
uniform_server\usr\lib

Uniform Server plugins are an easier option for details refer to the Perl page

MySQL

96
97
Go to the MySQL downloads page scroll down to Windows downloads section. You
require the file named Without installer (unzip in C:\) to the right of this click on
Pick a mirror

 Save the file mysql-noinstall-5.1.38-win32.zip to any folder of your choice.


(Size: 126M)

 Un-Zip the file into a folder this creates a new folder named: mysql-noinstall-
5.1.38-win32 Inside this folder you will find another folder named mysql-
noinstall-5.1.38-win32 containing the MySQL files.

Although 5.0-Nano is complete you may like to use some of the utilities supplied in the
full download (extracted size 430 MB)

Note: If you require a program to check the MD5 pop over to Portable Apps look in the
utilities section and download winMd5Sum portable checker

97