![]() |
Communicator 3000 MPE/iX Release 6.5 (Non-Platform Software Release C.65.00)
> Chapter 5 Internet and InteroperabilityApache for MPE/iX 6.5 |
|||||||||||||||
|
Commercial Systems Division OverviewApache 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 SetApache for MPE/iX supports a rich set of features including:
Technical OverviewAs 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 ComponentsThe 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.
Steps for Starting ApacheTo start the Apache web server:
Prepare Your HP 3000 for Network AccessBefore your HP 3000 can act as a web server, it must be available for network access via TCP/IP. In preparation, you should:
Configure ApacheApache 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 FilesThe 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
Configuration RecommendationWe 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 FileThe 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' !eojThe 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 ProgramThe 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.APACHEor :xeq sh.hpbin.sys -L shell>callci "stream jhttpd.pub.apache" Verify that Apache is RunningThere 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.APACHEAnother 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.APACHEIf the HTTPD program is running, make sure you can also access files in the directory tree. Some pages to try are:
telnet yourserver.com 80 Trying... Connected to yourserver.com. Escape character is '^]'. Stopping ApacheApache 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.APACHEApache 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" LoggingApache 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.VersionThe 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 DocumentationMuch 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,
http://jazz.external.hp.com
|