Updating configuration files

After you have installed the integrated Xsockets tool, you must complete manual changes to several configuration files for the instance.

You need to update these files: the WAR file, the web.xml file, and the httpd.conf file.
  1. Copy the WAR file
    From a command line, enter this command:
    CPY OBJ('/QSYS.LIB/XXXX.LIB/QATTIFS2.FILE/XSOCK.MBR')
       TOOBJ('/www/<server_name>/xsock.war') FROMCCSID(*OBJ) TOCCSID(819) OWNER(*NEW)
    
    where XXXX is the library name you created during Xsockets configuration and <server_name> is the name of the server instance you created during Apache configuration. This is the integrated file system directory where you would like to store the XSockets WAR file.
  2. Extract the WAR file.
    1. From a command line, enter
      CD DIR('/www/<server_name>')
      where <server_name> is the name of the server instance you created during Apache configuration.
    2. Enter the following command on the command line to extract the files stored in the XSockets WAR file.
      STRQSH CMD('jar xf xsock.war')
  3. Optional: Update the web.xml file:
    Note: This step is only necessary if Xsockets was installed to a library other than XSOCKETS during Xsockets configuration.
    1. From a command line, enter
      wrklnk 'WEB-INF/web.xml'
    2. Press function 2 (Edit) to edit the file.
    3. Find the </servlet-class> line in the web.xml file.
    4. Update the following code after this line:
      <init-param>
                <param-name>library</param-name>
                <param-value>xsockets</param-value>
      </init-param>
      In place of the xsockets, insert the library name that you created during Xsockets configuration.
    5. Save the file and exit the edit session.
    6. From a command line, enter
      STRQSH CMD('jar cmf META-INF/MANIFEST.MF xsock.war lib WEB-INF')
      to create a new XSockets WAR file containing the updated configuration file.
  4. 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 the Apache configuration. For example, if you choose xsocks for the server name, you can enter:
      wrklnk '/www/xsocks/conf/httpd.conf'
    2. Press function 2 (Edit) 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.