{"id":11648,"date":"2016-10-12T13:05:31","date_gmt":"2016-10-12T18:05:31","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=11648"},"modified":"2016-10-25T09:28:19","modified_gmt":"2016-10-25T14:28:19","slug":"openam12-secure-tomcat-6","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=11648","title":{"rendered":"OpenAM12: Secure Tomcat 6"},"content":{"rendered":"<span id=\"Install_Tomcat_6\"><h2>Install Tomcat 6<\/h2><\/span>\n<p>* Add to hosts file:<br \/>\n127.0.0.1\ttomcat6.my.com<br \/>\n* Unzip <em>apache-tomcat-6.0.45.zip<\/em> and rename as <em>c:\\prog\\apache-tomcat-6.0.45.com<\/em><br \/>\n* Change listening ports from 8xxx to 9xxx, e.g. 808 to 10080 in conf\\server.xml file<br \/>\n8005 > 10005<br \/>\n8080 > 10080<br \/>\n8443 > 10443<br \/>\n8009 > 10009<br \/>\n* Add <em>setenv.bat<\/em> to <em>bin <\/em>directory to contain:<\/p>\n<pre lang=\"bash\">\r\nset JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m\r\nset JAVA_HOME=C:\\prog\\jdk1.7.0_45\r\n<\/pre>\n<p>* Start new Tomcat and point browser to: <a href=\"http:\/\/tomcat6.my.com:10080\/docs\">http:\/\/tomcat6.my.com:10080\/docs<\/a><br \/>\n* Shutdown Tomcat to install agent!<\/p>\n<span id=\"Create_Tomcat6_Agent_Profile\"><h2>Create Tomcat6 Agent Profile<\/h2><\/span>\n<p>* Login OpenAM<br \/>\n* Add a new J2EE agent named <strong>Tomcat6<\/strong><\/p>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentTocmat6_1_create.jpg\" rel=\"attachment wp-att-11643\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentTocmat6_1_create.jpg\" alt=\"openam13_agenttocmat6_1_create\" width=\"742\" height=\"282\" class=\"aligncenter size-full wp-image-11643\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentTocmat6_1_create.jpg 742w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentTocmat6_1_create-300x114.jpg 300w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/a><\/h6><\/span>\n<p>* Select new agent and enable <em>SSO Only Mode<\/em>:<\/p>\n<span id=\"_1\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentApache2_2_SSOOnly.jpg\" rel=\"attachment wp-att-11644\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentApache2_2_SSOOnly.jpg\" alt=\"openam13_agentapache2_2_ssoonly\" width=\"331\" height=\"99\" class=\"aligncenter size-full wp-image-11644\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentApache2_2_SSOOnly.jpg 331w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/10\/OpenAM13_AgentApache2_2_SSOOnly-300x90.jpg 300w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/a><\/h6><\/span>\n<span id=\"Install_OpenAM_Agent\"><h2>Install OpenAM Agent<\/h2><\/span>\n<p>* Download Tomcat Policy Agent from <a href=\"https:\/\/backstage.forgerock.com\/#!\/downloads\/OpenAM\/J2EE%20Policy%20Agents\/3.3.0\/Apache%20Tomcat%206%20and%207#list\">Forgerock<\/a>, e.g. <em>Tomcat-v6-Agent_3.3.0.zip<\/em><br \/>\n* Extract <em>tomcat_v6_agent<\/em> folder to <em>C:\\prog\\apache-tomcat-6.0.45.com<\/em><br \/>\n* Create a new password file named <em>tomcat6pass.txt<\/em>. Enter password in the file, e.g. Wx1<br \/>\n* Go to <em>C:\\prog\\apache-tomcat-6.0.45.com\\tomcat_v6_agent\\bin<\/em> and run:<\/p>\n<pre lang=\"bash\">\r\nagentadmin.bat --install\r\n\r\nTomcat conf directory: C:\\prog\\apache-tomcat-6.0.45.com\\conf\r\nOpenAM URL: http:\/\/openam.my.com:8080\/openam\r\n$CATALINA_HOME: C:\\prog\\apache-tomcat-6.0.45.com\r\nInstall agent filter in global web.xml ? [true]: true\r\nAgent URL: http:\/\/tomcat6.my.com:10080\/docs\r\nAgent profile name: Tomcat6\r\nPassword file: C:\\prog\\apache-tomcat-6.0.45.com\\tomcat_v6_agent\\tomcat6pass.txt\r\n<\/pre>\n<p>* Install output:<\/p>\n<pre lang=\"bash\">\r\n-----------------------------------------------\r\nSUMMARY OF YOUR RESPONSES\r\n-----------------------------------------------\r\nTomcat Server Config Directory : C:\\prog\\apache-tomcat-6.0.45.com\\conf\r\n\r\nOpenAM server URL : http:\/\/openam.my.com:8080\/openam\r\n$CATALINA_HOME environment variable :\r\nC:\\prog\\apache-tomcat-6.0.45.com\r\nTomcat global web.xml filter install : true\r\nAgent URL : http:\/\/tomcat6.my.com:10080\/docs\r\nAgent Profile name : Tomcat6\r\nAgent Profile Password file name :\r\nC:\\prog\\apache-tomcat-6.0.45.com\\tomcat_v6_agent\\tomcat6pass.txt\r\n\r\nVerify your settings above and decide from the choices below.\r\n1. Continue with Installation\r\n2. Back to the last interaction\r\n3. Start Over\r\n4. Exit\r\nPlease make your selection [1]:\r\n\r\nUpdating the C:\\prog\\apache-tomcat-6.0.45.com\/bin\/setenv.bat script\r\nwith the Agent configuration JVM option ...DONE.\r\nDONE.\r\n\r\nCreating directory layout and configuring Agent file for Agent_001\r\ninstance ...DONE.\r\n\r\nReading data from file\r\nC:\\prog\\apache-tomcat-6.0.45.com\\tomcat_v6_agent\\tomcat6pass.txt\r\nand encrypting it ...DONE.\r\n\r\nGenerating audit log file name ...DONE.\r\n\r\nCreating tag swapped OpenSSOAgentBootstrap.properties file for instance\r\nAgent_001 ...DONE.\r\n\r\nCreating a backup for file\r\nC:\\prog\\apache-tomcat-6.0.45.com\\conf\/server.xml ...DONE.\r\n\r\nCreating a backup for file\r\nC:\\prog\\apache-tomcat-6.0.45.com\\conf\/web.xml ...DONE.\r\n\r\nAdding OpenAM Tomcat Agent Realm to Server XML file :\r\nC:\\prog\\apache-tomcat-6.0.45.com\\conf\/server.xml ...DONE.\r\n\r\nAdding filter to Global deployment descriptor file :\r\nC:\\prog\\apache-tomcat-6.0.45.com\\conf\/web.xml ...DONE.\r\n\r\nAdding OpenAM Tomcat Agent Filter and Form login authentication to selected\r\nWeb applications ...DONE.\r\n\r\n\r\nSUMMARY OF AGENT INSTALLATION\r\n-----------------------------\r\nAgent instance name: Agent_001\r\nAgent Bootstrap file location:\r\nC:\/prog\/apache-tomcat-6.0.45.com\/tomcat_v6_agent\/Agent_001\/config\/OpenSSOAgentBootstrap.properties\r\nAgent Configuration file location\r\nC:\/prog\/apache-tomcat-6.0.45.com\/tomcat_v6_agent\/Agent_001\/config\/OpenSSOAgentConfiguration.properties\r\nAgent Audit directory location:\r\nC:\/prog\/apache-tomcat-6.0.45.com\/tomcat_v6_agent\/Agent_001\/logs\/audit\r\nAgent Debug directory location:\r\nC:\/prog\/apache-tomcat-6.0.45.com\/tomcat_v6_agent\/Agent_001\/logs\/debug\r\n\r\nInstall log file location:\r\nC:\/prog\/apache-tomcat-6.0.45.com\/tomcat_v6_agent\/installer-logs\/audit\/install.log\r\n\r\nThank you for using OpenAM Policy Agent\r\n<\/pre>\n<p>* Changes made:<br \/>\n&#8211; <em>conf\/Server.xml<\/em>:<br \/>\nReplaced:<\/p>\n<pre lang=\"xml\">\r\n      <Realm className=\"org.apache.catalina.realm.UserDatabaseRealm\"\r\n             resourceName=\"UserDatabase\"\/>\r\n<\/pre>\n<p>with<\/p>\n<pre lang=\"xml\">\r\n    <Realm className=\"com.sun.identity.agents.tomcat.v6.AmTomcatRealm\" debug=\"99\"\/>\r\n<\/pre>\n<p>&#8211; <em>conf\/web.xml<\/em>:<br \/>\nAdded:<\/p>\n<pre lang=\"xml\">\r\n    <filter>\r\n        <filter-name>Agent<\/filter-name>\r\n        <display-name>Agent<\/display-name>\r\n        <description>SJS Access Manager Tomcat Policy Agent Filter<\/description>\r\n        <filter-class>com.sun.identity.agents.filter.AmAgentFilter<\/filter-class>\r\n    <\/filter>\r\n\r\n    <filter-mapping>\r\n        <filter-name>Agent<\/filter-name>\r\n        <url-pattern>\/*<\/url-pattern>\r\n        <dispatcher>REQUEST<\/dispatcher>\r\n        <dispatcher>INCLUDE<\/dispatcher>\r\n        <dispatcher>FORWARD<\/dispatcher>\r\n        <dispatcher>ERROR<\/dispatcher>\r\n    <\/filter-mapping>\r\n<\/pre>\n<span id=\"Test\"><h2>Test<\/h2><\/span>\n<p>* Start Tomcat for target app<br \/>\n* Point browser to <a href=\"http:\/\/tomcat6.my.com:10080\/docs\">http:\/\/tomcat6.my.com:10080\/docs<\/a>.<br \/>\n&#8211; Note, if you already login OpenAM with browser, e.g. Firefox, you need to use a different browser, e.g. IE. Otherwise, you won&#8217;t see the login page since you&#8217;re already authenticated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install Tomcat 6 * Add to hosts file: 127.0.0.1 tomcat6.my.com * Unzip apache-tomcat-6.0.45.zip and rename as c:\\prog\\apache-tomcat-6.0.45.com * Change listening ports from 8xxx to 9xxx, e.g. 808 to 10080 in conf\\server.xml file 8005 > 10005 8080 > 10080 8443 > &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=11648\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[720],"tags":[721,578],"class_list":["post-11648","post","type-post","status-publish","format-standard","hentry","category-openam","tag-openam","tag-tomcat"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-31S","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11648"}],"version-history":[{"count":3,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11648\/revisions"}],"predecessor-version":[{"id":11686,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11648\/revisions\/11686"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}