Deciphering how to configure a Web server to meet your needs can seem like a daunting task. And, when faced with a new HTTP server that provides a rich set of highly configurable features, knowing where to start can be quite a challenge. To make that challenge more manageable, IBM’s latest incarnation of the HTTP Server (powered by Apache) for iSeries simplifies the approach to Web server configuration. A new wizard guides you through the common steps for configuring a new Web server in an understandable and repeatable manner! Let me take you on a guided tour that shows you how to create, configure, and use your first Apache server.
The HTTP Server (powered by Apache) requires special software and authorities. In OS/400 Version 4 Release 5, the HTTP Server (product ID 5769-DG1) must be installed on your system. You must also order a new group PTF and make sure the Java Virtual Machine (JVM) 1.2 and the Java Developer Kit (JDK) are installed on the system. The IBM HTTP Server Documentation Center (www.iseries.ibm.com/products/http/docs/v4r5) provides you with all the information you need to get started. In the documentation center, click on the HTTP Server (powered by Apache) section to view the set of articles specifically for Apache. Read and follow the instructions in these articles: “Installing the server,” “Testing the installation,” and “Configuring a new server.” The “Configuring a new server” article will tell you to start two administration servers. In V4R5, the Web pages for configuring Apache require a second administration server called ADMINA. The article concludes by guiding you to the administration Web page, where new Apache servers can be created (see Figure 1). This is where our journey will begin.
Configuring Your First Apache Server
If you have experience creating original HTTP servers, you’ll find creating Apache servers much easier. To begin, click on Create HTTP Servers to start a wizard that will walk you through a series of Web pages. Each page in the series will provide brief information and will ask you to answer a question. The objective of the wizard is to prompt you for the necessary information required to easily get a basic Apache server configured with common server functions. Your path through the wizard will vary depending on how you answer the questions. The questions are straightforward, but I’ll walk you through them while you
create your first Apache server. (Note: Click Next to advance to the next question. No server is created until you arrive at the last question and click Finish. Until then, you can use the Back button to go back to previous questions and answer them differently, if desired.)
1. The first Web page asks which type of HTTP server you want to create. Although the recommended type is Apache, you can use the wizard to create original servers as well. Select HTTP Server (powered by Apache).
2. You are asked for the name you would like to give your HTTP server. Choose a name that uniquely identifies the server and that reflects what the server will be used for. In the future, you will use the name to identify the server you want to configure. Customers of your Web site will not know or use this name. For this example, type TRYAPACHE as the name for your Apache server.
3. The next question asks whether you want your new Apache server configured just like an existing server. This is a handy feature of the wizard, because it can save you time if you require more than one server configured in a similar way (such as a test versus production server). If you answer No, the remaining questions will step you through the basic configuration setup. If you answer Yes, you have the chance to migrate the configuration of an existing original HTTP server and have that equivalent configuration used by the new Apache server. Converting or migrating original HTTP server configurations to Apache is an advanced task that requires its own separate discussion. Answer No to continue.
4. You will need to specify a parent directory where you want your server’s configuration and logging information stored. This is referred to as your server root. A default of /www/tryapache is displayed for your consideration. Use the default directory shown.
5. A document root needs to be specified next. The document root is the directory that contains or will contain the documents or Web pages to be served by your Apache server. A default directory of /www/tryapache/htdocs is provided. Use the default directory shown and continue to the next page.
6. The HTTP server must be told which of the IP addresses on the iSeries system to look for HTTP requests on. For this server, pick all IP addresses. A unique port number must be used by each server application that runs concurrently on the system. The port tells the system which server application handles the requests coming in on that port. If you don’t already have an HTTP server running on port 80, use 80, which is the preselected default. Otherwise, pick a unique port that is not being used on your system. To see the ports currently in use on your system, enter the command NETSTAT OPTION(*CNN) and press F14 to display the port numbers. Browse the numbers in the Local Port column to verify that the number you want to use is not already taken.
7. Most Web sites keep an audit trail of what their HTTP server is doing. Configuring your Apache server to log every request made to the server allows you to know which Web pages are being accessed via your server and which users are accessing those pages. To answer the question on the Web page, select Combined log file, which will enable both access and error logging.
8. After clicking Next, you will be presented with a summary of the initial configuration for your Apache server (see Figure 2). At this point, you must click the Finish button in order to actually create the Apache server. That’s all there is to creating and configuring your first Apache server.
Starting Your Apache Server
You are now ready to use your new Apache server! The final information shown by the wizard directs you to your next step. You can start your server and use it to view your documents in your Web browser, or you can continue to configure your Apache server by using the configuration forms to enable more advanced features. Continue by choosing the Manage button. Find your server in the list (it should already be preselected), then click Start. After the list of servers refreshes, it will show that your server has a status of running. To test that your new Apache server is functioning, enter http://myhostname:port/ in your Web browser where myhostname is the name that identifies your iSeries system (not your Apache server name), and port is the port number you selected for your Apache server. A default welcome page is displayed (this page was copied to your document root directory when your server was created by the wizard).
Continuing Your Journey
We’ve just touched the surface of what is possible for HTTP server configuration for Apache. The Configuration page has all the forms you’ll need to continue configuring your TRYAPACHE server, such as enabling features like directory browsing, document caching, or running CGI programs. Wizards are available for configuring more complex or advanced features. Because the Apache server is more highly configurable than the original HTTP server, focus on learning and configuring one feature at a time. I recommend you enable other features and then test the server to ensure it is working as you expect it to.
Finding More Information
If you have difficulties or see unexpected results when using your Apache server, read the IBM HTTP Server for iSeries home page (www.iseries.ibm.com/products/http/ httpindex.htm) for information on the latest fixes, known problems, and workarounds. I would also suggest browsing the Concepts section in the HTTP Server Documentation Center to learn Apache-specific terminology and the Configuring section to learn more details about the features of the Apache server on iSeries.
If you want to learn more about the technical details behind an Apache server configuration, you may be interested in looking at the raw configuration. To view the entire configuration you have just created, click Display Configuration File on the Configuration page. Each line contains a directive name and one or more values. At the beginning, don’t worry about knowing and understanding the directives themselves. Use the Web-based forms to manage and configure your servers. Knowing the directives is not necessary for successfully configuring and managing basic Apache servers. Once you are ready for a more in-depth view of directives, the Reference section in the HTTP Server Documentation Center shows the list of supported directives, along with detailed descriptions and examples for HTTP servers powered by Apache on iSeries.
Once you are comfortable with creating, configuring, and using Apache servers on iSeries, the next step for many of you will be to migrate your existing original HTTP servers to Apache. The knowledge you gain from practicing will be of great use when configuring an Apache HTTP server on iSeries for real production use.
REFERENCES AND RELATED MATERIALS:
• IBM HTTP Server Documentation Center: www.iseries.ibm.com/products/http/docs/v4r5
• IBM HTTP Server for iSeries home page: www.iseries.ibm.com/products/http/ httpindex.htm
Figure 1: This is the new interface for configuring both original and Apache servers.
Figure 2: Here’s a summary of your initial Apache server configuration.