HPlogo Communicator 3000 MPE/iX Release 6.5 (Non-Platform Software Release C.65.00) > Chapter 5 Internet and Interoperability

Apache for MPE/iX 6.5

MPE documents

Complete PDF
Table of Contents
Index

by Barbara Dubbert
Commercial Systems Division

Overview


Apache for MPE/iX is server software which turns your HP 3000 into a full-featured web server. With the Apache web server, HP 3000 users can now do business over the Internet.

As a web server, your HP 3000 can provide users with direct access to documents and applications residing on your system. These applications can include both internet and intranet dynamic database connectivity using a browser as a common, easily-maintained interface. The client browser can be any one of a variety of browsers including those from Microsoft and Netscape.

The Apache Web Server is currently the most popular web server on the market with over 50% of the web server market share. Apache on the HP 3000 joins a growing number of computer platforms which support Apache including HP-UX and other UNIX derivatives, Linux, Win32 and various other server and desktop platforms.

Feature Set


Apache for MPE/iX supports a rich set of features including:
  • The latest HTTP protocol, HTTP/1.1

  • Advanced Logging

  • Access Control

  • Common Gateway Interface applications (CGI)

  • Server Side Includes (SSI)

  • Cookies

  • Imagemaps

For details on installing and using Apache for MPE/iX, refer to the Technical Overview section.

Technical Overview


As a web server, your HP 3000 can provide users with direct access to documents and applications residing on your system. Users make requests to the web server via a client browser using the Hypertext Transfer Protocol (HTTP). The sole purpose of a web server is to translate a request (URL) into either a filename, and then send that file back over the network, or into a program name, and then run that program and send its output back.Once you start the executable, HTTPD, Apache runs silently in the background, waiting for a client's request to arrive on a port to which it is listening. Apache listens on the port specified in its configuration file.

When a request arrives, Apache hands the request to one of its child processes to service and returns to listen again on the port.

Major Components


The major components for Apache are the web server program (HTTPD), the job stream file which runs the HTTPD program (JHTTPD), a set of configuration files for enabling Apache features, the htdocs directory containing HTML pages, the logs directory, and the cgi-bin directory. Apache also comes with a full, on-line manual set.
  • HTTPD is the Apache web server program. "HTTP" stands for the protocol used between the client browser and the Apache web server. "D" stands for daemon, a system program which automatically handles certain system operations. The HTTPD web server program intercepts an incoming request from the browser, interprets and handles the request, then delivers output in the form of an HTML page to the client. The HTTPD program file resides in the /APACHE/PUB directory.

  • JHTTPD is a job stream file which runs the Apache web server as a standalone process. This file also specifies the system timezone and the location of the global Apache configuration file, http.conf. JHTTPD resides in the /APACHE/PUB directory.

  • The configuration files tell the HTTPD server program where to find files, which files and directories can be accessed, who can access them, and the location of executable programs on the server. These files give you the flexibility of having the web server do only what you want it to do. These files reside in /APACHE/PUB/conf.

  • The htdocs directory contains the public documents, images, and data to be served to clients. The htdocs directory and the directories below it are available to anyone accessing your web server.

  • The logs directory contains log data of both web server accesses and of errors.

  • The cgi-bin directory contains CGI scripts. These are executed by Apache on behalf of its clients.

  • The bin directory contains a set of scripts and programs contributed by the Apache Software Foundation. They are included as examples only and are not supported by HP.

  • The Apache manual set, residing in /APACHE/PUB/htdocs/manual, describes the entire Apache feature set and the syntax definition for configuring these features. Access to the manual documents is specified with the URL, http://yourserver.com/manual/index.html, where "yourserver.com" is the domain name of your HP 3000.

Steps for Starting Apache

To start the Apache web server:
  1. Prepare your system for network access

  2. Copy and edit the configuration files

  3. Edit the JHTTPD job stream file

  4. Start the HTTPD web server program

  5. Verify that the HTTPD web server is running

Prepare Your HP 3000 for Network Access

Before your HP 3000 can act as a web server, it must be available for network access via TCP/IP. In preparation, you should:
  • Configure TCP/IP on your system

  • Have a domain name associated with your system's IP address

Apache communicates on the network using the HTTP Hypertext Transfer Protocol which, in turn, uses TCP/IP. Using NMMGR, configure your system's IP address and subnet mask. Then run :NETCONTROL START from the CI command line and verify that it ran successfully.

You will also want to get a domain name. This is a unique identifier such as "yourserver.com" which is used (instead of the IP address) to direct requests from a browser to your server. Request a domain name from the administrator of the Domain Name Server (DNS) on your network.

Configure Apache

Apache reads two global configuration files when it starts: httd.conf and mime.types. These configuration files determine how Apache behaves. Earlier versions of Apache read two additional global configuration files: access.conf and srm.conf. These additional global configuration files can be still be used, but by default they are empty and their original content is now included in the httpd.conf file.

Edit your Configuration Files

The mime.types file comes as mime.types.default and must be copied or renamed to mime.types. Similarly the magic.default file must also be copied or renamed. The httpd.conf file comes in two different versions. The httpd.conf.default file is for a UNIX-based platform installation. The httpd.conf.sample file was derived from the httpd.conf.default file with modifications for MPE. This is the file you should edit.

  shell> cd /APACHE/PUB/conf
  shell> cp mime.types.default mime.types
  shell> cp magic.default magic
  shell> cp httpd.conf.sample httpd.conf
  shell> vi httpd.conf

  1. Uncomment and replace "yourserver.com" with your own server's name for the ServerAdmin and ServerName directives. Review the Configuration Recommendation below. You may also choose to make other changes. The Apache Server Project web site, http://www.apache.org/docs, has information about all of the configuration directives. All lines beginning with # are comments and are ignored by the HTTPD program file. Also note that the content of the configuration files is case sensitive.

    Changes to the global configuration files do not take effect until the web server is started (or stopped and restarted if it is already running).

  2. Verify the configuration file. It is a good idea to verify your configuration files before trying to start the web server. This verification is for syntax checking only.

    
      shell>/APACHE/PUB/HTTPD -t
    
    

Configuration Recommendation

We strongly recommend setting KeepAlive to off in http.conf. With KeepAlive on, sockets may eventually be used up. When this happens, Apache will appear to be hung and will need to be restarted.

Edit the JHTTPD Job Stream File

The JHTTPD Job Stream File is used to run the HTTPD web server program in standalone mode with your local timezone:

  !job jhttpd,www.apache,pub;outclass=,2
  !setvar TZ 'PST8PDT'
  !run HTTPD;info='-f /APACHE/PUB/conf/httpd.conf'
  !eoj

The timezone variable, TZ, should be set to your local timezone (for example, EST5EDT for Eastern Daylight Time, PST8PDT for Pacific Daylight Time, and MST7MDT for Mountain Daylight Time). For more information about setting the timezone value, enter "man timezone" in the POSIX shell to read the POSIX help file.

To preserve the access permissions (ACD) on the JHTTPD file, you can edit the file using the secure feature of EDITOR:

  :EDITOR
  /t JHTTPD
  /m ...
  /set secure
  /k
  JHTTPD,UNN
  JHTTPD ALREADY EXISTS - RESPOND YES TO PURGE OLD AND KEEP NEW
  PURGE OLD?yes
  /e

Start the HTTPD Web Server Program

The HTTPD web server program is started using the JHTTPD job file. Apache can be started from either the CI or the POSIX shell:

  :STREAM JHTTPD.PUB.APACHE

or

  :xeq sh.hpbin.sys -L
  shell>callci "stream jhttpd.pub.apache"

Verify that Apache is Running

There are a number of ways to verify if the Apache web server is running or, if it is not, to isolate how far the startup process progressed.

After streaming the JHTTPD file, use :SHOWJOB to view the running job:

  JOBNUM  STATE IPRI JIN  JLIST    INTRODUCED  JOB NAME
  #J16    EXEC        10S LP       TUE 10:27A  JHTTPD,WWW.APACHE

Another method is to check server status using either ps from the POSIX shell or using :SHOWPROC at the CI. The parent process is the HTTPD process with the -f option.

  :SHOWPROC; job=jhttpd,www.apache
  D202    0:00.079        WAIT    J16     73   :RUN HTTPD;
    info='-f /APACHE/PUB/conf/httpd.conf'
  D238    1:25.371        WAIT    J16     97   (HTTPD.PUB.APACHE)
    -f /APACHE/PUB/conf/httpd.conf
  D202    0:00.066        WAIT    J16     78   (HTTPD.PUB.APACHE)
  D202    0:00.072        WAIT    J16     76   (HTTPD.PUB.APACHE)
  D202    0:00.069        WAIT    J16     93   (HTTPD.PUB.APACHE)
  D202    0:00.090        WAIT    J16     106  (HTTPD.PUB.APACHE)
  D202    0:00.050        WAIT    J16     99   (HTTPD.PUB.APACHE)
  D202    0:00.055        WAIT    J16     107  (HTTPD.PUB.APACHE)


 shell> ps -ef | grep HTTPD
  
        UID     PID     PPID  C   STIME TTY     TIME COMMAND
 WWW.APACHE  720972   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE
 WWW.APACHE  589902   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE
 WWW.APACHE 3014749   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE
 WWW.APACHE  655457  5963849  0  Dec 31 ldev10  1:23 HTTPD.PUB.APACHE
   info=-f
 WWW.APACHE 4587619   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE
 WWW.APACHE  262250   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE
 WWW.APACHE 3407979   655457  0  Dec 31 ldev10  0:00 HTTPD.PUB.APACHE

If the HTTPD program is running, make sure you can also access files in the directory tree. Some pages to try are:
  • Your server's Home Page

    
      http://yourserver.com
    
    
  • MGR.APACHE's Home Page

    
      shell> cd /APACHE/PUB/public_html
      shell> cp index.htm.sample index.html
      http://yourserver.com/~MGR.APACHE
    
    
  • The Apache on-line documentation manual

    
      http://yourserver.com/manual
    
    
If you are unsuccessful in starting the HTTPD program, you can get more information about the problem by:1. Looking at the output of the JHTTPD spoolfile2. Checking the messages in the /APACHE/PUB/logs/error_log file 3. Trying to telnet to Apache's port (port 80 if you have not modified the port directive set in the httpd.conf.sample file) If you cannot telnet to Apache's port, then your problem is not with the web server. You are not yet reaching your HP 3000 box. A successful telnet connection should look something like,

  telnet yourserver.com 80
  Trying...
  Connected to yourserver.com.
  Escape character is '^]'.

Stopping Apache

Apache is stopped by aborting the Apache job from either the CI or the POSIX shell. Use SHOWJOB to view the Apache job:

  JOBNUM  STATE IPRI JIN  JLIST    INTRODUCED  JOB NAME
  #J16    EXEC        10S LP       TUE 10:27A  JHTTPD,WWW.APACHE

  :ABORTJOB #J16               or
  :ABORTJOB JHTTPD,WWW.APACHE

Apache can also be stopped using :ABORTJOB from the POSIX shell

  :xeq sh.hpbin.sys -L
  shell>callci "abortjob #j16"              or
  shell>callci "abortjob jhttp,www.apache"

Logging

Apache error logging is useful when trying to start Apache as well as for monitoring a running web server. Apache logs errors into a log file called the error_log by default. This log file resides in the /APACHE/PUB/logs directory.

The number of messages logged in the error log is set by the LogLevel directive in the httpd.conf file. Possible values for LogLevel (by increasing significance) are debug, info, notice, warn, error, crit, alert, emerg. When a particular level is specified, messages from all other levels of higher significance are reported as well. For example, when LogLevel is "info", then messages with log levels of notice, warn, and up to emerg are also posted.

By default, the level is set to warn. Using a level of at least crit is recommended.

Version

The current version of Apache for MPE/iX is based on Apache 1.3.4 from the Apache Software Foundation. In addition to the http core that is the heart of the Apache code, 28 more Apache modules have been compiled into the web server program for a large feature set. A full description of each of these modules is included in the on-line manual document pages.

  shell> /APACHE/PUB/HTTPD -v
  Server version: Apache/1.3.4 (MPE-1.3.4-v1.0)
  Server built:   Aug 24 1999 16:11:19
  shell> /APACHE/PUB/HTTPD -l
  Compiled-in modules:
    http_core.c
    mod_env.c
    mod_log_config.c
    mod_log_agent.c
    mod_log_referer.c
    mod_mime_magic.c
    mod_mime.c
    mod_negotiation.c
    mod_status.c
    mod_info.c
    mod_include.c
    mod_autoindex.c
    mod_dir.c
    mod_cgi.c
    mod_asis.c
    mod_imap.c
    mod_actions.c
    mod_speling.c
    mod_userdir.c
    mod_alias.c
    mod_access.c
    mod_auth.c
    mod_auth_anon.c
    mod_cern_meta.c
    mod_expires.c
    mod_headers.c
    mod_usertrack.c
    mod_unique_id.c
    mod_setenvif.c

Additional Documentation

Much of the public information available on Apache can be used for administrating Apache on MPE/iX. This especially applies to the description and usage of the over 128 different Apache configuration directives.

Sources for additional information include,
  • The Apache on-line manual pages included as part of MPE FOS at
    http://yourserver.com/manual/index.html

  • The Apache Software Foundation's on-line documentation at
    http://www.apache.org/docs

  • Apache books, published by various publishers, such as O'Reilly and Associates, Inc. and IDG Books Worldwide, Inc.

For downloadable software to enhance your web site (perl, sendmail, python, etc.), visit MPE's external Jazz web server at
http://jazz.external.hp.com




Transact/iX Expanded B-Tree and File Open Enhancement


Introducing LDAP C-SDK/iX