Configuration in Apache Tomcat
Deploy the WAR File
You have two options for deploying a WAR file to Tomcat.-
Copy the WAR file into the
webappsfolder. - Deploy the WAR file from within the management console in Tomcat. The Apache Tomcat documentation covers this method in more detail. See the documentation for your version of Tomcat.
/usr/share/tomcat7-admin/manager/WEB-INF or in another similar directory. In this file, you can change the size, in bytes, of the maximum allowed file size. For example, to allow deployment of a 200-MB WAR file, edit the following values to change the maximum allowed file size:
Configure the Java Authentication and Service (JAAS)
To enable to manage users dynamically within the application, you must configure the JAAS as described in the following subsections.Create the Login Module
Create a JAAS configuration file with the name jaas.config in this folder:$CATALINA_BASE/conf/.
Include the following content in jaas.config to use standard authentication:
userProvider, authIdentity, and userFilter attributes to suit your environment.
Create (or Modify) the JAASRealm Module
Create a context for by creating (or modifying, if it is present) the configuration XML file that is located here:$CATALINA_BASE/conf/Catalina/localhost/sync.xml
Depending on how Tomcat is configured, this path might be slightly different. In this example,
Catalina refers to the engine name, and localhost is the host name that is defined in server.xml.Make the Login Module Visible
The Java virtual machine (JVM) must be directed to the login module (jaas.config) for the configuration to be visible. Set thejava.security.auth.login.config system property on the JVM to the path of the jaas.config file. To do so, append the following line to the $CATALINA_BASE/conf/catalina.properties file:
Configure Data Directory Permissions
Give the user of the process that runs the Java servlet container Read/Write access to the data directory in the appropriate location, as follows:-
Windows:
C:\ProgramData\CData\Sync\ -
Linux:
~/cdata/sync
Login Lockouts
automatically locks out users who enter incorrect passwords too many times in order to prevent brute-force attacks. By default, a user who enters six incorrect passwords within five minutes is locked out for thirty minutes. You can modify the lockout settings by editing the XML configuration file that governs the web-server behavior. These three settings are relevant to lockouts:- LockoutFailedAttempts - the number of incorrect passwords that trigger a lockout. Set LockoutFailedAttempts to 0 to disable lockouts.
- LockoutMinutes - the duration of the lockout. The default duration is thirty minutes.
- LockoutTimeCheckPeriod - the period after which the number of failed attempts is reset to 0. The default period is five minutes.
Configuration in WebSphere
Configure the WebSphere Class Loader
For WebSphere to load the application resources correctly, you must follow these steps:- Within WebSphere, navigate to Application > Application Types > WebSphere enterprise applications.
- Select .
- Select Class loading and update detection.
- Choose Classes loaded with local class loader first (parent last).
- Choose Single class loader for application.
- Click OK. Then click Save.
Configure the Java Authentication and Service (JAAS)
The following process is required to configure the JAAS and to enable to manage users dynamically in the WebSphere Application Server:-
Deploy :
- Enable application security (navigate to Security > Global security > Enable application security).
-
Add the custom login module to the system login, as follows:
- Navigate to Security > Global security > Java Authentication and Authorization Service > System logins > WEB_INBOUND. Click New to add a new entry named .LoginModule. Note that the .LoginModule must appear before com.ibm.ws.security.server.lm.ltpaLoginModule.
- Select the Use login module proxy check box.
- Select OPTIONAL under Authentication strategy.
- Add isWebSphere under Custom properties and set it to true.
-
Create groups:
- Navigate to Users and Groups > Manage Groups > Create.
- Create _admin, _standard, and _support groups.
-
Map groups to roles:
- Navigate to Applications > Application Types > WebSphere enterprise applications > _war > Security role to user/group mapping.
- Map the _admin group to the _admin role.
- Map the _standard group to the _standard role.
- Map the _support group to the _support role.
- Map All Authenticated in Application’s Realm to the _user role.
-
Set the com.ibm.ws.webcontainer.AllowQueryParamWithNoEqual property to true:
- Navigate to Server > Server Types > Web Sphere Application Servers and select the server on which is hosted.
- Select Container Settings > Web Container Settings > Web Container.
- Select Additional Properties > Custom Properties.
- Add this new property: com.ibm.ws.webcontainer.AllowQueryParamWithNoEqual
- Set the value to true.
- Restart WebSphere.
Configure Data Directory Permissions
Give the user of the process that runs the Java servlet container Read/Write access to the data directory:-
Windows:
C:\ProgramData\CData\Sync\ -
Linux:
~/cdata/sync
Configuration in Jetty
Although comes with an embedded Jetty web server, you can also use the application with an external Jetty setup.Deploy the WAR File
Copy the WAR file into Jetty’swebapps folder.
Configure the Java Authentication and Service (JAAS)
To configure the JAAS and to enable to manage application users, you must perform the steps that are described in the following subsections.Add the JAAS Module
Submit the following command to install the JAAS module:Create the Login Module
Create a login configuration file with the name login.config in this folder:{JETTY_BASE}/etc/login.conf
Place the following content in the login.config file:
Update the Security Handler
The Security Handler configuration is in the sync.xml configuration file. Modify the securityHandler block as follows:Configure Data Directory Permissions
Give the user of the process that runs the Java servlet container Read/Write access to the data directory:-
Windows:
C:\ProgramData\CData\Sync\ -
Linux:
~/cdata/sync
Configure the Application Directory
TheApplicationDirectory folder contains all the data that is used by the application: configuration data, application data, logging data, certificates, and so on. The default location of ApplicationDirectory depends on whether is hosted via the embedded web server or via an external Java servlet container.
When is hosted in an external Java servlet container, ApplicationDirectory is relative to the home directory of the user who is running the server:
~/sync
In this path, ’~’ resolves to the home directory of the user who is running the server that hosts the application.
You can configure the ApplicationDirectory folder, which is useful in a variety of scenarios:
- clustering multiple instances of
- using a shared network drive for application data
- embedding within other systems that access the same folders
ApplicationDirectory moves the application’s data files. However, it does not move other application resources like EXE files, JAR files, and so on. These resources are held in the InstallationDirectory folder, which might be the same as ApplicationDirectory, but the location of those resources does not change if ApplicationDirectory is changed.
When you use with an external Java servlet (any server other than the Jetty server that is included with the application), the details of configuring the application data directory depend upon the specific servlet that is used. Using the syntax that is appropriate for the specific servlet, the AppDirectory environment variable must be set to the path of the directory that you want.
If can locate the AppDirectory path and it has the appropriate permissions to read and write at that path, it creates the data folder within the specified directory.
Configure the Application Database
The application database stores several tables of application data, including the following:- Jobs
- Tasks
- Connections
- History (both Jobs and Tasks)
- Application Log (application-level errors and events)
- Audit Log (user-made changes to the configuration)
Configure the Database Connection
When you use with an external Java servlet (any server other than the Jetty server that is included with the application), the details for configuring the application database depend upon the specific servlet that is used. Using the syntax that is appropriate for the specific servlet, choose either of the following approaches to use when you configure the server:- Define a JNDI data source to include the connection properties for the target database.
- Set the APP_DB environment variable to a JDBC connection string.
Protect Your Database Credentials with an Encrypted Connection String
provides the ability to generate an encrypted connection string for your application database connection. You can use this encrypted connection string to specify the application database without storing your login credentials in plaintext in the properties file. To generate an encrypted connection string, issue the following command in the installation directory where .jar is located, substituting your connection information for the example string in quotation marks:cdata.app.db when you configure the application database with the methods explained earlier.