June 2002
Mr. Know-It-All has the answers to even the really tough questions.
Question:
Sheridan gave me some really good ideas about what I can do with REXX and HTML at the last SCOUG meeting.
Now how do I install Apache so that I can test my work?
Answer:
A basic Apache install is easy. At a minimum, you will need to install the EMX runtime and the Apache base package. Beyond that there are many add-in modules available for Apache and configuration can be a lifetime advocation.
Install EMX
To install EMX get a copy of the
EMX Runtime
from Hobbes.
This version already has
EMX 0.9d fixes #4
integrated.
It is best to install EMX to the preferred default directory.
This is x:\EMX where x: is a convenient drive.
Many EMX applications assume a default directory structure even though they should be more flexible.
Choosing the preferred directory prevents odd problems.
After unzipping, update the config.sys settings as follows:
Setting |
What to change |
LIBPATH |
Insert x:\EMX\DLL |
PATH |
Insert x:\EMX\BIN |
DPATH |
Insert x:\EMX\BOOK |
HELP |
Insert x:\EMX\HELP |
BOOKSHELF |
Insert x:\EMX\BOOK |
HELPNDX |
Insert EMXBOOK.NDX |
and add the following lines to the end of config.sys
SET TERMCAP=x:/emx/etc/termcap.dat
SET TERM=ansi-color-3
SET HOME=x:/home
SET INFOPATH=.;x:/emx/info
SET EMXBOOK=emxdev.inf+emxlib.inf+emxgnu.inf+emxbsd.inf
Replace x: with the drive where EMX is installed.
Create the home directory, if needed.
When specifying path, use forward slashes as shown above.
EMX has it origins in the UNIX world and prefers forward slashes in most cases.
Reboot and test your installation with:
emxrev
This should result in output similar to:
EMX : revision = 61
EMXIO : revision = 60
EMXLIBC : revision = 63
EMXLIBCM : revision = 64
EMXLIBCS : revision = 64
EMXWRAP : revision = 60
Install Apache
You have a choice which Apache to install. There is
Apache v1.3.24 for OS/2 which has been around for a while and is known to be stable.
There is also
Apache v2.0.35 for OS/2
which was released in April, 2002.
I have not heard of any significant problems with it, but there have been significant internal changes.
Installation and configuration is similar for both.
Unzip the distribution zip file to the directory of your choice. Something like x:\Internet\Apache is a reasonable choice.
Apache does not need any config.sys entries if started from a .cmd file similar to:
x:
cd \Internet\Apache
httpd -d.
If the server is going to heavily loaded, insert
set EMXOPT=-c -n -h1024 -!0x800
at the start of the script. This increases the EMX resources available to the server.
Configure Apache
The Apache distribution comes with an almost ready to run configuration file named httpd.conf-dist-os2.
Copy this file as httpd.conf and edit it to match your setup.
Most of the entries that must be configured are marked with keywords of the form
@@keyword@@.
Heres a diff listing of the modifications made for a simple setup.
31a32,33
> # KIA 3/19/2002
> LoadModule php4_module libexec/libphp4.dll
45c47
< # @@ServerRoot@@/conf/srm.conf and then @@ServerRoot@@/conf/access.conf
---
> # /internet/apache/conf/srm.conf and then /internet/apache/conf/access.conf
90c92,93
< ServerRoot "@@ServerRoot@@"
---
> # KIA
> ServerRoot "/internet/apache"
285c288,289
< ServerAdmin you@your.address
---
> # KIA
> ServerAdmin mrkia@scoug.com
303c307,308
< #ServerName new.host.name
---
> # KIA
> ServerName 127.0.0.1
310c315,316
< DocumentRoot "@@ServerRoot@@/htdocs"
---
> # KIA
> DocumentRoot "/internet/apache/mydocs"
335c341,342
<
---
> # KIA
>
351c358,360
< AllowOverride None
---
> # KIA
> #AllowOverride None
> AllowOverride AuthConfig
451a461,462
> # KIA
> #DefaultType application/octet-stream
570c581,582
< Alias /icons/ "@@ServerRoot@@/icons/"
---
> # KIA
> Alias /icons/ "/internet/apache/icons/"
572c584,585
<
---
> # KIA
>
583c596,600
< Alias /manual/ "@@ServerRoot@@/htdocs/manual/"
---
> # KIA
> Alias /htdocs/ "/internet/apache/htdocs/"
>
> # KIA
> Alias /manual/ "/internet/apache/htdocs/manual/"
585c602,603
<
---
> # KIA
>
600c618,619
< ScriptAlias /cgi-bin/ "@@ServerRoot@@/cgi-bin/"
---
> # KIA
> ScriptAlias /cgi-bin/ "/internet/apache/cgi-bin/"
603c622
< # "@@ServerRoot@@/cgi-bin" should be changed to whatever your ScriptAliased
---
> # "/internet/apache/cgi-bin" should be changed to whatever your ScriptAliased
606c625,626
<
---
> # KIA
>
798a819,822
> # KIA 3/19/2002
> AddType application/x-httpd-php .php
> #AddType application/x-httpd-php-source .phps
>
799a824,825
> # KIA
> AddType application/warpin .wpi
965c991
< # CacheRoot "@@ServerRoot@@/proxy"
---
> # CacheRoot "/internet/apache/proxy"
Most of these modifications apply the every installation.
They point Apache at the correct directories.
There are a few special additions:
- .wpi file types have been defined so that a browser will, by default, download them as binary.
- PHP scripting support has been installed.
- Authentication has been enabled.
Brian Harvard's Apache for OS/2 home page has additional useful hints for advanced configuration.
Test Apache
To test your Apache setup, start the server. It should respond with something similar to:
Apache/1.3.23 (OS/2) PHP/4.1.2
Point your browser at 127.0.0.1.
If all is well and you have not forgotten to enable the loopback interface in your TCP/IP setup
you should see:
If you can see this, it means that the installation of the
Apache web server software on this system was successful. You may now add content to this directory and replace this page.
Seeing this instead of the website you expected?
This page is here because the site administrator has changed the
configuration of this web server. Please contact the person
responsible for maintaining this server with questions.
The Apache Software Foundation, which wrote the web server software
this site administrator is using, has nothing to do with
maintaining this site and cannot help resolve configuration
issues.
The Apache documentation has been included
with this distribution.
You are free to use the image below on an Apache-powered web
server. Thanks for using Apache!
|
What Next?
Sheridan showed you how to use REXX and HTML and you already know you can
use REXX for CGI scripts. Well, there's more to REXX and Apache than just this.
There's
Mod_REXX.
Mod_REXX adds support for REXX scriptable handlers in several phases of the Apache processing cycle.
Writing handlers is possibly a bit advanced while you are doing a first time install, but it's nice to
know that you can write them in REXX when you need them.
Curious or in doubt, you can ask
Mr. Know-It-All
OS/2 is his specialty and sharing solutions is his passion
Mr. Know-It-All lives in Southern California.
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2002 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|