Skip to main content

 
IBM Power Systems software  >  IBM i  > Software  > 

HTTP Server for i

Secure, powerful, and complete

  
Overview Getting Started Documentation Support

Webserver Search Engine - Configure an Apache server

These steps explain how to configure an Apache server to run the sample search Net.Data macros and to serve the documents that are found by the search engine. Once you have created your server, you will need to create a search index and a URL mapping rules file. The search index puts your documents into a form that allows high performance searches. In order for these documents to be opened, the URL mapping rules file maps each document's internal path to an external URL,  using information extracted from your server configuration.

First follow these steps to create an Apache server and then create a search index and URL mapping rules file. If you have never worked with the iSeries Webserver Search Engine, please reference Webserver Search Engine Getting Started.

Note: For adding a search to your own web site, you will need to substitute your own values for the sample ones specified here in red.

For more information about Apache servers, please reference HTTP Server Documentation for Apache Servers.

All the following steps will enable the Net.Data cgi program to run the sample search Net.Data macro and will set up the directory containing the indexed documents so they can be served from the search results form.

  1. Use your browser to access the HTTP Server Configuration and Administration.
    1. Create an Apache server named, for example, MYSERVER.
    2. Next select the URL Mapping form then the Aliases tab to add directive ScriptAlias as specified below to allow CGI execution. Click OK 
    3. Select Container Management then the Directories tab to add the directory for /QSYS.LIB/QHTTPSVR.LIB/. Click OK
    4. Change the Server area: to
              Directory /QSYS.LIB/QHTTPSVR.LIB/
    5. Select Dynamic Content and CGI and set Allow CGI programs to run to Enabled. Click OK
    6. Select Security and then the Control Access tab.
      • Under Control access based on where the request is coming from, set Order for evaluating access: to Allow then deny.
      • Select Allow access to all, except the following: Click OK.
    7. Change the Server area: to  Global configuration
    8. On the Add a Directory to the Web wizard form, click Next. Select to serve Static web pages and files. Click Next.
    9. Enter the directory that contains your documents such as  /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/ which contains the sample set of recipes. Click Next.
    10. Enter the alias  /docs/. Click Next. Click Finish.
    11. Select Dynamic Content and CGI. On the General settings tab, set Allow CGI programs to be run to Enabled.
    12. Click Ok.
    13. Under Tools, select Display Configuration File to make sure you have the following CGI related directives:

      Alias /docs/    /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/
      ScriptAlias /cgi-bin/db2www/            /QSYS.LIB/QHTTPSVR.LIB/DB2WWW.PGM/ mydir/macro/

             Order Allow,Deny
             Allow From all


          Options +ExecCGI
          Order Allow,Deny
          Allow From all

    Now it is time to set up a search on your own web site, described here: Setting up the Search Engine to Run on Your Web Site