JKL Toy Company adds user directories for HTTP Server (powered by Apache)

This scenario discusses how to add a user directory.

Important: Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . It is recommended that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm Link outside Information Center for more information.

Scenario

The JKL Toy Company (a fictitious company) has decided to allow employees to maintain their own personal Web pages. The JKL Web administrator wants the personal Web pages to be stored in a directory of the root file system called /home on the JKLTEST HTTP Server (powered by Apache). The directory /home will contain one subdirectory for each employee.

To begin, the JKL Web administrator creates a user profile and user directory for fellow employee Sharon Jones. The new user profile will be called SJONES on the iSeries™ and the new user directory will be located at /home/sjones.

Prerequisites

Create a new user profile with iSeries Navigator

For in-depth information on how to use the iSeries Navigator, read the iSeries Navigator help installed with the product.

Note: It is not necessary to create a new user profile on your iSeries if you want to use an existing profile. If using an existing profile, make certain the user profile has the appropriate permissions.
  1. Start iSeries Navigator.
  2. Expand the iSeries the HTTP Server is installed on.

    Example: JKL_SERVER

  3. Select Users and Groups, or click the Users and Group icon in the toolbar.
  4. Click Create a new user, or click the Create a New Use icon in the toolbar.
  5. Enter a new user name.

    Example: SJONES

  6. Optional: Enter a description for this new profile.

    Example: This is a test profile.

  7. Optional: Add a password if necessary for your iSeries.
  8. Click Capabilities.
  9. Set the system privileges to allow the new user profile to use the HTTP Server.
  10. Click OK.
  11. Click Add.

Create a new user directory with iSeries Navigator

Note: The /home directory comes preinstalled on your iSeries.
  1. Start iSeries Navigator.
  2. Expand the iSeries the HTTP Server is installed on.

    Example: JKL_SERVER

  3. Expand File Systems > Integrated File System > Root.
  4. Right-click directory home.
  5. Click New Folder.
  6. Enter the name of your new user profile.

    Example: sjones

  7. Click OK.

Copy HTML welcome page to user directory with iSeries Navigator

The new user directory does not contain any files. Use the iSeries Navigator to copy index.html, found in /www/[server_name]/htdocs directory of your HTTP Server (powered by Apache), to your new user directory.

Example: /www/jkltest/htdocs

  1. Start iSeries Navigator.
  2. Expand the iSeries the HTTP Server is installed on.

    Example: JKL_SERVER

  3. Expand File Systems > Integrated File Systems > Root > www > [server_name] > htdocs.

    Example: /www/jkltest/htdocs

  4. Right-click file index.html.
  5. Click Copy.
  6. Right-click the new user directory.

    Example: sjones

  7. Click Paste.

Optional: Edit file index.html in any way you choose. This is the file the HTTP Server (powered by Apache) will look for when this directory is requested by the Web browser.

Start the IBM® Web Administration for i5/OS™ interface

Note: Enter your Webmaster user profile username and password when prompted.
  1. Start a Web browser.
  2. Enter http://[iSeries_hostname]:2001 in the location or URL field .

    Example: http://jkl_server:2001

    Note: If you have changed your port number for the IBM Web Administration for i5/OS interface, replace port 2001 with your port number.
  3. Click IBM HTTP Server for iSeries.
Note: If the IBM Web Administration for i5/OS interface does not start, see Install and test the HTTP Server.

Set up user directories for HTTP Server (powered by Apache)

  1. Click the Manage tab.
  2. Click the HTTP Servers subtab.
  3. Select your HTTP Server (powered by Apache) from the Server list.

    Example: JKLTEST

  4. Select Global configuration from the Server area list.
  5. Expand Server properties.
  6. Click URL Mapping.
  7. Click the User Directories tab in the form.
  8. Select Disable all users except for the following under Enable or Disable user directories.
  9. Click Add under the Enabled users table.
  10. Enter the name of your new user profile.

    Example: sjones

  11. Click Continue.
  12. Click Add under the Current user directories table.
  13. Enter /home in the User directories column.
    Note: The order in which the user directories are listed determines which directory the HTTP Server (powered by Apache) will use first. If a match is not found in the first (top) user directory, the next user directory listed will be used. This continues until a match is found.
  14. Click Continue.
  15. Click OK.

Set up /home directory for HTTP Server (powered by Apache)

After creating the user directory, you must set up your HTTP Server (powered by Apache) to provide access to directory /home.

  1. Click the Manage tab.
  2. Click the HTTP Servers subtab.
  3. Select Global configuration from the Server area list.
  4. Expand Server Properties.
  5. Click Container Management.
  6. Click the Directories tab in the form.
  7. Click Add under Directory/Directory Match containers table.
  8. Select Directory from the list in the Type column.
  9. Enter /home in the Directory path or expression column.
  10. Click Continue.
  11. Click OK.
  12. Select Directory /home from the Server area list.
  13. Click Security.
  14. Click the Control Access tab in the form.
  15. Select Deny then allow from the Order for evaluating access list under Control access based on where the request is coming from.
  16. Select Allow access to all, except the following under Control access based on where the request is coming from.
    Note: Do not add restrictions at this time. Return to this form at the end of the scenario to add restrictions.
  17. Click OK.

Restart your HTTP Server (powered by Apache)

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 (powered by Apache) does not start, see Troubleshoot.

Test your HTTP Server (powered by Apache)

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

    Example: http://jkl_server:1975/~sjones

Your new user directory will display the generic HTML file copied from directory /htdocs.

View your HTTP Server (powered by Apache) 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 (powered by Apache) from the Server list.

    Example: JKLTEST

  4. Expand Tools.
  5. Click Display Configuration File.
Listen *:1975
DocumentRoot /www/jkltest/htdocs
ServerRoot /www/jkltest
Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
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
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
UserDir Disable
UserDir Enable Sjones
UserDir /home
<Directory />
	Order Deny,Allow
	Deny From all
</Directory>
<Directory /www/jkltest/htdocs>
	Order Allow,Deny
	Allow From all
</Directory>
<Directory /home>
	Order Deny, Allow
	Allow From all
</Directory>