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 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.
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.
- Start iSeries Navigator.
- Expand the iSeries the HTTP Server is installed on.
Example: JKL_SERVER
- Select Users and Groups, or click the Users and Group icon in the
toolbar.
- Click Create a new user, or click the Create a New Use icon in
the toolbar.
- Enter a new user name.
Example: SJONES
- Optional: Enter a description for this new profile.
Example:
This is a test profile.
- Optional: Add a password if necessary for your iSeries.
- Click Capabilities.
- Set the system privileges to allow the new user profile to use the HTTP
Server.
- Click OK.
- Click Add.
Create a new user directory with iSeries Navigator
Note: The /home directory
comes preinstalled on your iSeries.
- Start iSeries Navigator.
- Expand the iSeries the HTTP Server is installed on.
Example: JKL_SERVER
- Expand File Systems > Integrated File System > Root.
- Right-click directory home.
- Click New Folder.
- Enter the name of your new user profile.
Example: sjones
- 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
- Start iSeries Navigator.
- Expand the iSeries the HTTP Server is installed on.
Example: JKL_SERVER
- Expand File Systems > Integrated File Systems > Root > www > [server_name]
> htdocs.
Example: /www/jkltest/htdocs
- Right-click file index.html.
- Click Copy.
- Right-click the new user directory.
Example: sjones
- 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
- Start a Web
browser.
- Enter http://[iSeries_hostname]:2001 in the location or URL field
.
Example: http://jkl_server:2001
- Click IBM HTTP
Server for iSeries.
Set up user directories for HTTP Server (powered by Apache)
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
Example:
JKLTEST
- Select Global configuration from the Server area list.
- Expand Server properties.
- Click URL Mapping.
- Click the User Directories tab in the form.
- Select Disable all users except for the following under Enable
or Disable user directories.
- Click Add under the Enabled users table.
- Enter the name of your new user profile.
Example: sjones
- Click Continue.
- Click Add under the Current user directories table.
- 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.
- Click Continue.
- 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.
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select Global configuration from the Server area list.
- Expand Server Properties.
- Click Container Management.
- Click the Directories tab in the form.
- Click Add under Directory/Directory Match containers table.
- Select Directory from the list in the Type column.
- Enter /home in the Directory path or expression column.
- Click Continue.
- Click OK.
- Select Directory /home from the Server area list.
- Click Security.
- Click the Control Access tab in the form.
- Select Deny then allow from the Order for evaluating access list
under Control access based on where the request is coming from.
- 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.
- Click OK.
Restart your HTTP Server (powered by Apache)
Select
one of the following methods below:
Manage one server
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server from the Server list.
- Click the Stop icon if the server is running.
- Click the Start icon.
Manage all servers
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select All Servers from the Server list.
- Click the All HTTP Servers tab.
- Select your HTTP Server name in the table.
Example: JKLTEST
- Click Stop if the server is running.
- Click Start.
Note: If your HTTP Server (powered by Apache) does not start, see
Troubleshoot.
Test your HTTP Server (powered by Apache)
- Open a new Web browser.
- 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.
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
Example:
JKLTEST
- Expand Tools.
- 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>