| United States-English |
|
|
|
![]() |
Configuring and Managing MPE/iX Internet Services: HP 3000 MPE/iX Computer Systems > Chapter 9 Apache for MPE/iXMajor 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.
The following are estimates for hardware resources required for an Apache installation.
The 25 MB of disk space would be used approximately in the following way:
If you are using less than the recommended disk space for the log files, you may want to monitor their size. Each request or error message is about 100 bytes and both logs, but especially the access log, can grow quite large. Each request to the web server creates one entry in the access log. To start the Apache web server:
Before your HP3000 can act as a web server, it must be available for network access via TCP/IP. In preparation, you should:
Apache communicates on the network using the HTTP Hypertext Transfer Protocol which, in turn, uses TCP/IP. NS Transport (the TCP/IP transport subsystem) is configured on your HP 3000 using NMMGR. In NMMGR, configure your system's IP address and subnet mask in screen NEXTPORT.NI.Niname.PROTOCOL.IP. TCP should also be configured with the recommended values in the table below using screen NEXTPORT.GPROT.TCP. Information on the TCP/IP parameters is available in the NS3000/iX NMMGR Screens Reference Manual from http://docs.hp.com/mpeix.
After completing your system's TCP/IP configuration, run :NETCONTROL START from the CI command line and verify that it ran successfully. Also verify that your system can respond over the network by running ping either from an HP 3000 or another system:
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. Apache reads two global configuration files when it starts: httpd.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. The mime.types file comes as mime.types.default and must be copied or renamed to mime.types. Similarly, the magic.default file must 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.
The JHTTPD Job Stream File is used to run the HTTPD web server program in standalone mode with your local timezone:
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:
The JHTTPD file does not come with a password. If desired, the JOBSECURITY command can be used to provide password protection without adding your password to the file. The HTTPD web server program is started using the JHTTPD job file. Apache can be started from either the CI or the POSIX shell:
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:
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
After the HTTPD program is running, make sure you can also access files in the directory tree. Some pages to try are:
If you are unsuccessful in starting the HTTPD program, you can get more information about the problem by trying one or more of these troubleshooting techniques:
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,
Apache is stopped by aborting the Apache job from either the CI or the POSIX shell. Use SHOWJOB to view the Apache job:
Apache can also be stopped using :ABORTJOB from the POSIX shell
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 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. Add new documents by creating them under the document root, /APACHE/PUB/htdocs. Documents can also be added outside of the document root using the Alias directive in the httpd.conf file or by using symbolic links. The web server children that handle user requests run as WWW.APACHE, the username specified in the JHTTPD file. For more security, user WWW.APACHE has been created with minimal capabilities. Make sure files are readable by WWW.APACHE and cgi scripts and programs are executable by WWW.APACHE. WWW.APACHE must also have traverse directory (TD) permission for all the directories in the path of the file that it is accessing. In the POSIX shell, traverse directory permission is shown as execute (x) permission for that directory.
One way to check if a file is accessible by Apache is to logon as WWW.APACHE and try to access the file. For any kind of trouble with Apache, first look in the error log. Execute a tail command on the error_log from the POSIX shell to look at the last few entries. The last entry will be the most recent entry:
For troubleshooting Apache at the source code level, the Apache program file can be run with the MPE debugger. It is best to run it with the -X (capital "X") option to prevent the parent Apache process from creating child processes: :run httpd.pub.apache;info="-X";debug HP does not support Apache binaries built by individuals or organizations outside of HP. HP also does not support the scripts and programs in the /APACHE/PUB/bin directory. This is contributed software from the Apache Software Foundation and is provided for example only. For best performance, files returned to the user should be in bytestream format. For example, .html, .htm, .shtml, .shtm, .txt, .gif, .jpeg, and .jpg files, should be in bytestream format instead of in MPE-type format. Bytestream files are more compatible with Apache and with other POSIX applications than are MPE-type files. If you have a web page that calls many images which are not in bytestream format (BA), you could have noticeable performance degradation. If any of your files under the document root (htdocs) are either MPE fixed ascii (FA), MPE variable ascii (VA), or MPE variable binary (VB) files, you should consider converting them to bytestream files using the "tobyte" utility. Program files (fixed binary (FB) files with an NMPROG filecode) should never be converted. A file's filetype can be determined using either the POSIX file command or the CI listfile command: shell/iX> file index*.htmlindex.html: MPE/iX 256-byte variable length binary (filecode: 0) To convert an ASCII-type file (.htm*, .shtm*, or .txt), use the tobyte utility with the -at option. If it is a binary-type file (such as .jpeg, .jpg, or .gif), do not use the -at option: tobyte -at /APACHE/PUB/htdocs/index.html /APACHE/PUB/htdocs/newindex.html For more information on the "tobyte" utility, use the POSIX help facility (i.e. man tobyte). If your Apache web server seems slow in responding, you might try running the Apache job stream file, JHTTPD, in the C queue instead of in the default D queue. The changes shown below allow Apache to run in the C queue while keeping the default execution level for jobs in the D queue. The jobpri command can be executed on the console or in a systart file. !job JHTTPD,www.apache;pri=cs;outclass=,2jobpri cs 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
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||