5.0-Nano: UniTray: Difference between revisions
m (→UniTray Help) |
|||
Line 51: | Line 51: | ||
To access this file either | To access this file either | ||
* | *Double click on file UniServer\'''help.bat''' | ||
Or | Or | ||
*From UniTray Left click '''tray icon > click Server Documentation''' | *From UniTray Left click '''tray icon > click Server Documentation''' |
Revision as of 20:30, 5 September 2009
5-Nano: Introduction | Install and Run | Control | DtDNS | Cron| Security features | Enable SSL | Multi-Servers | Perl | UniTray | Security and passwords | Known Issues | Support
|
|
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.
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 Run servers as a standard program |
COMMENT Quick Start guide |
RIGHT MENU Run servers as a service |
Run Servers as standard Program
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
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 (not 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
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()
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 |
USRoot; Value: "%top%"; | Dynamic variable passed UniTray start (top) Type: commandline; Name: top; ParamName: "ustop" |
Summary
UniTray is very versatile and easy to use don’t worry about any of the techno babble just use it.