JKL Toy Company creates an HTTP Server

This scenario discusses how to create an IBM® HTTP Server for i Web server on an IBM i server.

Scenario

The JKL Toy Company (a fictitious company) wants to run a Web site on their IBM i server. The examples used in this scenario show the Create New HTTP Server wizard being used to create an HTTP Server instance called JKLTEST which will use all IP addresses, port 1975 on an IBM i server designated JKL_SERVER.

Prerequisites

Start the IBM Web Administration for i interface

Access the IBM Web Administration for i from your browser. For information about how to access the Web Administration for i interface, see Starting Web Administration for i.

Create your HTTP Server

The Web Administration for i interface allows you to create, set up, and manage multiple servers.

  1. Click the Setup tab.
  2. Expand Common Tasks and Wizards.
  3. Click Create HTTP Server.
  4. Enter a descriptive, unique name in the Server name field.

    Example: JKLTEST

  5. Click Next.
  6. Accept the default value.

    Example: /www/jkltest

  7. Click Next.
  8. Accept the default value.

    Example: /www/jkltest/htdocs

  9. Click Next.
  10. Accept the default values or replace with your own unique IP address and port.

    Example: IP address All Addresses

    Example: Port 1975

  11. Click Next.
  12. Optional: Select Yes to use an access log.

    Select No if you do not want to create an access log at this time. By default, the log will be created for you.

  13. Click Next.
  14. Accept the default values to specify the length of time to keep the log files or update with your preferences.
  15. Click Next.
  16. Review the displayed information. If any information is incorrect, click Back and correct it.
  17. Click Finish to create your new HTTP Server.
Note: If the wizard fails and you receive an error message, check your Webmaster user profile authorities.

Restart your HTTP Server

Select one of the following methods below:

Manage one server

  1. Click the Manage tab.
  2. Click the HTTP Servers subtab.
  3. Select your HTTP Server from the Server list.
  4. Click the Stop icon if the server is running.
  5. Click the Start icon.

Manage all servers

  1. Click the Manage tab.
  2. Click the HTTP Servers subtab.
  3. Select All Servers from the Server list.
  4. Click the All HTTP Servers tab.
  5. Select your HTTP Server name in the table.

    Example: JKLTEST

  6. Click Stop if the server is running.
  7. Click Start.
Note: If your HTTP Server does not start, see Troubleshooting.

Test your HTTP Server

  1. Open a new Web browser.
  2. Enter http://[your_hostname]:[port] in the location or URL field .

    Example: http://jkl_server:1975

Your new HTTP Server will display a generic HTML file provided by the Web Administration for i interface.

View your HTTP Server configuration

Your configuration will look similar if you used the given example in this and previous examples.

  1. Click the Manage tab.
  2. Click the HTTP Servers subtab.
  3. Select your HTTP Server from the Server list.

    Example: JKLTEST

  4. Expand Tools.
  5. Click Display Configuration File.
Listen *:1975
DocumentRoot /www/jkltest/htdocs
TraceEnable Off
Options -FollowSymLinks
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Cookie}n \"%r\" %t" cookie
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log combined
LogMaint logs/access_log 7 0
LogMaint logs/error_log 7 0
SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive
SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
<Directory />
	Require all denied
</Directory>
<Directory /www/jkltest/htdocs>
	Require all granted
</Directory>