Nomad and HTTP and CGI, Oh My!

Part III: Testing and Configuration

I assume you know the name or TCP/IP address of your VM host, it should be the same name or address you use to connect via telnet or TN3270.

You should link and access TCPMAINT 592 to have access to the TCPIP DATA file. If you can't get access to TCPMAINT 592, you can still continue but you are probably well into installation method #3 (remember? The "Gee, I'm not sure I'm supposed to do this" Method.)

To start the web server execute the HTTPD EXEC.

If you have access to TCPIP DATA you will see

HTTPD Version 1 Release 2.4
TCPSHELL: PORT 80
TCPSHELL: Ready;

If you do not have access to TCPIP DATA you will see

HTTPD Version 1 Release 2.4
File TCPIP DATA * not found
TCPSHELL: PORT 80
TCPSHELL: Ready;

Without access to TCPIP DATA your web server will work but it will be very slow, fortunately we'll fix that.

If, instead of "TCPSHELL: Ready;", you get the error message "TCPSHELL: EADDRINUSE Address already in use" then somebody else may already be running a web server on this machine. You need to pick a new PORT to run your web server on.

To change the PORT that the web server runs on:
Edit the file HTTPD CONFIG and locate the line that says
  PORT=80
Change the line to read
  PORT=8080
Port 80 is the standard port used by web servers and web browsers, 8080 is a common alternative for unofficial web servers. If you again receive the "Address already in use" message then you can pick another port, simply select any port above 1024 but you may want to start asking yourself, "Gee, am I sure I'm supposed to do this?"

Once you've gotten the TCPSHELL: Ready; response you are ready to access your web server from your web browser!

Start your workstation's browser and enter the address or name of your VM host, for example

http://vm.testing.com
or
http://192.168.37.42

If you had to change the PORT to 8080 or some other number, add that number to the address, for example

http://vm.testing.com:8080
or
http://192.168.37.42:8080

You should see a web page describing Webshare in your browser. Congratulations, you just got your first "hit" on your web server!

Remember, if you don't have access to the TCPIP DATA file then your web server is very slow, perhaps as much as 2 minutes to serve the Webshare intro page. The reason for the slow-down is that Webshare attempts to identify the incoming address of each web visitor and TCPIP DATA contains information that tells Webshare how to do that. It's called an "Address Resolve" or "Reverse DNS Lookup." A simple modification to Webshare will keep it from trying to perform the resolve and as a result will dramatically increase the speed of your web server. Even if you have access to TCPIP DATA this simple modification will provide some increase in speed.

Stop the web server by entering STOP at the TCPSHELL: Ready; prompt.

Edit the file TCPSHELL EXEC and on or around line 271 locate the statement
  Parse Value Socket("RESOLVE",host) With rc rs
Change the line to read
  RC=1
Rather than having TCPSHELL stall for a minute until is realizes it can't RESOLVE the incoming address, we just force RC=1 and let TCPSHELL handle the error 1 minute sooner.

Restart the web server by executing HTTPD

Assuming you are running Netscape or Microsoft Internet Explorer, hold the SHIFT key while you mouse click on the "refresh" icon on your browser. The Webshare intro page should be re-fetched and you should notice an increase in speed. (Note: if you don't hold the SHIFT key you'll see an AMAZING increase in speed but that will be because you just re-fetched it from your local hard drive, the SHIFT key tells your browser to go get the page even if it think it already has a local copy.)

Well, your web server is installed, configured, tuned and tested. Pretty simple, wasn't it?


Back

Next... A simple web page, a simple CGI program

Feel free to send questions or other feedback to me, also drop me a line if you'd like e-mail notification of new installments in this series.


©1997 Don DeCosta, All Rights Reserved