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 also 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 easily from outside.
So I was looking 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 incredibly small (the size of the executable is only 42K.)
You can also unzip the file sample.zip It contains some cgi-examples.
First of all start setup.exe. This creates some additional configuration files like alias.cfg, mime.cfg, and cgi.cfg and allows you to specify some general settings.
Web Port
This is the TCP/IP port the Web/2 server will be listening to. You don't need to change this as 80 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 file can be used to check who has accessed your server and see 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 log analyzers like e.g. http-analyze, analog, etc. |
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 seeing 193.190.57.4 as the name of the user accessing the web server, 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
This option allows you to adjust the size of the blocks that the web server sends. You probably don't want to play with this.
File-list if no index.html
With this option you can allow/disallow the web server to send a list of the files in the requested directory if there is no index.html present in this directory. This is known as directory browsing and 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 you web site are located.
CGI-BIN directory
This is the directory where your cgi scripts must reside in order to get executed.
File-list icons directory
This is the directory where the icons reside that are used for the representation of the file list when you have enabled "File-list if no index.html" and no file index.html is present in the requested directory.
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.
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
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)"
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 look according to your own wishes.
index.htm index.html e:\WebSite_CelKunststoffen virtual:celkunststoffen.khlim.be log:celkunststoffen.log d:\users\jimmy\Kwaliteitssysteem virtual:Kwaliteit log:kwaliteit.log e:\testdrive\html\stat.html stat.htm c:\os2\utils /os2utils/ index.htm index.html
Aliases allow you to have the web server serve up one file instead of another, so for example, every time someone tries to access index.html Web/2 will redirect this request and send instead 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 opend you have to delete this entry.
Virtual hosts allow a single web server to provide web serving services to more than one domain. To create a virtual host celkunststoffen.khlim.be add the line:
e:\WebSite_CelKunststoffen virtual:celkunststoffen.khlim.be log:celkunststoffen.log
When someone visits http://celkunststoffen.khlim.be the file index.htm that's present in the directory e:\WebSite_CelKunststoffen will get opened. Every access to this site is logged in a file celkunststoffen.log that will be created in the directory Web/2 is installed in.
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 domain names you use (celkunststoffen.khlim.be, ...), must be registered at a name server. Otherwise they can't be accessed.
Web/2 offers you the possibility of creating aliases for html files and directories. Suppose the IP-address of the computer Web/2 is running on is 193.190.57.4
e:\testdrive\html\stat.html stat.htm c:\os2\utils /os2utils/
When a visitor accesses the URL http://193.190.57.4/stat.htm you expect that the web server will send 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 URL http://193.190.57.4/os2utils/ you expect that the web server will send 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
When creating cgi files for use with Web/2 keep in mind that
internal .exe .cmd .cgi !php.exe .php .phtml .php3 .php4 perl.exe .pl .perl
<blocksize> | the defined send() blocksize Web/2 uses. |
<browser> | the type of browser the visitor of your web site is using to access the page. |
<connections> | the number of connections that have been established by Web/2 since it has been started up. |
<date> | the current date. |
<host> | 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. |
<IP> | 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. |
<referer> | 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. |
<sysuptime> | this gives the uptime the PC Web/2 is running on. |
<textcounter> | 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. |
<time24> | this is the local time on the PC Web/2 is running on in 24h format. |
<time> | this is the local time on the PC Web/2 is running on in 12h format. |
<web2uptime> | this is the time Web/2 has been running. |
<webversion> | this gives the version number of Web/2. |
There is an example file stat.htm in the directory html that can be used an example on how to use SSI tags.
Output of stat.htm when accessed through a link on another HTML-page
your host / ip: merlin 127.0.0.1
your browser: Mozilla/4.61 [en] (OS/2; U)
your referer: http://merlin/
web/2 version: v1.3w
web/2 blocksize: 32768
os/2 uptime: 0 days 0:44:27
web/2 uptime: 0 days 0:00:26
connections: 13
date/time: Jul 10, 2001 9:25pm
If you want to show how many times a page is accessed by using the SSI tag <textcounter> you must make an entry for this page in the file counter.dat that can be found in the directory Web/2 is installed in.
Suppose you have a file f:\index.htm and you want to make a counter for this page. Somewhere in this page you have something like
This page has been accessed Now make the following entry in the file counter.dat
This page has been accessed 5 times.
and you see that the line you've entered in counter.dat has changed to
Dink (the author's nickname) has programmed some other fine
software packages. The most known is probably z! (http://dink.org/z/) a very fine
MP3 player which can be also be used as a helper application in
Netscape in order to play MP3 streams.
You can contact the author at
http://dink.org/email (http://dink.org/email)
Don't forget that all this software is written by the author in
his own spare time so if you like this software, please send a
sign of life and your appreciation to him. This way he knows his
work is valued very much and it will give a stimulation to
develop new versions.
If anything isn't working as expected don't start to yell,
try to provide the author with a full reproducible error report
so he is able to correct the problem in case of a bug.
This article is courtesy of www.os2ezine.com. You can view
it online at http://www.os2ezine.com/20010716/page_4.html.
f:\index.htm 0
Every time this html page is accessed the counter will be incremented.
If your page has been accessed 5 times the following output will be generated by Web/2 to the browser
f:\index.htm 5
How to start Web/2 ?
After configuring, starting Web/2 is very easy.
Just execute web.cmd and you're running.
Don't forget that every time you change one of the configuration
files you have to restart Web/2 to activate the new settings.
Where can Web/2 be found and Additional information
As mentioned before, you can download Web/2 (http://dink.org/web2/) from the author's site
dink.org (http://dink.org).
And Then
And then it is up to you.
Give Web/2 a try.
Web/2
Author: dink (http://dink.org/email)
Price: Free
Website: http://dink.org/web2/ (http://dink.org/web2/)
John Bijnens (mailto:jbijnen@attglobal.net) is a CAM/CAM engineer in the
KHLim - Dep. IWT (http://celkunststoffen.khlim.be) which is some kind of
technical university in Belgium. He gives training in Pro/E and also writes CNC
postprocessors (all development is done on OS/2.)