This topic provides information about how to set up the Webserver
search engine for your HTTP Server with the IBM® Web Administration for i5/OS™ interface.
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.
The Webserver search engine allows you to perform full text searches on
HTML and text files. You an control what options are available to the user
and how the search results are displayed through customized Net.Data® macros.
Follow these steps to configure the Webserver search engine for HTTP Server
(powered by Apache) using the IBM Web Administration for i5/OS interface.
Edit 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.
- Select Global configuration from the Server area list.
- Expand HTTP Tasks and Wizards.
- Click Add a directory to the Web.
Using the wizard, create a
new directory to serve static Web content, with directory /www/MyServer/scripts/,
and with an alias /scripts/, where MyServer is the name
of your HTTP Server (powered by Apache). See JKL Toy Company adds a new directory to HTTP Server (powered by Apache) for more information.
Note: The new scripts directory
and the directory containing the files to be searched must have *Public *RX
authority or Net.data will return an error.
- Expand Server Properties.
- Click Container Management.
- Click the Directories tab in the form.
- Click Add under the Directory/Directory Match container table.
- Select Directory from the list in the Type column.
- Enter /QSYS.LIB/QHTTPSVR.LIB/ in the Directory path or expression column.
- Click Continue.
- Click OK.
- Click URL Mapping.
- Click the Aliases tab in the form.
- Click Add under the URL to host file system mappings table.
- Select Alias from the list in the Alias Type column.
- Enter /htdocs/ in the URL path column.
- Enter /www/MyServer/htdocs in the Host directory or file column,
where MyServer is the name of your HTTP Server (powered by Apache).
- Click Add.
- Select ScriptAlias from the list in the Alias Type column.
- Enter /cgi-bin/db2www/ in the URL path column.
- Enter /QSYS.LIB/QHTTPSVR.LIB/DB2WWW.PGM/ in the Host directory
or file column.
- Click Continue.
- Click OK.
- Select Directory \www\MyServer\scripts\ from the Server
area list, where MyServer is the name of your HTTP Server
(powered by Apache).
- Click Dynamic Content and CGI.
- Click the General Settings tab in the form.
- Select Enabled for Allow CGI programs to be run.
- Click OK.
- Click Security.
- Click the Control Access tab in the form.
- Select All authenticated users (valid user name and password) under Control
access based on who is making the request.
- Select Allow then deny from Order for evaluating access under Control
access based on where the request is coming from.
- Select All client hosts under Client hosts allowed access to
this resource.
- Click OK.
- Select Directory /QSYS.LIB/QHTTPSVR.LIB/ from the Server area list.
- Click Dynamic Content and CGI.
- Click the General Settings tab in the form.
- Select Enabled for Allow CGI programs to be run.
- Click OK.
- Click Security.
- Click the Control Access tab in the form.
- Select All authenticated users (valid user name and password) under Control
access based on who is making the request.
- Select Allow then deny from Order for evaluating access under Control
access bade on where the request is coming from.
- Select All client hosts under Client hosts allowed access to
this resource.
- Click OK.
Create search index
- Click the Advanced tab.
- Click the Search Setup subtab.
- Expand Search Engine Setup.
- Click Create search index.
- Enter an index name in the Index name field.
- Click Apply.
- Select Build a document list from this directory under Document
list.
- Enter the directory where the HTML and text files to searched are located.
Example, /www/MyServer/htdocs, where MyServer is
the configuration directory of your HTTP Server (powered by Apache).
- Select Create a mapping rules file from this HTTP server under Mapping
rules.
- Select your HTTP Server (powered by Apache) configuration name from the
list.
- Enter a URL prefix in the Prefix to use for URL address field.
Example, http://iSeries™:Port, where iSeries:Port is
the name of your iSeries and port number.
Note: Remember the search index
name and mapping rules directory and file name. This information will be used
in the following steps.
- Click Apply.
Copy sample_search.ndm and sample_html.html files
- Open directory \QIBM\ProdData\HTTP\Public\HTTPSVR.
- Copy sample_html.html to \www\MyServer\htdocs directory,
where MyServer is the configuration directory of your HTTP Server
(powered by Apache).
- Copy sample_search.ndm to \www\MyServer\scripts directory,
where MyServer is the configuration directory of your HTTP Server
(powered by Apache).
Note: File sample_search.ndm must have *Public *RX authority or Net.data
will return an error.
Edit sample_search.ndm
- Open sample_search.ndm with a text editor.
- Change the following lines found under %{ ---- STEP 1 -----%}:
- idxIndexName="Recipes"
- Search index name: replace Recipes with the name of your search
index.
- mapFile=""
- Map file directory and name: add /QIBM/UserData/HTTPSVR/index/SearchIndex.MAP_FILE,
where SearchIndex is the name of your search index.
- Save and close the file.
Note: The sample_search.ndm file has additional fields that allow you
to modify the search results displayed with the Webserver search engine. Read
the documentation provided in the sample_search.ndm file for more details.
Edit sample_html.html
- Open sample_html.html with a text editor.
- Change the following lines:
- FORM NAME="search" ACTION="/cgi-bin/db2www/qibm/proddata/http/public/httpsvr/sample_search.ndm/output"
METHOD="post">
- Replace the ACTION attribute value with /cgi-bin/db2www/www/MyServer/scripts/sample_search.ndm/output,
where MyServer is the configuration directory of your HTTP Server
(powered by Apache)
- <INPUT TYPE="hidden" NAME="frmIndexName" VALUE="Recipes">
- Search index name: replace Recipes with the name of your search
index.
- <INPUT TYPE="hidden" NAME="frmMapFile" VALUE=" ">
- Map file directory and name: add /QIBM/UserData/HTTPSVR/index/SearchIndex.MAP_FILE to
the VALUE attribute, where SearchIndex is the name of
your search index.
- Save and close the file.
Note: The sample_html.html file contains additional fields for the Webserver
search engine. Only the necessary information for the required fields are
documented here.
Start the server
- Click the Manage tab.
- Click the All Servers subtab.
- Click the All HTTP Servers tab.
- Select your HTTP Server (powered by Apache) from the table.
- Click Start.
Test the Webserver search engine
- Open a Web browser.
- Enter http://iSeries:Port/sample_html.html to start the
Webserver search engine, where iSeries:Port is the name of your
iSeries and port number.
- Enter a search term.
- Click Search.
Note: If the MAP_FILE is incorrectly built, the search results will not
contain the correct URL and the Web page will not be displayed.