## MicroWeb User Manual

Mar 17 2004

### CONTENTS

About This Program
Installation
System Requirements
Using MicroWeb
Release History
Contacting the Author
License Agreement

### About This Program

MicroWeb allows you to create a working web site on a CD-ROM. Using a web browser, a user can run cgi programs as well as view html files on the CD-ROM.

To view the website the end user only has to run the microweb.exe program on the CD-ROM, there is nothing to configure. This will automatically start a web browser for viewing the website.

MicroWeb provides support for MySQL, it will automatically start a MySQL server if one is included on the CD.

There is no royalty on each CD containing the runtime distributed and there is no limit on the number of CDs that can be distributed. A license is required only for your development machine.

Requires any 32-bit version of Windows, including 95/98/ME/NT/2000/XP.

### Installation

Unzip the installation file to any directory, for example c:\microweb. This will create a working website. To view the website run the program microweb.exe. This will start the MicroWeb server and start a web browser for viewing the web site.

### System Requirements

Any 32-bit version of Windows, including 95/98/ME/NT/2000/XP.

### Using MicroWeb

The sample website

The installation zip file for MicroWeb contains a sample website. To view the sample website run the microweb.exe program. This will automatically start a web browser for viewing the website. The site contains sample html pages, forms and some sample CGI scripts.

How to create a website for shipping on CD-ROM.
Copy the sample website, and add your own html and CGI files. Modify the microweb.ini file if necessary. The sample website contains an autorun.inf which will automatically start the website when the CD is inserted into a drive.

If MicroWeb will be run on a Win95 system which does not have IE installed, then copy mfc42.dll from your system directory to the microweb directory.

You must also run MicroWeb on your own PC (i.e. the PC where MicroWeb program is registered) anytime that the default html page for your website is modified. This allows MicroWeb to add or modify an entry in the microweb.ini file. Without this entry, running the website on a non-registered PC will display a message saying "This is an evaluation version..."

### Command line option

Normally MicroWeb is started with no command line option, however most options that can appear in the microweb.ini file can also specified on the command line. Additionally the special command shown below can be used to shutdown the currently running copy of microweb:

microweb -shutdown

### The microweb.ini file

The microweb.ini file is used to configure various options for MicroWeb. These are described in detail below.

* Server root directory and document root directory
When MicroWeb is started the current directory becomes the server root for the web site. MicroWeb will look for a microweb.ini file in the sever root directory. The document root directory is set by the following option:

>     DocumentRoot=htdocs

* Specifying the host name of your web site.
Specify the host name of your website with the following entry in the ini file:

>     hostName=whatever

The default value is microweb. You can use any name, for example www.myserver.com, or even www.microsoft.com. Be aware, however, that if you use the name of a real host, you will no longer be able to access the real host until you shut down MicroWeb by closing the web browser and rebooting the PC. This is because the web browser caches the IP address of the host until the PC is rebooted, or a long idle time has elapsed.

Using the name of a real host is also not recommended on PC's using a proxy server, as proxy service for the selected server will be disabled. This limitation will be removed in a later release. If the real site that you are emulating is called foo.com we suggest that you use the name foocd.com.

A special value of hostname=default will cause MicroWeb to use the host name of the machine where MicroWeb is running.

* Specifying the port number for your web site.

Normally Microweb will automatically assign a free port number. You can choose a specific port number with an entry like the following example in the ini file:

>     port=5001

* Choosing a browser.

When MicroWeb is started the default web browser is also started. You can select a different browser with one of the following entries in the microweb.ini file:

>     browser=ie
>     browser=netscape
>     browser=none

You can also select a browser with one of the following command line options:

>     -browser=ie
>     -browser=netscape
>     -browser=none

If no web server is selected, the only way to shut down MicroWeb is to press ctrl-alt-del and click on 'End Task' from the Task Manager menu. You will get a warning that the program is not responding, this warning can be ignored.

You can also explicitly specify the browser to use by adding the following line to the ini file:

>     browserpath=<path_to_browser>

The path can be absolute or relative to the server's root directory.

To start the browser in kiosk mode, use this entry:

>     browseroptions=-k

* Default file.
The default file is displayed when the request URL contains a directory path, but no specific file. MicroWeb will look for default.pl, default.exe, default.html, default.htm, index.html, index.htm, and send the result to the web browser. If none of the above are found, then it will display a listing of the files in the directory.

To override the default file list, use an entry like this:

>     defaultfile=default.pl,index.html,default.php,default.r

* Using Perl CGI scripts.
Perl cgi scripts must use the file extensions .pl or .cgi. They can be placed in any directory. The sample site is shipped with Perl interpreter which includes the CGI.pm module. If you need additional library modules, you can add them to the Perl directory. If you wish, you can replace the Perl directory with a complete binary distribution of the Perl interpreter. The full MicroWeb download contains a full release of Perl, including DBI and DBD::mysql.

If you want to use Perl scripts but want to avoid shipping your source code to your customers, you can use Perl2Exe to convert the scripts to an executable files.

Please note that the document_root environment variable may or may not end with /. For example it may be d:/ on cd-rom, but on local disk it may be c:/microweb.

* Using PHP cgi scripts.

The full MicroWeb download is pre-configured to support PHP scripts. If you need to use any PHP loadable module uncomment the appropriate line in the php.ini file. Files with a .php extension will be served as PHP scripts. To serve all .html pages as PHP use the following entry:

>     [ScriptMap]
>     .html=php\php.exe

* Using Encoded PHP scripts using the Zend Optimizer.
To enable support for encoded or encrypted PHP scripts uncomment the following line in the php.ini file by removing the leading semicolon:

>     ;zend_extension_ts="..\zend\lib\ZendExtensionManager.dll"
>     ;zend_extension_manager.optimizer_ts="..\zend\lib\Optimizer-2.1.0"

If you need to use encoded scripts in a subdirectory copy the php.ini file to the subdirectory and make the following change

>     zend_extension_ts="..\..\zend\lib\ZendExtensionManager.dll"
>     zend_extension_manager.optimizer_ts="..\..\zend\lib\Optimizer-2.1.0"

* Using another CGI scripting language.
The example below is for the rebol language, modify the instructions as appropriate for another language:
1) Make a rebol subdirectory below the root directory
2) Copy the rebol.exe interpreter and other dll files into the rebol directory.
3) Add the following entry to the microweb.ini file:

>     [ScriptMap]
>     .r=rebol\rebol.exe

* Using a MySQL database.
The full MicroWeb download is preconfigured to support MySQL. You will need to replace the data directory with your own data. The sample website contains a sample test script called cgi-bin/mysqlsamp.pl .

MicroWeb will automatically copy the copy the contents of the mysql\data directory to a working directory on the local disk the first time that it is used. The files are copied from x:\mysql\data to tempdir\microweb\hostname\mysql\data. This is done to provide a writeable database - assuming that the original files are on a read-only CD. If your website is not on a CD, or if you only need a read-only database, this copy can be disabled with the following entry in the [OPTIONS] section:

>     CopyMysqlFiles=0

The working copy is only made the first time that MicroWeb is used. If a copy were every time that MicroWeb was started the users data would be overwritten. To cause MicroWeb to update the working database when a new CD is shipped with a new database, use an entry like the following in the [OPTIONS] section:

>     DatabaseVersion=0001

The value is any string that is a valid directory name. The string will be appended to the path of the working database.

MicroWeb will automatically start and stop the mysql database server. To start and stop the server it uses the following default command:
"$server_root\mysql\bin\mysqld" --skip-innodb --standalone --basedir="$unix_server_root/mysql" --datadir="$mysql_data_dir"
"$server_root\mysql\bin\mysqladmin" --user=root shutdown

The following special strings are replaced with corresponding run-time values:
$server_root Path to the microweb server root directory
$unix_server_root Path to the microweb server root directory using forward slashes
$mysql_data_dir Path to working the mysql data directory

If the target machine has a running mysql database server you will need to use an alternative port. To change the mysql server port number use the following example microweb.ini entries in the [OPTIONS] section:

>     OnStart=%%$server_root\mysql\bin\mysqld%% --skip-innodb --standalone --basedir=%%$unix_server_root/mysql%% --datadir=%%$mysql_data_dir%% --port=3000
>     OnExit=%%$server_root\mysql\bin\mysqladmin%% --user=root --port=3000 shutdown

Note that in the ini file you must use two percent symbols instead of a double quote mark.

* Using an SQLite database with PHP.

MicroWeb contains support for using an SQLite database from PHP. SQLite is a simple file based database engine that does not require a database server.

If you going to use SQLite remove or rename the mysql directory, this will avoid staring the mysql database server, which you do not need.

The sample script makesqlitedb.php contains an example of how you you would create a simple database. This is how you could create your database on your development machine.

The sample script usesqlitedb.php contains an example of how you you would use a simple database on your distributed CD-ROM. The script first copies the database from the CD-ROM to a working directory on the local hard disk. If you only need a read-only database, you can skip this copy step. The data is copied only once, so that if the user runs the application again any modification to the database will be preserved.

* Enabling file downloading of executable files.
Normally executable files and CGI scripts in any directory executed and the results are displayed to a browser. You can enable downloading of these files from some directories by using the cgiroot entry in the ini file. For example the following entry will tell MicroWeb that only files in the cgi-bin directory or below are to be executed:

>     cgiroot=/cgi-bin

* Accessing local directories.
To access a a file on the local machine, for example c:\windows\temp\foo.html , use a url like /c:/windows/temp/foo.html

* Using a temporary directory
A writeable directory for temporary files can be found from the expression:
$tempDir = $ENV{'TEMP'} || $ENV{'TMP} || $ENV{'WINDIR'};

* Debugging CGI scripts
MicroWeb supports two cgi debugging flags, they can be placed in the url as:
.../debug_cgi/... or .../show_cgi/...
For example to debug /cgi-bin/testcgi.exe use a url of /cgi-bin/debug_cgi/testcgi.exe

debug_cgi will display raw output to the browser, including all headers printed by the cgi.
show_cgi will display the cgi output in a new console window, no data will be sent to the browser.

The flags can also be placed on the command line as -show_cgi or -debug_cgi.

* Server Side Includes
MicroWeb supports the exec cgi, exec cmd, include virtual, and include file, server side directives. Examples:
<!--#exec cgi="/cgi/bin/mycgi.pl"-->
<!--#exec cmd="cgi-bin/mycgi.pl-->
<!--#include virtual="filename.txt"-->
<!--#include file="filename.txt"-->

A sample file ssisamp.shtml is included in the distribution. Recursive includes are not supported.

By default SSI is enabled for all files with an extension of .shtml. To enable SSI processing for all html files add the following entries to the microweb.ini file.

>     [ScriptMap]
>     .html=ssi.exe
>     .htm=ssi.exe

* Disabling the IE5 Work Offline dialog box.
This dialog box can be displayed by IE5 on a PC with a dial up connection. MicroWeb automatically disables this dialog box for the English, Dutch, German French and Italian language versions of IE5. For other languages you will need to specify the caption test of this dialog box with an entry like the following:

>     WorkOfflineTitle=Off line werken

* Adding New Mime Types.
MicroWeb is preconfigured with most common mime-types. You can add additional ones by adding an entry like the one below to the microweb.ini file.

>     [mime-types]
>     .cic=image/x-cic

* Allow listing of directories

The following entry determine whether directory contents can be listed.

>     AllowListing=1

* Allow Remote Access

By default the website can only be viewed on the PC where it is running. Use the following entry to allow viewing from other computers.

>     allowRemoteAccess=1

### Release History

V1.27 Mar 17 2004
Added -shutdown command line option
Added support for Mozilla and Firefox browsers

V1.26 Feb 28 2004
Fixed: PHP session files are left in c:\sess_*
Fixed: Uploading large files is very slow {100-1006}
ixed: PHP pages display very slowly if they use large cookies > 5MB
Fixed: Copying mysql files to temp directory sometimes fails

V1.25 Nov 22 2003
Fixed: WebID in microweb.ini file not updated correctly.
V1.24 Oct 26 2003
Fixed: Post to PHP fails if data is greater than 2021 bytes.
PHP version updated to 4.3.3
Added PHP support for SQLite
MySQL version updated to 4.0.16
Added a DocumentRoot option
PHP will look for php.ini file in current directory then in server root
Fixed: Large POST to hellocgi.pl fails
Fixed: A failing CGI produces a page not found error instead of a bad header error
Fixed: Mysqld is not shutdown on Windows 98

V1.23 b May 13 2003

Fixed: Mysql sample script not working because test database is missing from mysql data directory

V1.23 Mar 23 2003
Added support for handling proxy override with Netscape 6 and 7
Fixed proxy override problem for IE on Win98
Sample gs_samp.php loads gd extension dynamically
Support for PHP encoded files made optional

V1.22 Mar 11 2003
Fixed: Hangs if a PHP page tries to reads another PHP page
Added support for PHP encoded files using the Zend Optimizer
Added support for handing proxy override for Netscape 6 and 7
Fixed handling of PHP header("Location:..) function
More reliable handling of aborted connections.

V1.21 Feb 27 2003
Fixed: Hangs if a PHP page tries to reads another PHP page
Working database will be updated if a new CD contains a new database.
Fixed: The wrong mysql server is stopped if there are multiple mysql servers
The optimized mysql server is now used instead of the debug one.

V1.20 Jan 3 2003
Fixed: Hangs if a large amount of form data is posted
Php.ini is no longer required to be in each subdirectory
Fixed: PHP global form variables are not set by default
- Changed register_globals to On in the php.ini file
- default was changes to off after version 4.2.0

V1.19 Nov 17 2002

Do not accept connection from remote host
- added ini option allowRemoteAccess , default = 0
Added log messages to show if MySQL stared OK.
Fixed: MySQL does not start on Win98
Change session.save_path = /tmp to c:/ in php.ini - affects saving cookies
Fails if using Netscape 6 as default browser - fixed code
Fixed: Option -browser=netscape does not work with Netscape 6.2
- works OK if Netscape 6.2 is the default browser
Fixed: if cgiroot is set to /cgi-bin then php files in root directory will not work.
Added a mime type for dll files.
Added ability to start and terminate user defined process using OnStart1..9 and OnExit1..9
If HOSTS file update fails use 127.0.0.1 as hostname
Cantrepro: Query strings not passed to HTML pages
Cantrepro: Parameters are not passed to PHP scripts
Fixed: Does not gracefully handle error when script interpreter is missing
Fixed: Mysql does not start up if microweb is installed in a path with a space.
Added German work-offline string
hostname = foo not added to HOSTS file if it already contains foo1, foo2, foo_anything
If hostname = foo, then it will also delete foo1, foo2, foo_anything from the hosts file

V1.18 Oct 3 2002

Provide a full download with PHP, MySQL and Perl

V1.17 Mar 31 2002

Added support for MySQL
Fixed: PATH_INFO contains '\' character, it should be '/'
Fixed: Location: header does not work with PHP4
Fixed: If hosts file is read only, silently use default hostname Fixed:
Fixed: Error Message: ERROR: cannot write to hosts file
Display a message if webid is updated in microweb.ini
Fix for PHP4 V4.1.2
Added Italian and French 'Work Offline' dialog detection

V1.16 Oct 8 2001
Fixed: Data posted from a form to a CGI would sometimes display a blank page.
Fixed: An aborted browser connection requesting a CGI would sometimes produce a GPF
Added mime types .pdf=application/pdf & .exe=application/octet-stream
Fixed: Env var PATH_INFO is not set (extra path after a real cgi or file)
Ini file setting in current directory will override setting from program directory
- previously it was only read from current directory
Undo fix for AOL, use the default browser
Allow alias for cgi-bin
Changed color of the 16x16 icon to light blue, so it shows better on the start menu's gray background instead of the gray.
WorkOfflineTitle option now accepts a list of semicolon separated titles. default =Off line werken and Work Offline is built-in
Fixed: Does not support streaming audio/video
positioning the scroll bar to the middle causes the audio to be streamed from the start.
URL of the form foo.htm?foo=bar now works

V1.15 Aug 3, 2000

PHP4 support added
Explicit port number may be specified in the ini file
Some fixes to handling of .shtml files

V1.14 Mar 16, 2000
Sets environment variable SystemRoot - required for perl's gethostbyname - fixed
Work Offline dialog code handle multiple languages, including English and Dutch
Work Offline dialog support under Windows 2000
Add crlf to hosts file if needed - fixes the Unknown host message
CGI is enabled in all directories by default instead of cgi-bin
New option cgiroot added
PHP3 support
Support for any script language processor
Script map option added
SSI can be enabled for html files
New option defaultfile added
Microweb can now be installed in directory paths containing spaces
Default browser lookup method changed to fix a problem with some AOL users
Mime types now include ".dwf", new ones can be added to the ini file with [mime-types] .ext=type

V1.13 Dec 29, 1999
Fixed: Shipped perl.exe had a 2 second delay on exit
Fixed: Relative urls in hostname/directory/index.html sometimes did not work correctly
- hostname/directory is now redirected to hostname/directory/
Sets environment variable SystemRoot - required for perl's gethostbyname

V1.12 Dec 05, 1999
Fix to close the "Work Offline" dialog in IE5
Added sample files ssisamp.shtml and cgi-bin/ssicgi.pl
If hostname in ini file is "default", then don't modify hosts file on exit
Make hosts file writeable
Upgraded to perl 5.005_03
Add cgi.pm to perl distribution
Added samples hellocgi.pl and cgisamp.pl
Licencing info clarified that that there is no royalty on each CD.
SSI allows optional whitespace around the "="
Fix to testcgi.pl to remove warning message, updated to print environment variables.

V1.11 May 22, 1999
Additional fix for browser hanging when displaying pages in two or more frames.

V1.10 April 29, 1999
Added support for browser and browseroptions sections to the ini file.
Fixed a case where browser would hang when displaying pages in two or more frames.

V1.9
Perl build 506+ support.
SSI support
Documentation updates: SSI, Debugging CGI, mfc42.dll, Virtual Directories.
Fix: perl5lib environment variable correctly set if using a user supplied perl directory.

V1.8 Nov 8,1998
Perl5lib environment variable is now correctly set to the perl library

V1.7 Sep 20,1998
Support for browsers using a Proxy Server - fixed for Netscape browsers

V1.6 July 20, 1998
Documentation: expanded requirements to include TCP/IP
Expand "No free port" message to say "TCP/IP not installed?"
Scripts will not run if using IE4 with a dial-up connection, and connection is not made.

V1.5 May 21,1998
Script containing print "Location: .." now works

V1.4 April 27,1998
Support for browsers using a Proxy Server
Allow downloading of exe files - exe, cgi and pl files can now be downloaded, as long as they are not placed in the /ci-bin or /scripts directories
Allow choosing of a web browser
Fixed problem if Netscape is running before MicroWeb started

V1.3 April 17,1998
Bug Fix: Hosts file not correctly updated for NT

V1.2 April 08,1998
Change to the method of registering MicroWeb

V1.1 April 03,1998
Bug Fix: Browser displayes empty page if hosts file not found in Windows directory.

V1.0 Mar 22,1998
Initial release

### Contacting the Author

We'd like to hear your questions and comments!:

Contact Information: http://www.indigostar.com/contact.htm
WWW: http://www.indigostar.com

### Ordering Information

For ordering information please visit our Web site.

### MicroWeb License Agreement

You should carefully read the following terms and conditions before using this software. Unless you have a different license agreement signed by IndigoSTAR Software, your use of this software indicates your acceptance of this license agreement and warranty.

REGISTERED VERSION LICENSE

Each registered copy of MicroWeb may be used at a single workstation to create an unlimited number of websites for distribution, subject to the following conditions:

* Websites generated by the registered version of MicroWeb may be freely distributed on CD-ROM or any other media. There is no royalty on each CD containing the runtime distributed and that there is no limit on the number of CDs that can be distributed.

* A separate registered copy of MicroWeb must be obtained for each workstation on which MicroWeb will be used even if such use is only temporary. This is not a "concurrent use" license.

* Websites created by MicroWeb are shipped with run-time portions of MicroWeb. Only a registered MicroWeb user may alter or modify the created website. You cannot give anyone else permission to modify the website.

All rights not expressly granted in this license agreement are reserved entirely to IndigoSTAR Software

Governing Law

This agreement shall be governed by the laws of the Province of Ontario, Canada.

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. Because of the various hardware and software environments into which MicroWeb may be put, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program. ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.

SHAREWARE VERSION LICENSE

This is not free software. You are hereby licensed to use the shareware evaluation version of MicroWeb for evaluation purposes without charge for a period of 30 days. If you use this software after the 30 day evaluation period a registration fee is required. Under no circumstances are you licensed to distribute websites created by the shareware evaluation version of MicroWeb. Unregistered use of MicroWeb after the 30 day
evaluation period is in violation of copyright laws.

Distribution of MicroWeb

You are hereby licensed to make as many copies of the shareware evaluation version of this software and documentation as you wish; give exact copies of the original shareware version to anyone; and distribute the shareware version of the software and documentation
in its unmodified form via electronic means. There is no charge for any of the above.

You are specifically prohibited from charging, or requesting donations, for any such copies, however made; and from distributing the software and/or documentation with other products (commercial or otherwise) without prior written permission, with one exception: Disk Vendors approved by the Association of Shareware Professionals are permitted to redistribute MicroWeb subject to the conditions in this license, without specific written permission.