Solaris 7 (SPARC Platform Edition) Installation Library

Running the AnswerBook2 Server as a CGI Process

By default, the AnswerBook2 documentation server runs as an NSAPI plug-in on top of the httpd server that is included in the SUNWab2u package. Because the AnswerBook2 server complies with standard web protocols, you can choose to run the documentation server as a CGI (Common Gateway Interface) process on top of some other web server already on your system (for example, Netscape Server or Sun Web Server).

Be aware that the following functions will not work if you change from the default AnswerBook2 web server:

You will need to use your server's start and stop functions instead.

To Change To a CGI-based Server

Because specific details differ by web server, this procedure describes the general steps you need to follow to use a CGI-based web server rather than the default (NSAPI plug-in) server. Specific examples are included below for Sun Web Server and Netscape Server.

  1. Shut down the AnswerBook2 server if it is running.

    Use one of the following commands:


    # /usr/lib/ab2/bin/ab2admin -o stop
    # /etc/init.d/ab2mgr stop
    
  2. Edit your web server's configuration file and make icons available.

    Your web server's documentation should explain specific details, such as where to find the configuration file. The entry /icons/ should point to /usr/lib/ab2/data/docs/icons/.

    If /icons/ is already being used, link all files in /usr/lib/ab2/data/docs/icons/ to the existing /icons/ directory.

  3. Link AnswerBook2 Help documents to the current documentation root directory.

    Go to your web server's documentation root directory and create a soft link to /usr/lib/ab2/data/docs/.

  4. Make AnswerBook2 cgi-bin files available to your server.

    Go to your web server's cgi-bin directory and create soft links to the following:


    /usr/lib/ab2/bin/cgi/admin
    /usr/lib/ab2/bin/cgi/nph-dweb
    /usr/lib/ab2/bin/cgi/gettransbitmap
    /usr/lib/ab2/bin/cgi/getepsf
    /usr/lib/ab2/bin/cgi/getframe
    /usr/lib/ab2/bin/cgi/ab2srwrap
  5. Edit your web server's configuration file and map /ab2/ to call AnswerBook2 cgi.

    Your web server's documentation should explain specific details, such as where to find the configuration file. You need to change the entry for /ab2/ to /usr/lib/ab2/bin/cgi/nph-dweb/ab2/.

  6. Edit the AnswerBook2 administration configuration file.

    You need to edit the /usr/lib/ab2/bin/cgi/nph-dweb file and change the entries for servertype, errorlog, and accesslog.

To Run an AnswerBook2 Server as a CGI Process on Sun WebServer

By default, the Sun Web Server configuration file is /etc/http/httpd.conf and files are in /var/http/demo/. If you did not install in the default location (/usr/), all paths that begin /usr/lib/ab2/ should be the path where you installed the files (for example, /usr2/lib/ab2/).

  1. Edit the /etc/http/httpd.conf file and put the following line in the server section of the file:


    map /icons /usr/lib/ab2/data/docs/icons

    When you have made this change, use the following command to restart the SWS server:


    # /etc/init.d/httpd start
    

    To verify your changes, enter the following URL in your web browser to see a Help icon:


    http://localhost:port/icons/ab2_help.gif
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  2. Go to the /var/http/demo/public/ directory and put in the following soft link:


    # ln -s /usr/lib/ab2/data/docs/Help Help
    

    To verify your changes, enter the following URL in your web browser to see a Help icon:


    http://localhost:port/Help/C/Help/books/Help/figures/ab2_help.gif
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  3. Go to the /var/http/demo/cgi-bin/ directory and create the following soft links:


    # ln -s /usr/lib/ab2/bin/cgi/admin
    # ln -s /usr/lib/ab2/bin/cgi/nph-dweb
    # ln -s /usr/lib/ab2/bin/cgi/gettransbitmap
    # ln -s /usr/lib/ab2/bin/cgi/getepsf
    # ln -s /usr/lib/ab2/bin/cgi/getframe
    # ln -s /usr/lib/ab2/bin/cgi/ab2srwrap

    To verify your changes, enter the following URL in your web browser to see the AnswerBook2 library page:


    http://localhost:port/cgi-bin/nph-dweb/ab2
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  4. Edit the /etc/http/httpd.conf file and add the following entry in the host section of the file:


    map /ab2 /var/http/demo/cgi-bin/nph-dweb/ab2 cgi

    Restart the SWS server using the following command:


    # /etc/init.d/httpd start
    

    To verify your changes, enter the following URL in your web browser to see the AnswerBook2 library page:


    http://localhost:port/ab2
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  5. Edit the /usr/lib/ab2/bin/cgi/nph-dweb file and change the following entries:


    setenv servertype sws
    setenv errorlog
    setenv accesslog /var/http/logs/http.elf.1
To Run an AnswerBook2 Server as a CGI Process on Netscape Server

For this example, the Netscape Server configuration file is /ul/netscape/suitespot/httpd-threads1/config/obj.conf and files are in /ul/netscape/suitespot/docs/. If you did not install in the default location (/usr/), all paths that begin /usr/lib/ab2/ should be the path where you installed the files (for example, /usr2/lib/ab2/).

  1. Edit the /ul/netscape/suitespot/httpd-threads1/config/obj.conf file and add the following line:


    NameTrans fn="pfx2dir" from="/icons" dir="/usr/lib/ab2/data/docs/icons"

    To verify your changes, restart the Netscape Server. Then, enter the following URL in your web browser to see a Help icon:


    http://localhost:port/icons/ab2_help.gif
    
  2. Go to the /ul/netscape/suitespot/docs/ directory and put in the following soft link:


    # ln -s /usr/lib/ab2/data/docs/Help Help
    

    To verify your changes, enter the following URL in your web browser to see a Help icon:


    http://localhost:port/Help/C/Help/books/Help/figures/ab2_help.gif
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  3. Go to the /ul/netscape/suitespot/cgi-bin/ directory and create the following soft links:


    # ln -s /usr/lib/ab2/bin/cgi/admin
    # ln -s /usr/lib/ab2/bin/cgi/nph-dweb
    # ln -s /usr/lib/ab2/bin/cgi/gettransbitmap
    # ln -s /usr/lib/ab2/bin/cgi/getepsf
    # ln -s /usr/lib/ab2/bin/cgi/getframe
    # ln -s /usr/lib/ab2/bin/cgi/ab2srwrap
    

    To verify your changes, enter the following URL in your web browser to see the AnswerBook2 library page:


    http://localhost:port/cgi-bin/nph-dweb/ab2
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  4. Edit the /ul/netscape/suitespot/httpd-threads1/config/obj.conf file and add the following entry:


    NameTrans fn="pfx2dir" from="/ab2" 
    dir="/ul/netscape/suitespot/cgi-bin/nph-dweb/ab2" name="cgi"

    To verify your changes, restart the Netscape server and enter the following URL in your web browser to see the AnswerBook2 library page:


    http://localhost:port/ab2
    

    Where port is the port number on which your documentation server is running and defaults to 8888.

  5. Edit the /usr/lib/ab2/bin/cgi/nph-dweb file and change the following entries:


    setenv servertype netscape
    setenv errorlog /ul/netscape/suitespot/httpd-threads1/logs/errors
    setenv accesslog /ul/netscape/suitespot/httpd-threads1/logs/access