Update configuration files

After you have configured Tomcat on the HTTP server (powered by Apache) to use the Xsockets tool, you must complete manual changes to several configuration files for the instance. There are three files you need to update: the web.xml file, the JAR file, and the httpd.conf.

To complete these steps you need to know the following information:
  1. Update the web.xml file:
    1. From a command line, enter
      wrklnk '/www/<server_name>/webapps/xsock/WEB-INF/web.xml'
      where <server_name> is the name of the server instance you created during Apache configuration. For example, if you choose xsocks for the server name, you can enter:
      wrklnk '/www/xsocks/webapps/xsock/WEB-INF/web.xml'
    2. Press 2 to edit the file.
    3. Find the </servlet-class> line in the web.xml file.
    4. Insert the following code after this line:
      <init-param>
                <param-name>library</param-name>
                <param-value>XXXX</param-value>
      </init-param>
      In place of the XXXX, insert the library name that you created during Xsockets configuration.
    5. Save the file and exit the edit session.
  2. Move JAR file From a command line, enter this command:
    CPY OBJ('/QSYS.LIB/XXXX.LIB/QATTIFS2.FILE/TSOXSOCK.MBR')
       TOOBJ('/www/<server_name>/webapps/xsock/WEB-INF/lib/tsoxsock.jar')
       FROMCCSID(*OBJ) TOCCSID(819) OWNER(*NEW)
    where XXXX is the library name that you created during Xsockets configuration and <server_name> is the name of the server instance you created during HTTP server (powered by Apache) configuration.
  3. Optional: Add the authority check to httpd.conf file. This forces Apache to authenticate users trying to access the Xsockets Web application.
    Note: It is also necessary for getting write access to create UNIX® sockets.
    1. From a command line, enter
      wrklnk '/www/<server_name>/conf/httpd.conf'
      where <server_name> is the name of the server instance you created during Apache configuration. For example, if you choose xsocks for the server name, you can enter:
      wrklnk '/www/xsocks/conf/httpd.conf''
    2. Press 2 to edit the file.
    3. Insert the following lines at the end of the file.
      <Location /xsock>
         AuthName "X Socket"
         AuthType Basic
         PasswdFile %%SYSTEM%%
         UserId %%CLIENT%%
         Require valid-user
         order allow,deny
         allow from all
      </Location>
    4. Save the file and exit the edit session.