• No results found

HTTP Server (powered by Apache)

N/A
N/A
Protected

Academic year: 2021

Share "HTTP Server (powered by Apache)"

Copied!
264
0
0

Loading.... (view fulltext now)

Full text

(1)

ibm.com/redbooks

HTTP Server

(powered by Apache)

An Integrated Solution for IBM

iSeries Servers

Brian R. Smith

Gaia Banchelli

Monica Maria Echeverry

Axel Lachmann

Go from zero to your first HTTP Server

(powered by Apache) in minutes

Fully exploit the integrated power

of OS/400 and Apache

Go step-by-step through the

Web site and applications

(2)
(3)

International Technical Support Organization

HTTP Server (powered by Apache): An Integrated

Solution for IBM

~

iSeries Servers

April 2002

(4)

© Copyright International Business Machines Corporation 2002. All rights reserved.

First Edition (April 2002)

This edition applies to V5R1 of the IBM HTTP Server for iSeries (5722-DG1) for use with V5R1 OS/400 (5722-SS1).

Comments may be addressed to:

IBM Corporation, International Technical Support Organization Dept. JLU Building 107-2

3605 Highway 52N

Rochester, Minnesota 55901-7829

When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you.

Take Note! Before using this information and the product it supports, be sure to read the general

(5)

© Copyright IBM Corp. 2002 iii

Contents

Contents . . . iii

Special notices . . . vii

IBM trademarks . . . viii

Preface . . . ix

The team that wrote this redbook. . . ix

Special notice . . . .x

Comments welcome. . . xi

Part 1. Zen and the art of the HTTP server . . . 1

Chapter 1. ‘Powered by Apache’ means OS/400 integration. . . 3

1.1 HTTP Server (original and powered by Apache) features. . . 4

1.1.1 HTTP Version 1.1 . . . 4

1.1.2 GUI configuration and administration . . . 4

1.1.3 Persistent connections . . . 7

1.1.4 Virtual hosts . . . 7

1.1.5 Dynamic virtual hosting . . . 7

1.1.6 Proxy caching . . . 7

1.1.7 Local memory cache . . . 8

1.1.8 Server-side includes . . . 8

1.1.9 CGI programming . . . 8

1.1.10 LDAP support . . . 9

1.1.11 Webserver Search Engine . . . 9

1.1.12 Web-based Distributed Authoring and Versioning (WebDAV) . . . 10

1.1.13 Access log reporting and Web usage mining . . . 10

1.1.14 Platform for Internet Content Selection (PICS) . . . 10

1.1.15 Domino plug-in . . . 11

1.1.16 WebSphere Application Server plug-in . . . 11

1.1.17 Apache Software Foundation’s Jakarta Tomcat . . . 11

1.1.18 Original Server API . . . 11

1.1.19 Apache Portable Runtime (APR) . . . 11

1.1.20 Support for the TRCTCPAPP command. . . 12

1.1.21 Triggered Cache Manager (TCM) . . . 12

1.1.22 Highly available HTTP server . . . 13

1.2 References . . . 13

Chapter 2. From zero to powered by Apache . . . 15

2.1 Before you start . . . 16

2.1.1 Software . . . 16

2.1.2 User profile authorities . . . 19

2.1.3 Web browser . . . 19

2.2 Software installation . . . 20

2.2.1 Installing LPPs and OS/400 options . . . 20

2.2.2 Installing PTFs . . . 20

2.2.3 Installing the ITSO example Web application (optional) . . . 21

(6)

2.3.1 Starting the APACHEDFT instance. . . 21

2.3.2 Your first HTTP Server (powered by Apache) via a wizard. . . 23

Chapter 3. Quick guide to Apache contexts and request routing . . . 31

3.1 In-context configuration . . . 32

3.2 Apache Server request routing . . . 33

3.3 Request routing example . . . 34

3.4 Configuration recommendations . . . 35

3.5 Configuring directory listings . . . 35

Part 2. How to... . . 39

Chapter 4. Virtual hosts . . . 41

4.1 HTTP virtual host overview . . . 42

4.1.1 The way TCP/IP is configured. . . 42

4.1.2 The way the HTTP server will be configured . . . 42

4.1.3 The way the HTTP server will handle visitor requests . . . 44

4.2 HTTP Server (powered by Apache) virtual host overview. . . 46

4.2.1 Additional resources . . . 47

4.3 Virtual hosts: IP-based implementation. . . 47

4.3.1 IP-based virtual host: Problem scenario . . . 48

4.3.2 IP-based virtual host: Solution overview . . . 49

4.3.3 IP-based virtual host: Step-by-step implementation . . . 50

4.4 Virtual hosts: Name-based implementation . . . 60

4.4.1 Name-based virtual hosts: Problem overview. . . 61

4.4.2 Name-based virtual host: Solution overview . . . 62

4.4.3 Name virtual host: Step-by-step implementation . . . 63

4.5 Virtual hosts: Mass dynamic implementation . . . 65

4.5.1 Mass dynamic virtual host: Problem scenario. . . 67

4.5.2 Mass dynamic virtual host: Solution overview. . . 68

4.5.3 Mass dynamic virtual host: Step-by-step implementation . . . 69

Chapter 5. Defending the IFS . . . 75

5.1 Basic authentication . . . 76

5.1.1 Authentication by OS/400 user profiles. . . 78

5.1.2 Authentication by a validation list . . . 80

5.1.3 Authentication by LDAP entries . . . 84

5.2 Access control . . . 89

5.3 Encrypting your server’s data with SSL and TLS . . . 90

5.4 Enabling SSL for the ADMIN instance . . . 96

5.5 Client side digital certificates . . . 97

5.6 Proxy server: Protecting direct access . . . 98

5.6.1 Forward proxy . . . 99

5.6.2 Reverse proxy and proxy chaining . . . 101

5.7 Additional resources . . . 101

Chapter 6. Serving dynamic data. . . 103

6.1 Server-side includes (SSI) . . . 104

6.2 Net.Data: A ready-made scripting tool . . . 106

6.3 Everything dynamic with CGI support . . . 109

6.4 Additional resources . . . 110

Part 3. Building a Web application . . . 111

(7)

Contents v

7.1 Web application servers for iSeries. . . 115

7.1.1 A comparison between WebSphere Application Server and ASF Tomcat . . . 116

7.1.2 When to use WebSphere Application Server versus ASF Tomcat . . . 120

7.2 Apache Software Foundation's Jakarta Tomcat on iSeries. . . 121

7.2.1 ASF Tomcat directory structure . . . 122

7.2.2 ASF Tomcat directives . . . 123

7.2.3 ASF Tomcat authorities . . . 125

7.2.4 ASF Tomcat log files . . . 125

7.3 The Order Entry application overview . . . 126

7.3.1 The ABC Company . . . 126

7.3.2 The ABC Company database . . . 127

7.3.3 A customer transaction . . . 127

7.3.4 Application flow . . . 128

7.3.5 Customer transaction flow. . . 129

7.3.6 Database table structure . . . 133

7.3.7 Order Entry application database layout . . . 134

7.4 Order Entry application implementation: Start here . . . 134

7.4.1 Implementation using WebSphere Application Server . . . 137

7.4.2 Implementation using Tomcat . . . 149

Chapter 8. Getting the best performance from HTTP Server (powered by Apache) . 161 8.1 Web performance components . . . 162

8.2 Web server performance. . . 163

8.2.1 Web server global performance values. . . 165

8.2.2 Web server specific performance values . . . 173

8.2.3 Triggered Cache Manager . . . 177

8.3 References . . . 182

Chapter 9. Getting started with Webserver Search Engine and Web Crawler. . . 183

9.1 iSeries Webserver Search Engine . . . 184

9.2 iSeries Webserver Search Engine Web Crawler. . . 184

Chapter 10. Apache Portable Runtime (APR): Extending your core functionality . . 187

10.1 Apache module design overview . . . 188

10.1.1 Documentation and resources . . . 190

10.2 Creating a module for the iSeries . . . 190

10.2.1 The task at hand . . . 190

10.2.2 Source code and comments . . . 191

10.2.3 Compiling, linking, and exporting your service program . . . 195

10.2.4 Activating via configuration . . . 195

10.2.5 Testing header_module . . . 196

10.2.6 Debugging. . . 197

Chapter 11. Problem determination: When things do not go as planned . . . 199

11.1 The art of problem determination . . . 200

11.2 Tools of the trade . . . 202

11.2.1 Working with configuration files. . . 202

11.2.2 Job logs. . . 204

11.2.3 Server logs . . . 206

11.2.4 Net.Data logs and traces . . . 210

11.2.5 HTTP server trace. . . 210

11.2.6 Other startup parameters . . . 214

11.2.7 HTTP status codes . . . 215

(8)

Chapter 12. High availability . . . 217

12.1 Highly available Web server cluster on HTTP server . . . 218

12.1.1 Primary/backup with takeover IP model . . . 218

12.1.2 Primary/backup with a network dispatcher model. . . 219

12.1.3 Peer model . . . 220

Part 4. Appendices . . . 221

Appendix A. Migration from HTTP Server (original) to (powered by Apache). . . 223

Introduction . . . 224

An example migration . . . 226

Testing your migration . . . 231

Appendix B. Additional material . . . 235

Locating the Web material . . . 235

Using the Web material . . . 235

System requirements for downloading the Web material . . . 236

How to use the Web material . . . 236

Related publications . . . 237

IBM Redbooks . . . 237

Other resources . . . 238

Referenced Web sites . . . 238

How to get IBM Redbooks . . . 238

IBM Redbooks collections. . . 239

(9)

© Copyright IBM Corp. 2002 vii

Special notices

References in this publication to IBM products, programs or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent program that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program or service.

Information in this book was developed in conjunction with use of the equipment specified, and is limited in application to those specific hardware and software products and levels. IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785.

Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact IBM Corporation, Dept. 600A, Mail Drop 1329, Somers, NY 10589 USA. Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.

The information contained in this document has not been submitted to any formal IBM test and is distributed AS IS. The use of this information or the implementation of any of these techniques is a customer responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. While each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will be obtained elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

Any pointers in this publication to external Web sites are provided for convenience only and do not in any manner serve as an endorsement of these Web sites.

(10)

IBM trademarks

The following terms are trademarks of the International Business Machines Corporation in the United States and/or other countries:

Other company trademarks

The following terms are trademarks of other companies:

C-bus is a trademark of Corollary, Inc. in the United States and/or other countries.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and/or other countries.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States and/or other countries.

PC Direct is a trademark of Ziff Communications Company in the United States and/or other countries and is used by IBM Corporation under license.

ActionMedia, LANDesk, MMX, Pentium and ProShare are trademarks of Intel Corporation in the United States and/or other countries.

UNIX is a registered trademark in the United States and other countries licensed exclusively through The Open Group.

SET, SET Secure Electronic Transaction, and the SET Logo are trademarks owned by SET Secure Electronic Transaction LLC.

Other company, product, and service names may be trademarks or service marks of others.

e (logo)® AIX® AS/400e™ IBM® iSeries™ OS/400® Perform™ RS/6000® SP™ VisualAge® Lotus® Notes® Redbooks (logo)™ AS/400® DB2® IBM.COM™ Net.Data® PartnerWorld® Redbooks™ SecureWay® System/38™ WebSphere® Approach® Domino™

(11)

© Copyright IBM Corp. 2002 ix

Preface

This IBM Redbook is designed to be a helpful guide for planning, installing, configuring, troubleshooting, and understanding the HTTP Server (powered by Apache) running on the IBM

~

iSeries server. This redbook starts simple with an introduction to the HTTP Server (powered by Apache). It identifies all the components necessary for you to install and configure your first Apache-based Web server running on your iSeries server. It includes a quick guide to the Apache contexts and request routing as well as an introduction to the iSeries’ unique graphical user interface (GUI) for further configuration and customization. Then this redbook instructs you on how to use virtual hosts, secure your server, and serve dynamic data with server-side includes (SSI), Net.Data, and CGI. Each lesson is written in an easy to follow “how to” style.

After that, this redbook takes an in-depth look at the HTTP Server (powered by Apache). It details the steps that are necessary to implement Web application serving with Java featuring WebSphere Application Server and the Apache Software Foundation’s (ASF) Tomcat. It includes a comparison guide of the strengths and weaknesses of both of these Web

application servers. It covers more advanced topics such as how to get the best performance from your HTTP Server (powered by Apache), an introduction to the Webserver Search Engine, problem determination, and high availability. Plus it includes a running example of extending the core features of your HTTP Server (powered by Apache) via Apache Portable Runtime (APR) support, which allows you to write your own modules or port them to the iSeries as ILE service programs.

To round out the discussion, this IBM Redbook concludes with an appendix on migrating from the HTTP Server (original) to an HTTP Server (powered by Apache).

As an added bonus, you can download all the examples provided in this redbook from the Web. This will allow you to reduce the transition time from understanding to implementation.

The team that wrote this redbook

This redbook was produced by a team of specialists from around the world working at the International Technical Support Organization, Rochester Center.

Brian R. Smith is a Sr. Consulting I/T Specialist in the IBM International Technical Support

Organization (ITSO) Rochester Center. The first third of his career was spent in the

Rochester Lab with the design, coding, and testing of the System/38 and AS/400 in the area of communications. He then “jumped the wall” into technical marketing support in 1990 in order to pursue the life of teaching and writing. Brian is the team leader of the iSeries e-business team at the ITSO Rochester Center. You can reach Brian at brsmith@us.ibm.com Gaia Banchelli is a Software Systems Specialist in IBM Italy. She works as a

communications and networking specialist for the iSeries Technical Support in Milan, focusing on Internet technologies and implementing Web solutions. Her areas of expertise include Perl, Java programming, and the Linux operating system.

(12)

Monica Maria Echeverry is an IT Specialist in IBM Colombia. She has six years of

experience with the iSeries server. Two years ago she joined the e-business group to make the best use of her expertise with WebSphere Application Server and WebFacing. She has worked on e-business projects in Colombia as well as in many South America countries. Monica also has worked in the areas of performance, work management, Client Access, and many other iSeries products.

Axel Lachmann is a Project Manager and Senior Systems Engineer with Schroedter &

Lachmann Consulting, an affiliate company of FoxCom, an AS/400 Business Partner in Germany. He has nine years of experience in the OS/400 field. He is an IBM Certified Solutions Expert - AS/400 Technical Solutions and Domino R4.6 for AS/400 Technical Solutions. His areas of expertise include e-business enablement of LOB applications, application modernization, and Lotus Domino planning and implementation. Axel also extensively teaches TCP/IP and other e-business related topics for IBM Learning Services in Germany. You can reach Axel at alachmann@S-und-L.de

Thanks to the following people and groups for their contributions to this project: Tom Barlen

Yessong Johng Bob Maatta

International Technical Support Organization, Rochester Center Kent Bruinsma Jim Fall Wade Fode Robert Gagliardi Don Q Ha Beth Hoffman Cyrus Kirby Katherine Richardson Tim Rowe Saeid Sakhitab Kristi Schultz Rob Simonson John Wingertsman IBM Rochester Peter Hey IBM UK

Sections of this redbook were prepared with assistance by Information Development at IBM Rochester.

Special notice

This publication is intended to help Web application architects, designers, and implementors plan, install, configure, troubleshoot, and understand the HTTP Server (powered by Apache) running on the IBM

~

iSeries server. The information in this publication is not intended as the specification of any programming interfaces that are provided by IBM HTTP Server for iSeries, which includes the component HTTP Server (powered by Apache). See the

PUBLICATIONS section of the IBM Programming Announcement for IBM HTTP Server for iSeries for more information about what publications are considered to be product

(13)

Preface xi

Comments welcome

Your comments are important to us!

We want our IBM Redbooks to be as helpful as possible. Send us your comments about this or other Redbooks in one of the following ways:

򐂰 Use the online Contact us review redbook form found at:

ibm.com/redbooks

򐂰 Send your comments in an Internet note to: redbook@us.ibm.com

(14)
(15)

© Copyright IBM Corp. 2002 1

Part 1

Zen and the art of the

HTTP server

Your iSeries Web server is the center of most all e-business applications. HyperText Transfer Protocol (HTTP) is the protocol used to communicate between a client (browser) and your Web server. This HTTP protocol can be used to carry the order from your customers and allow you to respond with a “thank you”.

Network administrators know how to configure your firewalls to allow the HTTP protocol through between your private intranet and the public Internet. They also know how to force people to sign on before they access sensitive portions of your Web site. And they know how to encrypt the data using powerful protocols such as Secure Sockets Layer (SSL) and Transport Layer Security (TLS). These powerful tools are available to your network administrator via a GUI configuration – not through complex programming.

Application servers, such as WebSphere Application Server and the Apache Software Foundation’s Jakarta Tomcat, can allow you to dynamically extend the power of your HTTP server core features and functions. They are the incarnation of specifications from Sun Microsystems that allow you to program industry standard Java applications as servlets and JavaServer Pages (JSPs).

Read on to find out more about how your HTTP Server (powered by Apache) can handle your e-business needs.

(16)
(17)

© Copyright IBM Corp. 2002 3

Chapter 1.

‘Powered by Apache’ means

OS/400 integration

Most HTTP servers originate from CERN or National Center for Supercomputing Application (NCSA). The Apache server originates from NCSA. The fundamental ideas behind and the basic design of the World Wide Web evolved from work being done at CERN in Geneva, Switzerland. In its roots, the Apache server was developed at NCSA, and it was based on the NCSA HTTP daemon (NCSA HTTPd 1.3).

The NCSA Web server, at that time, was adopted and used by a large number of webmasters in the market. In mid-1994, however, the development for this Web server stalled and left many webmasters to find their own solutions to problems encountered in their environments. Some of them developed their own extensions and problem fixes, which could apply to other webmasters searching for the same solution.

In February 1995, a group of webmasters volunteered to consolidate all information related to the server and placed it in a publicly accessible domain for all webmasters to access. The Apache Group was then formed from people who had made substantial contributions to the Apache server. NCSA later revived the suspended development of their NCSA Web server, and two members from that development team joined the Apache Group so that ideas and contributions could be exchanged among both projects. The Apache Group reviewed some of the enhancements and bug fixes and added them to their own server for testing purposes. In April 1995, the Apache server made its first public release with Version 0.6.2. It was given this name because it was the “patched” version (A PAtCHy server) of the NCSA HTTPd 1.3 Web server.

In May through June 1995, some general overhaul and redesign was made to fine-tune the Apache server, along with the introduction of some new features in Version 0.7.x. The next release of the Apache server with Version 0.8.8 in August 1995 brought about a change in the architecture of the server with the modular structure and API features. The latest level available for the Apache server is Version 1.3, while development is in progress for Version 2.0.

(18)

The market share for top servers across all domains in December 2001 was:

򐂰 56.50% Apache

򐂰 30.75% Microsoft IIS

򐂰 3.59% iPlanet (Netscape)

Apache, a freeware HTTP server, is open-source software that implements the industry standard HTTP/1.1 protocol. The focus is on being highly configurable and easily extendable. It is built and distributed under the Apache Software Foundation and is available at on the Web at: http://www.apache.org

The benefit of Apache to iSeries users is that the HTTP Server (powered by Apache) is based on the open-source server code provided by the Apache Software Foundation. This version is based on the “beta” code for Apache Version 2.0. It will be updated as future Apache versions are made available. While iSeries source code will not be published, IBM will offer any enhancements it develops to the Apache Software Foundation in an open-source form for inclusion in the Apache server. As with any supported product, IBM will provide defect support for the HTTP Server (powered by Apache). IBM has long been active in Apache development.

It is this integration with OS/400 that forces IBM to no longer call this server an Apache server. It must be called the

HTTP Server (powered by Apache)

with the parenthetical phrase as a bold reminder of the power and value of the integration with OS/400.

1.1 HTTP Server (original and powered by Apache) features

Both HTTP Server (original) and HTTP Server (powered by Apache) have their own advantages, but which product should you choose? This section provides a functional comparison about these products to help answer this question.

1.1.1 HTTP Version 1.1

Both products support HTTP Version 1.1. The HTTP protocol implementation in Apache was chiefly architected by one of the HTTP Version 1.1 authors. Most current versions of popular Web browsers support HTTP Version 1.1. Apache is normally configured to detect popular browsers that do not properly support HTTP Version 1.1, and use only HTTP Version 1.0.

1.1.2 GUI configuration and administration

You can configure and administrate HTTP server instances from Web browsers. To show the configuration and administration screen, type the following URL from a Web browser:

http://hostname:2001

Figure 1-1 and Figure 1-2 show the configuration pages for the HTTP Server (original) and HTTP Server (powered by Apache), respectively. The configuration pages are different between the HTTP Server (original) and the HTTP Server (powered by Apache), but you can reach each page from the same URL.

Source: December 2001 Netcraft (http://www.netcraft.com/survey/)

Tip: It is the goal of IBM to eventually replace the HTTP Server (original) with the HTTP

Server (powered by Apache). For long-term thinkers, HTTP Server (powered by Apache) is the better choice.

Both original and Apache

Both original and Apache

(19)

Chapter 1. ‘Powered by Apache’ means OS/400 integration 5

Figure 1-1 Original server configuration page

(20)

The HTTP Server (original) and the HTTP Server (powered by Apache) can coexist. That is, you may have zero, one, or many original servers running at the same time you have zero, one, or many HTTP Server (powered by Apache) servers running. The administration screen allows you to create and manage HTTP servers. Figure 1-3 shows the GUI Administration page.

Figure 1-3 IBM HTTP Server configuration GUI

The navigation menu in the left-hand frame provides the following choices:

򐂰 HTTP Server Creation: Allows you to create new HTTP servers with a wizard. The wizard

provides a streamlined process for quickly creating HTTP servers. You can also “migrate” or create a new HTTP Server (powered by Apache) based on an existing HTTP Server (original) without changing the existing configuration.

򐂰 General Server Administration: Allows you to display the status of, start, stop, restart,

monitor, delete, and configure the individual servers. This section also allows you to configure the global server attributes (the rules and configuration settings for all servers) such as autostart, number of threads to use, and specific mapping tables.

򐂰 Access Control Administration: Allows you to define who can access resources on the

(21)

Chapter 1. ‘Powered by Apache’ means OS/400 integration 7

1.1.3 Persistent connections

When you enter a URL into your browser’s address line or click a link on a Web page, you open a connection between your browser and the HTTP server. Prior to the availability of persistent connections, each file referenced on the Web page was retrieved using a separate connection. This type of retrieval is tremendously costly for the HTTP server and the network since overhead is required to establish and terminate each connection. Persistent

connections are the default behavior for an HTTP server that implements the HTTP 1.1 protocol.

1.1.4 Virtual hosts

You can enable virtual hosting. This allows you to host any number of Web sites through one communications adapter. With virtual hosting, you do not need to assign a unique port to each Web site. Virtual hosting is useful if you need to provide multiple “top-level” URLs for your Web sites or if you provide ISP services to clients.

See Chapter 4, “Virtual hosts” on page 41, for more information about the more flexible solution for the HTTP Server (powered by Apache).

1.1.5 Dynamic virtual hosting

The dynamic virtual host allows you to dynamically add Web sites (host names) by adding directories of content. This approach is based on automatically inserting the IP address and the contents of the Host: header into the pathname of the file that is used to satisfy the request.

See 4.5, “Virtual hosts: Mass dynamic implementation” on page 65, for more information.

1.1.6 Proxy caching

The IBM HTTP Server for iSeries can be configured as a non-caching or caching proxy server. When used as a non-caching proxy, the primary benefit of enabling proxy services is that the IP addresses used on the internal network are not sent out of your network. The proxy service forwards the request from your internal network using the IP address of the proxy server, not the address of the original requester. When the proxy server receives the response, it forwards the response to the original requester.

With caching enabled, the proxy server can act as a high-speed local store of previously accessed Web pages. When you configure the server as a proxy caching server, you can improve performance. You can also allow users of your internal network to access documents on the Internet. For example, if you frequently access the same set of Web pages from one or more sites, it may be advantageous to activate the caching feature. The retrieved Web page is stored locally on your iSeries server. Any subsequent accesses to the page occur at LAN speed, rather than at Internet speed.

Web pages can be encoded with a “no-cache” attribute or a specific expiration date. You can also configure the IBM HTTP Server for iSeries proxy service so that it periodically performs “garbage collection” to remove expired files from the cache.

Another use of the proxy service (with or without caching) is to log client requests. Some of the data available includes:

򐂰 Client IP address

򐂰 Date and time

򐂰 URL requested Both original and Apache Both original and Apache Only in Apache Both original and Apache

(22)

򐂰 Byte count

򐂰 Success code

With this information, you can construct reports to account for the use of your Web site. For example, the information can be used in a charge-back system to understand and track marketing trends.

See 5.6, “Proxy server: Protecting direct access” on page 98, for security related information on proxy support, and Chapter 8, “Getting the best performance from HTTP Server (powered by Apache)” on page 161, for performance-oriented information on caching.

1.1.7 Local memory cache

A proxy cache is traditionally most beneficial to clients on your network since it lets you store files that were retrieved from other Web sites. You can provide a caching service for files on your site using the local memory cache configuration options.

To use a local memory cache, you identify an amount of memory to allocate and a set of files to be cached. When the IBM HTTP Server for iSeries is started, the files are read into the local memory cache up to the limit of the amount of memory allocated or the limit of the number of files that you allow to be cached.

When a request is received at your IBM HTTP Server for iSeries, the local memory cache is checked first to determine if it has a copy of the requested file. If so, the file is served from the cache, which is significantly faster than if the file is retrieved from disk storage.

See “Local cache” on page 173 for more information.

1.1.8 Server-side includes

Server-side includes (SSI) enable the server to process some of the Web pages before the server sends the page to the client. The current date, size of the file, and the last change date of a file are examples of the kind of information that you can include in Web pages that you send to the client.

See 6.1, “Server-side includes (SSI)” on page 104, for more information.

1.1.9 CGI programming

Corporations and other customers benefit from interacting with browser users by sending and receiving data. In the Web presence arena, this type of transaction is simple, such as collecting the name and address of a browser user who wants to receive a catalog. In general, these interactions start with a form – a Web page that contains input-capable fields and push buttons (like function keys). The server needs to hand the input from the form to a program for processing.

Both original and Apache

Tip: There is very little difference between the HTTP Server (original) and HTTP Server

(powered by Apache) implementation of SSI. The reason? The Apache Software Foundation initially designed the syntax for SSI that IBM later used in its HTTP Server (original).

Both original and Apache

Both original and Apache

(23)

Chapter 1. ‘Powered by Apache’ means OS/400 integration 9

Typically, on the iSeries server (and most other platforms), this program is a CGI program. The CGI program receives the form data from the browser, accesses business data and business logic on the iSeries server, updates or stores information (if required by the

transaction), and then builds the Web page that the HTTP server returns to the browser user in response.

CGI programs written for the HTTP Server (original) function the same way for the HTTP Server (powered by Apache).

See 6.3, “Everything dynamic with CGI support” on page 109, for more information.

1.1.10 LDAP support

The HTTP Server uses Lightweight Directory Access Protocol (LDAP) to store configuration information and user authentication information. LDAP integration allows you to use directory services for server configuration and authentication.

1.1.11 Webserver Search Engine

The HTTP Server search engine allows you to perform full text searches on HTML and text files stored in the iSeries file system from any Web browser. The iSeries Webserver Search Engine is available at no charge with IBM HTTP Server for iSeries (5769-DG1 or 5722-DG1) starting at OS/400 V4R4. You can control what options are available to the user and how the search results are displayed through customizable Net.Data macros.

Some of the features of the Webserver Search Engine include:

򐂰 Indexes documents for fast searching:

The iSeries Webserver Search Engine indexes HTML or text files into a format that allows a large number of documents to be searched quickly. Multiple indexes can be created, and documents from multiple directories can be placed in a single index.

򐂰 Exact word indexing:

The Webserver Search Engine uses an exact word indexing scheme rather than a keyword indexing scheme used by many search engines. All words are indexed; nothing is left out. Exact word indexing provides for faster index building and more precise searching than keyword indexing, but requires additional disk space. Documents are searched using consecutive character matching, which is essential for proper support of double-byte languages.

򐂰 Advanced search functions:

The iSeries Webserver Search Engine supports advanced search capabilities such as exact search, fuzzy search, wild card search, proximity search, English word stemming, case-sensitive search, boolean search, and document ranking.

򐂰 Customizable search forms:

The search forms and search results form are completely customizable by the end user using the Net.Data scripting language. This gives the user the ability to specify the type of search to be done and how the results are to be displayed. The information that can optionally be displayed on the results page includes the number of documents satisfying the search, number of occurrences of the search term, number of documents returned on this page, the URL associated with each document, the document's ranking, and the last modified date and size. Any and all of this information can be displayed however the user chooses.

Both original and Apache

Both original and Apache

(24)

򐂰 Web-based administration:

Administration of the search indexes is handled as part of the IBM HTTP Server

Configuration and Administration Web pages. The search administration forms allow you to create and delete search indexes, update search indexes when documents are modified, and view the status of an index.

򐂰 Multiple language support:

The Webserver Search Engine supports multiple national languages including double-byte languages Chinese, Japanese, and Korean.

On the iSeries, the search engine comes in two logical pieces that are related to each other. You can read more about them in 9.1, “iSeries Webserver Search Engine” on page 184, and 9.2, “iSeries Webserver Search Engine Web Crawler” on page 184.

1.1.12 Web-based Distributed Authoring and Versioning (WebDAV)

WebDAV provides a network protocol for creating interoperable, collaborative applications. Major features of the protocol include:

򐂰 Locking (concurrency control):

Long-duration exclusive and shared write locks prevent the problem of overwriting, where two or more collaborators write to the same resource without first merging changes. To achieve robust Internet-scale collaboration, where network connections may be

disconnected arbitrarily, and for scalability, since each open connection consumes server resources, the duration of DAV locks is independent of any individual network connection.

򐂰 Properties:

XML properties provide storage for arbitrary metadata, such as a list of authors on Web resources. These properties can be efficiently set, deleted, and retrieved using the DAV protocol. The DAV Searching and Locating (DASL) protocol provides searches based on property values to locate Web resources.

򐂰 Namespace manipulation:

Since resources may need to be copied or moved as a Web site evolves, DAV supports copy and move operations. Collections, similar to file system directories, may be created and listed.

For more information about WebDAV, refer to: http://www.webdav.org/

1.1.13 Access log reporting and Web usage mining

The HTTP Server (original) provides the log reporting and Web usage mining function. If you are using HTTP Server (powered by Apache), you can obtain the IBM WebSphere Site Analyzer to provide a similar function.

1.1.14 Platform for Internet Content Selection (PICS)

PICS support enables labels (metadata) to be associated with Internet content. Originally designed to help parents and teachers control what children access on the Internet, it also facilitates other uses for labels, including code signing and privacy.

Both original and Apache

Only in original

Tip: PICS never found wide spread support in the industry. This is why you will not find this

support on the HTTP Server (powered by Apache) and other Apache servers.

(25)

Chapter 1. ‘Powered by Apache’ means OS/400 integration 11

1.1.15 Domino plug-in

The Domino plug-in allows the HTTP server to access documents stored in Notes. See

Domino and WebSphere Integration on the IBM

~

iSeries Server, SG24-6223, for details in regards to the HTTP Server (original) only.

1.1.16 WebSphere Application Server plug-in

The IBM HTTP Server for iSeries handles static content, CGI program invocations, and proprietary plug-ins. The run-time environment (WebSphere Application Server) plugs into IBM HTTP Server for iSeries using plug-in APIs. This extends the support of the HTTP Server to include an implementation of the Java 2 Platform Enterprise Edition (J2EE) specification from SUN Microsystems. See 7.1, “Web application servers for iSeries” on page 115, for details.

1.1.17 Apache Software Foundation’s Jakarta Tomcat

The HTTP Server (powered by Apache) includes an industry-standard Java servlet and JavaServer Pages (JSP) engine based on technology from the Apache Software

Foundation's Jakarta Tomcat open source code base. Lightweight and easy-to-use software extends the HTTP Server (powered by Apache) server and is compliant with the Java Servlet 2.2 and JavaServer Pages 1.1 specifications from SUN Microsystems.

Apache Software Foundation's Jakarta Tomcat for iSeries support can be used as a simple starting point for business partners and customers interested in learning about or piloting Java servlet and JSP applications.

For more information, refer to 7.2, “Apache Software Foundation's Jakarta Tomcat on iSeries” on page 121, and the iSeries HTTP server Web page at:

http://www.ibm.com/eserver/iseries/software/http

1.1.18 Original Server API

HTTP Server (original) APIs are not supported on HTTP Server (powered by Apache). The strategic direction of IBM is to extend the function of the Web server using Java servlets rather than with modules or server APIs. This function can only be used in HTTP Server (original).

1.1.19 Apache Portable Runtime (APR)

The design of the Apache HTTP server is one that defines

modules

. Modules are operating system objects that can be dynamically linked and loaded to extend the nature of the Apache HTTP server. Depending on the operating system, this is similar to:

򐂰 Window's Dynamic Link Libraries (DLL)

򐂰 UNIX's shared object libraries

򐂰 OS/400's ILE Service Programs

In this way, the Apache modules provide a way to extend a server's function. Functions commonly added by optional modules include:

Tip: Any announcements of future Domino for iSeries and HTTP Server (powered by

Apache) integration will be made at:

http://www.ibm.com/servers/eserver/iseries/domino/ Only in original Both original and Apache Only in Apache Only in original Only in Apache

(26)

򐂰 Authentication

򐂰 Encryption

򐂰 Application support

򐂰 Logging

򐂰 Support for different content types

򐂰 Diagnostics

You can extend the core functionality of the HTTP Server (powered by Apache) by writing your own modules or porting other modules to the iSeries as demonstrated in Chapter 10, “Apache Portable Runtime (APR): Extending your core functionality” on page 187.

1.1.20 Support for the TRCTCPAPP command

The Trace TCP/IP Application (TRCTCPAPP) command can be used to trace the server, but only one instance at a time. It can be started while the server is running.

In addition to these functions, the following functions are provided only in HTTP Server (powered by Apache):

򐂰

Headers control

: Has the ability to control headers. It has the ability to control expires and other headers.

򐂰

SSL

: This is more specific customization of SSL

򐂰

CGI

:

– Controls the number of CGI jobs started with the server and their user profile – OS/400 PASE CGI programs (UNIX binaries)

򐂰 More customization of directory listings

򐂰 Automatic restart of multi-threaded child job monitored by parent job

򐂰 Configuration file support in threadsafe IFS file systems (not just QSYS.LIB) See 11.2.5, “HTTP server trace” on page 210, for more information on how to use TRCTCPAPP.

1.1.21 Triggered Cache Manager (TCM)

Triggered Cache Manager provides a mechanism to manage dynamically-generated Web pages. TCM is a separate server that can be used in conjunction with the HTTP Server to allow a Web designer to build dynamic pages. It only updates the cache when the underlying data changes, thereby improving the performance of a Web site.

See 8.2.3, “Triggered Cache Manager” on page 177, for more information.

Note: The old -vv (very verbose) still works at startup much like the original server (and -vi

and -ve, which stand for informational and error tracing, respectively). The Dump User Trace (DMPUSRTRC) and Display Physical File Member (DSPPFM) commands can be used to see the results, but TRCTCPAPP is the suggested trace method.

Only in Apache

Both original and Apache

(27)

Chapter 1. ‘Powered by Apache’ means OS/400 integration 13

1.1.22 Highly available HTTP server

If Web serving is a critical aspect of your business, you may want high availability for your Web server environment. A highly available Web server takes advantage of iSeries clustering technology and makes it possible to build a highly available Web site. This improves the availability of business-critical Web applications built with Common Gateway Interface (CGI) programs.

See Chapter 12, “High availability” on page 217, for more information.

1.2 References

For more information, refer to the IBM HTTP Server for iSeries Web site at (which contains many components including the HTTP Server (original) and the HTTP Server (powered by Apache)): http://www.ibm.com/servers/eserver/iseries/software/http/

Both original and Apache

(28)
(29)

© Copyright IBM Corp. 2002 15

Chapter 2.

From zero to powered by Apache

This chapter shows you how to install the HTTP Server (powered by Apache) and get a basic HTTP server configuration up and running on your iSeries server. All the examples used in this IBM Redbook are based on this configuration.

Certain portions of this chapter are optional and they are identified as so. The amount of time it takes you to get to your first HTTP Server (powered by Apache) depends on where you are starting from and the options you choose along the way.

(30)

2.1 Before you start

This section can help you identify software components, upgrades, user profile authorities and Web browser requirements you will need to fully exploit the examples used in this IBM Redbook. Carefully reviewing this section now will save you time later.

2.1.1 Software

Maybe the most time consuming aspect of starting any new enterprise on any computer system today is getting all the software and the fixes for that software that you will need to install and run without any trouble. This section helps you identify, ahead of time, exactly what you need to get your first HTTP Server (powered by Apache) up and running.

Products and options to OS/400

Review Table 2-1 for the mandatory and optional software used by your HTTP Server (powered by Apache). To keep this as simple as possible, we must assume that you are using OS/400 Version 5 Release 1 (5722-SS1). Where possible, we have noted the exceptions (minor) to the steps involved for those of you working with OS/400 Version 4 Release 5 (5769-SS1).

Table 2-1 Mandatory and optional software for your HTTP Server (powered by Apache)

Note: Most of the software Licence Program Products (LPP) and OS/400 options

mentioned in Table 2-1 are already available on the shipped media and are no cost with your purchase of OS/400.

Name of product or option Product or option number Comment These LPPs and OS/400 options are mandatory:

IBM HTTP Server for iSeries 5722-DG1 The LPP is IBM HTTP Server

for iSeries, which contains the component HTTP Server (powered by Apache). See Table 2-2 for a list of other components found in 5722-DG1.

TCP/IP Connectivity Utilities 5722-TC1 Very useful collection of TCP/IP

applications including Telnet, FTP, and others.

Java Developer Kit 1.2 5722-JV1 *Base and Option 3 Your HTTP Server (powered by

Apache) requires this LPP.

These LPPs and OS/400 options are recommended (but optional):

WebSphere Development ToolSet

5722-WDS and Option 51: Compiler - ILE C

Needed if you will be doing any application development in ILE languages. Chapter 10, “Apache Portable Runtime (APR): Extending your core functionality” on page 187, has a source example written in C.

Triggered Cache Manager Option 1 of 5722-DG1 Needed only if you will be

working with 8.2.3, “Triggered Cache Manager” on page 177.

(31)

Chapter 2. From zero to powered by Apache 17

These LPPs and OS/400 options are optional and only needed if you plan to work with digital certificates and Secure Sockets Layer (SSL) and Transport Layer Security (TLS):

Digital Certificate Manager (DCM)

Option 34 of OS/400 Optional: To support the

handling of digital certificates used by SSL/TLS for secure Web serving

Cryptographic Access Provider 5722-AC2 or 5722-AC3 If you want to use SSL or TLS,

you must install one of the IBM Cryptographic Access Provider products.

The availability of these products is subject to USA export regulations. You can order them as a separate no-charge LPP.

These LPPs and OS/400 options are optional and only needed if you plan to work with Java servlet and JSP programming with either Apache Software Foundation’s Jakarta Tomcat or WebSphere Application Server:

WebSphere Application Server, Standard Edition or

WebSphere Application Server, Advanced Edition

5733-AS3 or

5733-WA3, respectively

The Standard Edition with its support of servlets and JSPs at Version 3.5 is all you really need to compare and contrast with the Apache Software Foundation’s Jakarta Tomcat. The Advanced Edition is more than you need (for the

examples in this IBM Redbook) but will work fine.

ASF’s Jakarta Tomcat is a component of 5722-DG1 (see Table 2-2).

Toolbox for Java 5722-JC1 If you will be programming in

Java, this is recommended.

Java Developer Kit 5722-JV1 Options Your HTTP Server (powered by

Apache) requires this LPP *Base and Option 3 (Java Developer Kit (JDK) 1.2). If you will be programming in Java, you might need some other options for other levels of the JDK.

Qshell Interpreter Option 30 OS/400 Useful for working with

WebSphere Application Server.

(32)

Further, LPP IBM HTTP Server for iSeries (5722-DG1) contains the components shown in Table 2-2.

Table 2-2 Additional components available in LPP 5722-DG1

Group PTFs

Since the HTTP Server (powered by Apache) is so new and ever-changing, it is mandatory that you install the latest and greatest fixes for IBM HTTP Server for iSeries (5722-DG1) and other related products. Table 2-3 shows the products and PTFs that you must install on your iSeries server.

For the latest information about PTFs for the HTTP Server (powered by Apache), see http://www.ibm.com/servers/eserver/iseries/software/http/ and click PTFs.

Table 2-3 Group PTF information for key iSeries products

Name of component Option number Comment

HTTP Server (original) *base

HTTP Server (powered by Apache)

*base In V4R5 as group PTF

SF99035

Net.Data *base

AS/400 Webserver Search Engine

*base

Apache Software Foundation’s Jakarta Tomcat

*base A Java servlet and JSP

application server

Highly Available HTTP Server *base A V5R1 enhancement only

Triggered Cache Manager Option 1 of 5722-DG1

Product PTF description Comments

IBM HTTP Server for iSeries (5722-DG1) (V5R1)

Group PTF SF99156 The current version of this V5R1 group PTF can be displayed on the iSeries by running the command:

DSPDTAARA QHTTPSVR/SF99156

The latest should show:

Group PTF#: SF99156-08 V5R1M0 February 28, 2002

IBM HTTP Server for iSeries (5769-DG1) (V4R5)

Group PTF SF99035 The current version of this V4R5 group PTF can be displayed on the iSeries by running the command:

DSPDTAARA QHTTPSVR/SF99035

The latest should show:

Group PTF#: SF99035-10 V4R5M0 February 28, 2002

Tip: Group PTFs are updated periodically with the latest PTFs. The group PTF number

does not change. During an update, any additional PTFs that impact the HTTP Server (powered by Apache) are added to the group PTF.

(33)

Chapter 2. From zero to powered by Apache 19

2.1.2 User profile authorities

To use the graphical user interface for configuration and administration, a valid iSeries user profile and password are required. You must have the following authorities to perform configuration and administration tasks:

򐂰 Your user profile must have *IOSYSCFG authority.

򐂰 Your user profile must have *CHANGE authority to the library object QUSRSYS. The following file objects require *ALL authority:

򐂰 QUSRSYS/QATMHINSTA

򐂰 QUSRSYS/QATMHINSTC

The following command objects require *USE authority:

򐂰 CRTVLDL

򐂰 STRTCPSVR

򐂰 ENDTCPSVR

QTMHHTTP is the default user profile of the HTTP Server. QTMHHTP1 is the default profile that the HTTP Server uses when running CGI programs. The HTTP Server profile must have *RWX authority to the directory path where the HTTP Server (powered by Apache)

configuration files are stored. The default path is /www/servername/, where servername is the name of the HTTP server instance.

The HTTP Server profile must have access to the directory path where the log files are stored. The security of the log files should be fully considered. The path of the log files should only be accessible by the appropriate user profiles.

2.1.3 Web browser

The HTTP Server (powered by Apache) is configured using a client Web browser. To use the Configuration and Administration forms, you need a Web browser that supports:

򐂰 HTTP 1.0 or 1.1 protocol

򐂰 Frames

򐂰 Java Script

Such browsers as Microsoft’s Internet Explorer 5.5 or later and Netscape Navigator 4.75 will work with the Configuration and Administration forms.

To view the log reports generated by the HTTP Server, you must use a browser that supports JVM 1.1.5 or later.

Tip: Do not use QSECOFR since this user profile will not work with the HTTP server’s

Configuration and the Administration forms. You can, however, use a user profile that has a user class of *SECOFR.

Tip: Due to some cookie caching problems, we advise that you use Microsoft’s Internet

Explorer.

Did you know that the *ADMIN GUI for both the original and powered by Apache configuration is served from an HTTP Server (powered by Apache)?

(34)

2.2 Software installation

The installation of software on the iSeries can be split into two pieces. First, install or make sure you have the LPPs and OS/400 options installed that you require. Then, update those products with the latest PTFs available.

An optional third step can be done now or later depending on how closely you want to follow the how-to steps demonstrated in this IBM Redbook. This optional step in 2.2.3, “Installing the ITSO example Web application (optional)” on page 21, has you download a simple Web application from an ITSO site on the Internet and install it on your iSeries server.

2.2.1 Installing LPPs and OS/400 options

Follow these steps to install the different LPPs and OS/400 options that you have determined that you want to use after reviewing Table 2-1 on page 16:

1. Insert the installation media into your iSeries server. 2. At the OS/400 command line, type:

GO LICPGM

Press Enter.

3. Select option 11 (Install licensed programs) on the Work with Licensed Programs display to see a list of licensed programs that can be installed on your iSeries server.

4. Select and install desired LPPs and OS/400 options.

5. To verify your installation, select option 10 on the Work with Licensed Programs (GO LICPGM) menu. Make sure that the installation status for the options you installed is *COMPATIBLE for DG1 and either *COMPATIBLE or *INSTALLED for your other products. 6. Although this is not really part of the installation process, make sure that the system value

Shared memory control (QSHRMEMCTL) value is set to 1 (Allowed). To display (and change, if necessary) the current system value setting on your iSeries server, use the Work with System Values (WRKSYSVAL) command:

WRKSYSVAL SYSVAL(QSHRMEMCTL)

2.2.2 Installing PTFs

To ensure a smooth test of the HTTP Server (powered by Apache) and to guarantee that you have all the functions available you must load the latest and greatest PTFs.

Table 2-3 on page 18 identifies the key group PTFs that you will need to order and install on your iSeries server.

Tip: See the Software Installation Guide at the iSeries Information Center at

http://www.ibm.com/iseries/infocenter for help with licensed program installation.

Tip: See the Software Installation Guide at the iSeries Information Center at

http://www.ibm.com/iseries/infocenter for help with receiving and installing PTFs on your iSeries server.

(35)

Chapter 2. From zero to powered by Apache 21

2.2.3 Installing the ITSO example Web application (optional)

To establish a quick, simply and ready to use Web site for this IBM Redbook, we used the NetObjects’ Fusion 5.0. NetObjects’ Web site at: http://www.netobjects.com/

Our goal was to have Web site that had multiple layers of IFS hierarchy that could then be configured in many different ways showing you the powerful Apache directives at work. If you want to closely follow the how-to steps demonstrated in this IBM Redbook, follow the directions found in Appendix B, “Additional material” on page 235.

2.3 Testing the HTTP Server (powered by Apache) installation

Now that you have made sure you have all the components and fixes to those components that you need to work with the HTTP Server (powered by Apache), you should test them by creating and starting your first server.

2.3.1 Starting the APACHEDFT instance

One very good and quick way to see if your iSeries server has all the pieces to run an HTTP Server (powered by Apache) is to start the APACHEDFT server that comes with the

installation of IBM HTTP Server for iSeries (5722-DG1).

To test your installation, follow these steps: 1. Verify that the iSeries TCP/IP is started.

2. Verify that the host name and the domain name for your iSeries server are specified

and

match an entry in the local host table. To do this, follow these steps:

a. Use Configure TCP/IP (CFGTCP) option 12 (Change TCP/IP domain information) to determine your iSeries server’s host name and domain as shown in Figure 2-1.

Figure 2-1 CFGTCP option 12 showing your iSeries host name and domain name

Tip: The Order Entry application used in Chapter 7, “Web application serving” on

page 113, is one that we used in a variety of ITSO Redbooks. As a common tool, your best place to download this application and all the supporting documentation would be from

Building iSeries Applications for WebSphere Advanced Edition 3.5, SG24-5691. Refer to Appendix B, “Additional material” on page 235, for detailed instructions.

Tip: Do not use (for example, by copy and paste) the configuration directives found in the

APACHEDFT server for your own server. The reason is that the Port directive used within has been deprecated. The directive Listen should be used instead.

The best way to create a new Web server configuration is via the wizard. See 2.3.2, “Your first HTTP Server (powered by Apache) via a wizard” on page 23.

Change TCP/IP Domain (CHGTCPDMN) Type choices, press Enter. Host name . . . 'AS20' Domain name . . . 'ITSOROCH.IBM.COM'

(36)

b. Use Configure TCP/IP (CFGTCP) option 10 (Work with TCP/IP host table entries), and if necessary, add an entry to map your host name and domain to an IP address. You should have an entry that looks something like the example in Figure 2-2.

Figure 2-2 CFGTCP option 10 to add (if necessary) a host table entry for your iSeries server

It is just as easy to use Operations Navigator to do the same thing. Simply expand

Network. Then right-click TCP/IP Configuration and select Properties. Use the Host Domain Information and Host Table tabs, respectively.

3. Verify that you will not have any IP address and port conflicts with other HTTP Server (original) and HTTP Server (powered by Apache) Web servers. This is important since the APACHEDFT server is configured to bind to all IP addresses and TCP/IP port 80, which is the default port for Web applications.

Use the Work with Active Jobs (WRKACTJOB) command to identify other Web servers that are up and running that might cause a conflict with the APACHEDFT server. If a conflict exists, you can do one of the following tasks:

– End the other server (be careful!).

– Edit the APACHEDFT configuration to use a specific IP address or unique TCP/IP port. – Skip this step and go directly to 2.3.2, “Your first HTTP Server (powered by Apache) via

a wizard” on page 23, during which you can specify a unique TCP/IP port. 4. Start the APACHEDFT server instance.

Using Operations Navigator expand Network-> Servers-> TCP/IP and right-click HTTP

Administration. Then click Start Instance-> APACHEDFT.

Or, from the iSeries command line, enter the following command:

STRTCPSVR SERVER(*HTTP) HTTPSVR(APACHEDFT)

This starts the APACHEDFT server instance listening on all active IP interfaces on TCP/IP port 80. Starting this server instance only allows read access to files located in the directory /www/apachedft/htdocs (and all sub-directories).

5. Open your Web browser and enter:

http://your.server.name/

Here your.server.name is the name or the IP address of your iSeries server.

Work with TCP/IP Host Table Entries Type options, press Enter. 1=Add 2=Change 4=Remove 5=Display 7=Rename Internet Host Opt Address Name 10.5.92.14 AS20

(37)

Chapter 2. From zero to powered by Apache 23

If everything is correctly setup and configured, you should see the default welcome page (physically located in the iSeries IFS at /www/apachedft/htdocs/inde x.html) as shown in

Figure 2-3.

If you experience problems, see Chapter 11, “Problem determination: When things do not go as planned” on page 199.

This is not as satisfying as creating your own HTTP Server (powered by Apache) instance using the new GUI and wizard. That is covered in the next section.

2.3.2 Your first HTTP Server (powered by Apache) via a wizard

The HTTP Server (powered by Apache) and the HTTP Server (original) both come complete with a Graphical User Interface (GUI) that is uniquely iSeries. At V4R5 and V5R1, the HTTP Server (original) GUI has not changed. A new GUI has been created to help you configure your HTTP Server (powered by Apache) in a logical manner rather than having to hand edit lengthy configuration files.

Create

We use this new GUI and a Create HTTP Server wizard to quickly create your first brand new HTTP Server (powered by Apache):

1. Start the HTTP Administration server (*ADMIN). Using Operations Navigator, expand

Network-> Servers-> TCP/IP and right-click HTTP Administration. Then click Start.

Or, from the iSeries command line, enter:

STRTCPSVR SERVER(*HTTP) HTTPSVR(*ADMIN)

2. Verify that the *ADMIN server is up and running. Using Operations Navigator, expand

Network-> Servers-> TCP/IP. On the right, the HTTP Administration server should have a

status of

Started

.

Or, from the iSeries command line, enter:

WRKACTJOB SBS(QHTTPSVR)

As soon as both ADMIN jobs have reached the SIGW status as shown in Figure 2-4, you are ready to go. Note that the startup time may take a minute.

(38)

Figure 2-4 WRKACTJOB SBS(QHTTPSVR) showing the ADMIN server ready and waiting for work

3. Open a Web browser and enter:

http://your.server.name:2001

Here your.server.name is the name or the IP address of your iSeries server. 4. Enter your User ID and password as shown in Figure 2-5.

Figure 2-5 Entering the OS/400 user ID and password when prompted

You are greeted by the AS/400 Tasks page (Figure 2-6).

Work with Active Jobs AS20 01/09/02 15:32:53 CPU %: .8 Elapsed time: 01:08:50 Active jobs: 190 Type options, press Enter. 2=Change 3=Hold 4=End 5=Work with 6=Release 7=Display message 8=Work with spooled files 13=Disconnect ... Opt Subsystem/Job User Type CPU % Function Status QHTTPSVR QSYS SBS .0 DEQW ADMIN QTMHHTTP BCH .0 PGM-QZHBHTTP SIGW ADMIN QTMHHTTP BCI .3 PGM-QZSRHTTP SIGW

Bottom Parameters or command ===> F3=Exit F5=Refresh F7=Find F10=Restart statistics F11=Display elapsed data F12=Cancel F23=More options F24=More keys

(39)

Chapter 2. From zero to powered by Apache 25

Figure 2-6 AS/400 Tasks page for your iSeries

5. On the AS/400 Tasks page, click IBM HTTP Server for AS/400-> Configuration and

Administration. You see the new tabbed-based GUI home page (Figure 2-7) for both the

HTTP Server (original) and your HTTP Server (powered by Apache).

(40)

6. Start the Create HTTP Server wizard by clicking Create HTTP Server.

You see the first welcome page for the Create HTTP Server wizard (Figure 2-8).

Figure 2-8 Welcome to the Create HTTP Server wizard

Wizards are a nice tool that just about guarantee that if you have answered all the questions correctly, the resulting configuration will work. The only problem with a wizard is that sometimes, right in the middle, they ask you a question that you do not know the answer to. Table 2-4 can help with that. It contains the questions and our ITSO Rochester answers for the Create HTTP Server wizard. You can also write down your own answers if your first HTTP Server (powered by Apache) will be different than ours.

Table 2-4 Questions asked by the Create HTTP Server wizard and ITSO Rochester answers

Create HTTP Server wizard question Answer

HTTP server type? HTTP server (original or powered by Apache)

HTTP Server (powered by Apache)

HTTP server name ITSO01

Migrate Original server configuration? (Yes/No) No

Server root. This is the base directory for your HTTP server. Within this directory, the wizard creates sub-directories for your logs and configuration information.

Default: /www/webserver

/ITSO/ITSO01

Document root. This is the directory from which your documents will be served by your HTTP server. Default: /www/webserver/htdocs

/ITSO/ITSO01/ITSOco

Listen on IP address and Port. Default: All IP addresses and Port 80.

All IP addresses

Port 8075 (or something unique for testing) 8001

(41)

Chapter 2. From zero to powered by Apache 27

7. Looking back to Figure 2-8, make sure HTTP Server (powered by Apache) is selected for the HTTP server type. Click Next.

8. The Create HTTP Server wizard asks a series of questions as shown in Table 2-4. Answer each question and click Next to move onto the next question.

In the end, you should be presented with a confirmation screen that looks something like the example in Figure 2-9. Verify all your choices. If you need to fix something, click Back. Otherwise, click Finish to create your HTTP Server (powered by Apache).

Figure 2-9 Confirmation display for Create HTTP Server wizard

After you click Finish (Figure 2-9), a congratulatory display (Figure 2-10) appears that gives you two choices to either add some additional configuration directives or to manage (start, stop, and so on) your server. Note also the URL that you can copy and paste as the URL for your Web browser.

Figure 2-10 Congratulations, an Apache type HTTP server named ITSO01 has been created

Start

Now that you have created your HTTP Server (powered by Apache), it is time to start it. Follow these steps:

1. Click Manage as shown in Figure 2-10.

Make sure your new server is selected in the list as shown in Figure 2-11.

Note: This brings up a list of all your HTTP servers on this iSeries including HTTP

Server (original). You can also get to this list of HTTP servers by clicking

(42)

Figure 2-11 Managing a list of HTTP Server (powered by Apache) and HTTP Server (original) servers

2. Click Start.

As shown in Figure 2-12, you see the message at the bottom of the GUI indicating that your server is starting. Please note the change in the server status. Alternatively, the server can be started from a command line by entering:

STRTCPSVR SERVER(*HTTP) HTTPSVR(ITSO01)

You can use the following command to verify that your ITSO01 server is up and running:

WRKACTJOB SBS(QHTTPSVR)

Figure 2-12 Your HTTP server ITSO01 is starting

Test

The final step is to simply test. Open your Web browser and enter:

http://your.server.name:port

Here your.server.name is the name or the IP address of your iSeries server, and port is the TCP/IP port where your HTTP server is listening on. In our example, we would use the URL:

http://as20:8001

Tip: Clicking the Refresh key a few times might be a good habit to ensure the server

stays

started. This is similar to the nervous habit of old S/38, AS/400, AS/400e, and iSeries administrators repeatedly pressing PF5 (or refresh) on a 5250 green screen. Sometimes due to TCP/IP port conflicts or errors in the configuration file, the server will terminate immediately. If this is the case, see Chapter 11, “Problem determination: When things do not go as planned” on page 199.

(43)

Chapter 2. From zero to powered by Apache 29

If you follow the steps in 2.2.3, “Installing the ITSO example Web application (optional)” on page 21, you should see the default welcome page (physically located in the iSeries IFS at /itso/itso01/itsoco/index.html) of the ITSOco Web application as shown in Figure 2-13.

Figure 2-13 ITSOco home page

Or if you did not already have an index.html file located in the iSeries IFS at

/itso/itso01/itsoco/index.html, the Create HTTP Server wizard will create one for you. In this case, your welcome page appears as shown in Figure 2-14.

Figure 2-14 Default index.html created for you automatically by the Create HTTP Server wizard

(44)

References

Related documents

If you’re installing a web server adapter for Apache HTTP Server, SunONE, or SJSWS, the ServletExec/AS installer will prompt you to update the server configuration file.. The

Web application LDAP to auth ⇒ ⇑ pass control user's browser → HTTP Server Apache identity management server.. Web

This may be interesting if you want to save the access log with a local format and send it to Logtrust with another.. 2.3 Sending events to Logtrust

HTTP (port 80) from I-Server Web server to the Internet HTTP (port 80) from Delphi client to I-Server Web server SQL (port 1433) from I-Server Web server to I-Server Web server

When InvEng is compared to the accents of the Lowlands they seem to have many features in common; the increase in T- Glottaling, the Wine-whine merger, and FACE diphthongisation

curate transfer prices, or vertical integration would lead to a finding that a unitary business might exist and would lead to the third level in- vestigation into substantiality.

After you install CA Workload Automation DE Web Client, you can optionally configure it to work with Apache HTTP Server on Windows.. You require Apache HTTP Server to

Install Appeon Server Web Component to the Web root of the Apache HTTP Server, for example, $APACHE/htdocs/, by following the instructions in the Appeon