This instructions shows how to protect an application running on a Tomcat server in CirrusGrid Cloud. We recommend two possible solutions on how to restrict access to your app:
To set up the authentication in front of your web-application deployed to Tomcat server, perform the next configurations:
Open the CirrusGrid dashboard and click the Config button next to the Tomcat server in your environment.
Go to the /opt/tomcat/conf folder and double-click the tomcat-users.xml file in order to open it. Use the following string format in order to specify new users roles and credentials. Save the changes made.<user username=“test” password=“test” roles=“admin”/>
Then navigate to the web.xml file (it is contained in the same /opt/tomcat/conf folder) and specify the security constraint for the newly created user.<security-constraint><web-resource-collection> <url-pattern>/</url-pattern></web-resource-collection><auth-constraint> <role-name>admin</role-name> <role-name>user</role-name></auth-constraint></security-constraint><login-config><auth-method>BASIC</auth-method><realm-name>Test Realm</realm-name></login-config>
If you’ve done everything correctly, a user will meet the authentication window while trying to access the application.
In the case you would like to deny the access to your web-application for particular client IP addresses follow the next steps:
Note:In the case you’ve attached the Public IP to your environment you can omit this string:<Valve className=“org.apache.catalina.valves.RemoteIpValve” />
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.