How To: Alias the Servlet Connector with WebSphere on UNIX
Using a number of ArcIMS clients, such as ArcMap and ArcExplorer, users can view, query, and even save features from ArcIMS map services. In most cases, this can be prevented by enabling authentication for IMS map services; however, in certain cases, entering a user name and password is less than desirable for public Web sites.
The only alternative is to alias the servlet connector. This enables browser-based clients, such as the HTML Viewer, to access map services. Other ArcXML capable clients, including ArcExplorer 3+, ArcMap, and ArcPad are not able to access these map services. Instructions provided outline how to accomplish this by deploying the ArcIMS Servlet Connector in a Web application.
Note: It is assumed that ArcIMS is already configured and running with the default servlet connector.
Deploy and configure the servlet connector for WebSphere. The basic procedure is as follows:
- Deploy a copied version of the ArcIMS Servlet connector as a Web application under a different context root. For example, /arcims as opposed to /servlet.
- Configure IBM HTTP Server to use this new context root.
- Alter the Web application so that it employs a different servlet pattern. For example, the default is 'com.esri.esrimap.Esrimap'. This is simplified to 'ims'.
Note: This ensures an additional layer of security, since it is possible to configure ArcMap or any ArcXML-capable client to connect to map services if the new context root is discovered; however, thorough testing is recommended.
- Copy the ArcIMS Servlet Connector into a new Web application.
- Navigate to $AIMSHOME/Middleware/servlet_connector.
- Create a copy of the Servlet connector. For example:
cp arcimsservletconnector.war arcims.war
- Deploy the ArcIMS Servlet connector in WebSphere Application server.
- Open a Web browser and login to the WebSphere Administration Console: http://<servername>:9090/admin.
- In the left panel, expand Applications and click Install New Application.
- For the Path, enter the location of the .war file created in Step 1b.
- For the Context Root, type the following:
- Click Next.
- Click Next at the Generate Default Bindings screen.
- An Application Security Warning page may appear, if so, click Continue.
- At the 'Provide options to perform the installation' screen, click Next.
- At the 'Map virtual hosts for web modules' screen, check on the option for arcims.war module and assign it to the "default_host" Virtual Host.
- At the 'Map modules to application servers' screen, check on the option for arcims.war and click Next.
- At the summary screen, click Finish.
- Click on the 'Save to Master Configuration' link.
- On the resulting page, click Save.
- On the left hand panel, click the Enterprise Applications link.
- Select the arcims_war application and click Start.
- Test the new context root by entering the following URL into a Web browser:
IMS v9.0.0 Build_Number=871.1714 Version=9.0.0 Test successful
- Configure IBM HTTP Server to employ the new context root.
- Navigate to the location of the plugin-cfg.xml, which the WebSphere Application server uses to communicate with the HTTP Server. Typically, this is located in /opt/WebSphere/AppServer/config/cells/ plugin-cfg.xml.
- Open the file with a text editor, for example, vi, and add the following line:
</ServerCluster> <UriGroup Name="default_host_server1_aix52_Cluster_URIs"> <Uri Name="/snoop/*"/> <Uri Name="/hello"/> ... ... <Uri Name="/MessageDrivenBeans/docs/ko/*"/> <Uri Name="/servlet/*"/> <Uri Name="/arcims/*"/>
Note: The "/servlet/*" mapping can be removed if no other Web applications employs this mapping.
- Restart IBM Http Server.
- Open a new browser and enter the following URL to determine if the new context path works on the default HTTP Server port. In this example, port 80 is used by default:
Again, a Test Successful result should appear as shown in step 2p.
- Configure the Web application to employ a new servlet pattern.
- Navigate to the location of the web.xml file for the deployed Web application. Typically, this is located in:
- Open the web.xml file with a text editor and make the following changes, outlined in bold:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http:// java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app id="WebApp_1"> <servlet id="ims"> <servlet-name>ims</servlet-name> <servlet-class>com.esri.esrimap.Esrimap</servlet-class> </servlet> <servlet id="esriwms"> <servlet-name>esriwms</servlet-name> <servlet-class>com.esri.wms.Esrimap</servlet-class> </servlet> <servlet-mapping id="ServletMapping_1"> <servlet-name>ims</servlet-name> <url-pattern>/ims</url-pattern> </servlet-mapping> <servlet-mapping id="ServletMapping_2"> <servlet-name>esriwms</servlet-name> <url-pattern>/com.esri.wms.Esrimap</url-pattern> </servlet-mapping> </web-app>
- Save and close the file.
- Open the WebSphere Admin page and restart the arcims_war application as noted in step 2N – 2O.
- Open another Web browser and test the final aliased URL for the servlet connector. For example:
The output result from step 2P should appear.
- Ping the ArcIMS Application Server. For example:
The following should appear:
Version=9.0 Build_Number=871.1957 Test successful
Note: The ArcIMS daemons may have to be restarted if an error returns for this test.
- Modify ArcIMS client applications to use the new alias.
- For each client application, locate and open the files indicated below in a text editor:
- HTML Viewer: ArcIMSparam.js, Authorize.htm, aimsMap.js, and aimsXML.js
- Java Viewer: default.axl
- Custom viewers: Open any files that refer to the ArcIMS servlet connector.
- Change each occurrence of:
Note: These names are case-sensitive.
- Save and close the modified file(s).
- Test each client application to ensure it works with the new servlet path.
- Once the new clients are working with the new alias, a choice must be made to either shut down the default ArcIMS Servlet connector or to uninstall it in the WebSphere admin page. If the servlet connector is left installed, it can be used to administer map services with Administrator.
- The standalone Administrator program does not work anymore. This program uses the default Servlet Connector to communicate with the Application Server. Since this connector has been removed, the only alternative is to deploy the Web-based map service administrative application known as Service Administrator or 'esriadmin'. Steps on how to deploy this application are located in step 3A - Installing ArcIMS Service Administrator of the ArcIMS Install Guide. See link in the Related Information section below.
- In certain situations, the ArcIMS Post Installation must be executed. For example, this is required when updating ArcIMS with a service pack. When running through a typical Post Install, the default Servlet Connector will be re-installed on the system. This negates all of the changes made above, so it is imperative that the following steps are followed when executing the Post Install for ArcIMS:
- For a Custom Post Install: Uncheck the option to configure the Web server/Servlet Engine
- For a Typical Post Install: Select the option 'I will manually configure my Web server/Servlet Engine' at the Web server-Servlet Engine configuration screen.
- ArcIMS Installation Guides for UNIX 9.1
- ArcIMS Installation Guides for UNIX 9.0
- ArcIMS Installation Guides for UNIX 4.0.1
- Using ArcIMS 9.2