DOCUMENTATION FOR web/2 (copied from Wayback machine, converted to text by Peter Moylan) Why Web/2 --------- When we talk about a web server on an OS/2 system, most people automatically think about Apache/2 or Lotus Domino Go Webserver. Lotus Domino Go Webserver is a beautiful web server that comes with Warp Server for e-Business, is native OS/2, but as far as I know is sadly enough discontinued by IBM. Apache/2 is a port of the Linux version to OS/2. This port is done with the aid of the EMX libraries. There is a native Apache/2 v2.0 being developed at this very moment which doesn't need the EMX libraries anymore. Apache 1.3.19 had some security problems, it could be crashed fairly easy from the outside. So I looked for something else and found Web/2, native OS/2, written in Pascal and compiled by Virtual Pascal, probably the best code generating Pascal compiler for OS/2. Web/2 is freeware and incredible small (the size of the executable I use is only 42k). How to Install/Upgrade ---------------------- Installation is very easy. Download the latest web/2 package from http://dink.org/web2/ the latest beta : web2beta5.zip Don't be discouraged by the use of the term "beta", Dink has higher release standards than most authors, the term "beta" here only refers to the fact that Web/2 is an ongoing project. the current version of Web/2 is being used in an environment which hosts over 30 corporate websites, and hasn't had a single problem so far. Create a directory where you want to install Web/2 in, e.g. F:\Web2 Now unzip the package you wish to install into this directory and run "web2icons.cmd" to create the Web/2 folder & icons on your desktop. You see the following files and directories (graphics missing) You can also unzip the file sample.zip It contains the default Web/2 page, a webserver statistics page, and some cgi-examples. To upgrade from a previous version, simply unzip the Web/2 package over the old version and run setup.exe to update your config file. How to configure web/2 ---------------------- web.cfg ------- First of all start setup.exe This creates some addtional information files like alias.cfg, mime.cfg, cgi.cfg and allows you to specify some general settings. (graphic missing -- picture of setup.exe screen) Web Port This is the TCP/IP port the Web/2 server will be listening at. You don't need to change the 80 as this is the standard port for the http protocol. Logging If this is on Web/2 will create a log file 'web.log' that contains a listing of every web server access. This log can e.g. be used to check who has accessed your server and what they've been looking at. Logfile Style With this setting you can specify the format of the log file. You have two options : web/2 this activates the web/2 log format which gives you very detailed information ncsa/apache this enables the same format as used by ncsa and apache httpd servers. This allows you to analyze the log with standard analyzers like e.g. http-analyze, analog, ... If you want to switch between these formats e.g. from web/2 to ncsa/apache because you want to use a log analyzer you have to start a new log. You can do this by renaming the old log. Resolve ip's this enables host name lookup. This means that the IP-address of every computer that accesses the web server will be looked up through the name server. So instead of 193.190.57.4 you will see voyager This option comes in very handy when you want to have the log analyzers generate an overview of the domains your visitors come from. If you don't need this you can turn this option off to avoid the overhead of consulting the name server with every web server access. send() Blocksize For advanced users: amount of data to send to the TCP/IP stack at once, a number above 32767 will cause problems with TCP/IP 4.0 or lower File-list if no index.html With this option you allow/disallow the web server to send a list of the files in the requested directory in case there is no index.html present in this directory. For security reasons it might be a good idea to disable this option. Main HTML directory The name of this option speaks for itself. This doesn't necessarily need to be the directory where the HTML pages of your web site are located. CGI-BIN directory The name of this option speaks for itself. This is the directory where your cgi script must reside in order to get executed. Virtual CGI-BIN directory The virtual directory (ie: on your browser's urlbar) for accessing cgi scripts File-list icons directory This is the directory where the icons reside that are used for the representation of the file list of the requested directory which is showed by the server if you have enabled the option File-list if no index.html and no file index.html is present in the requested directory. Connection Time in window By enabling this option you can see the connection time when a user has accessed your web server. Main log [path]:filename Use this to specify an alternate path & filename for the main (non virtualhost) logfile Priority Boost Enable this to get better performance on high-traffic websites. Bandwidth Limit Use this to limit each connection's send rate. When you exit setup.exe all settings are written in the configuration file web.cfg If Web/2 is running while you are changing these general settings you have to restart it to activate the new settings. Advanced web.cfg options To modify these following options, you must manually edit the web.cfg file banned Use this to add banned hosts, banned host exceptions and banned referers. usage: in web.cfg, locate the 'banned' entry and add hostnames/partial hostnames (separated by comma), to do a banned host exception, prefix it with "E:", example: banned microsoft.com,E:os2.microsoft.com this will permit os2.microsoft.com to connect to the server, but everything else on microsoft.com is denied. to ban referers, use the "R:" prefix. Another possible use is to allow only certain hosts/IP's to access your webserver, to do this, add a banned entry of "." and add an exception for the hosts or IP's that are allowed to access your server. example: banned .,E:dink.org,E:192.168.0.5 Note: you can only specify hosts if you have set Web/2 to resolve IP's, or only specify IP's if they don't resolve -or- the server is set to not resolve IP's. dontlist Use this to filter certain file/file extensions from a file listing. example: dontlist .mp3,.iso,.rar this example will allow the listing of all files, except for *.mp3, *.iso and *.rar ignorenimda If this is set to on, Web/2 will ignore the nimda worm (and several others) to prevent the log file from filling with junk Example of the native Web/2 format Connection From: voyager @ Jul 9, 2001 3:04pm Browser: Mozilla/4.61 [en] (OS/2; U) Sending: index.htm Connection From: voyager @ Jul 9, 2001 3:04pm Browser: Mozilla/4.61 [en] (OS/2; U) Referer: http://193.190.57.1/ Sending: powerd.gif Connection From: 192.168.1.62 @ Jul 9, 2001 3:04pm Browser: Mozilla/4.61 [en] (OS/2; U) Sending: index.htm Example of the NCSA/Apache compatible format voyager - - [09/Jul/2001:15:13:21 +0000] "GET / HTTP/1.0" 200 454 "" "Mozilla/4.61 [en] (OS/2; U)" voyager - - [09/Jul/2001:15:13:21 +0000] "GET /powerd.gif HTTP/1.0" 200 2215 "http://193.190.57.1/" "Mozilla/4.61 [en] (OS/2; U)" Example of a File listing The icons that are used in this representation are the ones found in the directory specified with the option File-list icons directory. You can create your own icons to customize the looks according to your own wishes. Connection time in window In the image below you can see the window of Web/2 where the date and time are given of the last web server access. alias.cfg --------- Web/2 allows you to create aliases and virtual domains with separate log files. Contents of a alias.cfg ; ; aliases and virtual domain setup ; files REAL name alias [log:filename for virtual host] ; [cgidir:cgi-bin directory for virtual host] ; [vcgidir:virtual cgi-bin directory for virtual host] ; [protecteddir:password protect a virtual host with] ; [ ".protected" located in this directory] ; index.htm index.html e:\WebSite\dink.org virtual:dink.org log:dink.log cgidir:e:\WebSite\dink.org_cgi-bin d:\users\jimmy\Kwaliteitssysteem virtual:Kwaliteit log:kwaliteit.log e:\testdrive\html\stat.html stat.htm c:\os2\utils /os2utils/ index.htm index.html Every time somene tries to access index.html Web/2 will redirect this to the file index.htm. So if you have two different files index.html and index.htm only index.htm gets opened. If you don't want this behavior and want both index.html and index.htm to be able to get opened you have to delete this entry. e:\Website\dink.org virtual:dink.org log:dink.log cgidir:e:\WebSite\dink.org_cgi-bin With this line a virtual host dink.org is created. When someone visits http://dink.org the file index.htm that's present in the directory e:\WebSite\dink.org will get opened. Every access to this site is logged in a file dink.log that will be created in the directory Web/2 is installed in. The cgi-bin directory for each virtual host is configurable by using the cgidir: token The virtual cgi-bin directory can also be set here with the vcgibin: token You can assign multiple hosts to the same IP-address. This way you can have multiple web sites on the same IP-address. Be aware of the fact that all the names you use (dink.org, ...), must be registered at a name server. Otherwise they can't be accessed. e:\testdrive\html\stat.html stat.htm c:\os2\utils /os2utils/ Web/2 offers you the possibility to create aliases for html files and directories. Suppose the IP-address of the OS/2 PC Web/2 is running on is 193.190.57.4 When a visitor accesses the following URL http://193.190.57.4/stat.htm you expect that the web server sends the file stat.htm that's located in the main HTML directory. Instead the server will send the file e:\testdrive\html\stat.html When a visitor accesses the following URL http://193.190.57.4/os2utils you expect that the web server sends the file index.htm (if it is present) that's located in the directory /os2utils/ that can be found in the main HTML directory or in case there is no index.htm the file listing of that directory is shown. Instead the server will redirect /os2utils/ to c:\os2utils In case you were wondering why I'm using IP-addresses here (193.190.57.4) instead of a name like dink.org. If I use the name the virtual host algorithm will take over and the alias will not work. Instead everything will be redirected to the root directory specified for the virtual host. mime.cfg -------- One of the configuration files that's generated after running setup.exe is mime.cfg This file holds all the mime types and extensions that are known to Web/2. This is normally used by the Web/2 server to make it possible for the web browsers (Netscape, ...) to recognize the correct file type. When you don't do anything extraordinary it isn't necessary to edit this file. cgi.cfg ------- One of the configuration files that's also generated after running setup.exe is cgi.cfg This file holds all the extensions of the executables, REXX files, perl scripts, ... that are allowed to run as a cgi file. When creating cgi files for use with Web/2 keep in mind that The cgi-bin, icons and virtual include dirs under virtual hosts are the same as a non-virtual host The "startup" directory of cgis is the same dir as web.exe. Nearly all of the cgis tested work flawlessly, but some require small modification. For example, wcount. Simply place count.exe into the cgi-bin directory and move the 'wcount' directory into Web/2's main directory. Contents of the standard cgi.cfg ; web/2 cgi configuration file ; ! before the exe name to let the script execute from the html directories ; ! won't work for internal.. (besides, its a bad idea) internal .exe .cmd .cgi !php.exe .php .phtml .php3 .php4 perl.exe .pl .perl ; Some very nice SSI tags ----------------------- SSI stands for Server Side Includes. These are tags that are interpreted by the web server itself before sending it to the browser of the visitor of your site. the defined send() blocksize that Web/2 uses the type of browser the visitor of your web site is using to access this page the number of connections that have been established by Web/2 since it has been started up the server hostname the current date the hostname of the machine that gives the visitor access to your site. If your visitor is behind a proxy server, then this is the hostname of the proxy server. the IP address of the machine that gives the visitor access to your site. If your visitor is behind a proxy server, then this is the IP address of the proxy server. this identifies where the link to this page is coming from. This is also logged in the ncsa/apache style log file whether you use this tag or not. this gives the uptime of the PC Web/2 is running on this is a counter that gives the number of times a specified page is hit. This is used in conjunction with a file counter.dat this is the local time on the PC Web/2 is running on in 24h format