UniServer USB: Components

Revision as of 17:58, 13 April 2009 by Ric (talk | contribs) (New page: {{Nav UniServer USB}} '''UniServer USB Components''' Should you wish to tailor or modify UniServer USB this page provides pertinent information for all components used. == Apanel == For ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

 

UniServer USB plugin
Uniform Server 4.1-Mona
Uniform Server 5.5-Nano
Uniform Server 5.6-Nano

UniServer USB Components

Should you wish to tailor or modify UniServer USB this page provides pertinent information for all components used.

Apanel

For USB operation some of Apanel's files are replaced with modified versions.

These are associated with moving the server to different ports.

The Vhost file now writes to the PAC file and not a PC's host file.

Top

Auto Run

UniServer USB uses a supper little utility called “Autorun Pro” it is freeware developed by Mark Trescowthick and Ross Mack.

It has stood the test of time and can be downloaded from this web site its under the heading Updated Utility at the end of the page.

A complete version can be found in folder UniServer\udrive\plugins\mona_USB\autorun along with an icon image,

  • autorun.inf
  • AutorunPro.EXE
  • license.txt
  • readme.txt
  • unicenter.ico

Note: Files autorun.inf, AutorunPro.EXE and unicenter.ico are duplicated in folder UniServer\udrive. These automaticaly run the servers when the USB is inserted.

Note: Replace unicenter.ico with your own icon image.

For completeness autorun.inf contains the following code (comments removed) there is no need to change this:

[Autorun]
open=AutoRunPro.exe
action=AutoRunPro.exe
icon=unicenter.ico

[AutorunPro]
Run1="Start_UniTray2.bat"
Run2="usb_server_start.bat"

Note 1: Autorun can be run from either a USB memory stick or CD

Note 2: For testing on a USB memory stick all you need to do is double click on AutoRunPro.exe it will execute all commands in autorun.inf under section [AutorunPro]. No need to reinsert the memory stick hence an ace little utility.

Top

Portable Firefox

Because of its flexibility portable Firefox is an excellent component to use; can be run from a hard drive, USB memory stick or CD. It is regularly updated, should you wish to update UniServer USB make the following changes:

  1. Copy file UniServer\udrive\FirefoxPortable\FirefoxPortable.ini to a safe place
  2. Copy file UniServer\udrive\FirefoxPortable\Data\profile\user.js to a safe place
  3. Replace UniServer\udrive\FirefoxPortable folder with the extracted folder (Download Firefox Portable 3).
  4. Run Firefox portable, double click on file UniServer\udrive\FirefoxPortable\FirefoxPortable.exe when prompted Disable Session Store
  5. Navigate to a few pages this gives Firefox something to save
  6. Exit Firefox.
  7. Copy the file FirefoxPortable.ini back to the new folder UniServer\udrive\FirefoxPortable
  8. Copy the file user.js back to the new folder UniServer\udrive\FirefoxPortable\Data\profile
  9. Rename the file UniServer\udrive\FirefoxPortable\App\Firefox\firefox.exe to firefox_usb.exe (makes it unique and easier to kill)

Note: FirefoxPortable.ini contains the following:

[FirefoxPortable]
FirefoxDirectory=App\firefox
ProfileDirectory=Data\profile
PluginsDirectory=Data\plugins
SettingsDirectory=Data\settings
FirefoxExecutable=firefox_usb.exe
AdditionalParameters=
LocalHomepage=
DisableSplashScreen=false
DisableIntelligentStart=false
AllowMultipleInstances=true
SkipChromeFix=true
SkipCompregFix=true
WaitForFirefox=false
RunLocally=false

Top

Branding

Change branding (prevents first time run page opening)

Folder: UniServer\udrive\FirefoxPortable\App\Firefox\defaults\pref
File: firefox-branding.js

Disable this line as shown

//pref("startup.homepage_welcome_url","http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/%VERSION%/firstrun/");

Top

PAC

Vista imposes restrictions on updating the “hosts” file, to resolve this issue UniServer USB uses a PAC file. This also makes the server independent of any "hosts" file making it totally portable.

A PAC file allows a browser to resolve web-addresses without recourse to either a "hosts" file or DNS server. The file contains a list of address resolving them to localhost (127.0.0.1:80).

The file named my_hosts.pac is located in folder: UniServer\pac

Edit this file as required, it should contain any virtual hosts you are using (see note 2).

A default installation has two entries, the first localhost* is required.

The second is specific to Apanel.

function FindProxyForURL (url, host){
if (shExpMatch(url,"http://localhost*")) return "PROXY 127.0.0.1:80";
if (shExpMatch(url,"http://localhost:80*")) return "PROXY 127.0.0.1:80";
return "";
}

Note 1: If you use the server-move script it automatically updates the PAC file.

Note 2: If you add Vhosts using Apanel again the PAC file is automatically updated.

Note 3: A a browser resolves Internet addresses in the following order, looks in PAC file, then hosts file and finally makes a request to a DNS server. When an address has been resolved the sequence terminates.

Top

Firefox PAC

The following is background information only, no need to edit anything in this section.

Firefox can locate a PAC file using either of two methods:

  • Using a Web-address (PAC file located on a local or remote server)
  • Usin an absolute file address (PAC file located on local machines drive)

UniServer CD uses the web address method while UniServer USB uses the absolute file path method.

Location of the PAC file is defined in user.js

user_pref("network.proxy.type", 2);
user_pref("network.proxy.autoconfig_url", "");

The last line informs Firefox to look in a local folder for the PAC file.

A disadvantage of using this method a relative path to the file cannot be used the path needs to be programmatically implemented and an absolute path provided. The path would look similar to this:

user_pref("network.proxy.autoconfig_url","file:///J:uni_test/UniServer/udrive/pac/my_hosts.pac");

Advantage of this method, the file can be located anywhere (UniServer\udrive\pac) when the servers are started a small Perl script (UniServer\udrive\pac\set_pac_path.pl) updates user.js. The script checks the path and updates it every time the servers are run hence servers are fully portable.

Top