Exercise 10.2 – eiPlatform Configuration
Purpose:
To review how to configure the eiPlatform.
Steps:
- Installation
- Windows
- On Windows machines, the eiPlatform installs as a bundle, alongside an optional eiConsole.
- Once installed, the eiPlatform runs as a Windows Service.
- Installation is a simple .exe file which configures the service with default settings.
- Starting/stopping this service can be done through the Windows Services menu.
- Web Archive (WAR)
- For Mac, Linux, and other operating systems, the eiPlatform is installed as a Java Web Archive, or WAR.
- WAR files are deployed in a servlet container application.
- The eiPlatform can be deployed in most Java container applications.
- It is very strongly recommended to always use the Tomcat container to deploy the WAR.
- It is very strongly recommend to NOT use JBoss or WebSphere, although they are supported. The additional features offered by JBoss and WebSphere provide no benefits to how the eiPlatform runs, and there is always a possibility of a library conflict with those applications.
- Deploying the WAR to the container follows whatever the standard deployment procedure is for that container application.
- Once deployed, starting/stopping the application is the same as starting/stopping any web application deployed to that container.
- Configuration – Web.xml
- Whether it’s a Windows installation or a WAR, internally it runs like a Java web server. This means its controlled via a web.xml file.
- In the WAR installation, it is located within the exploded archive directory, at WEB-INF/web.xml. In the Windows installation, it’s located in the Program Files installation directory, at server/eip/WEB-INF/web.xml.
- This file is a standard Java application deployment descriptor. Most of the configuration items in the web.xml should NEVER be touched, or else the application may not be able to run.
- There are only two properties that a user might want to change. They are the two init-params for the first servlet in the file, the “EIPServlet”.
- The first init-param, “com.pilotfish.eip.servlet.displayLog”, points to the main log file for the application.
- The second init-param, “com.pilotfish.eip.servlet.eipConfigFile”, points to the eipServer.conf configuration file. This is the primary configuration file for the eiPlatform.
- Configuration – eipServer.conf
- The eipServer.conf is the primary configuration file for the eiPlatform.
- It is located in the root of the WAR installation, and in the server/eip directory in the Windows installation.
- The file is a standard properties file, with key/value pairs separated by “=”.
- For most of the properties, consult PilotFish documentation.
- There are two extremely important properties.
- “com.pilotfish.eip.configDirectory” is the property that points to the location of the “eip-root” Working Directory.
- “com.pilotfish.eip.logConfigFile” is the property that points to the logging configuration file, logConfig.xml.
- Configuration – logConfig.xml
- The logConfig.xml file is a log4j 1.x configuration file.
- It is located in the root of both the Windows and WAR installations.
- The only things that should ever be changed here are in the two appenders and the categories.
- Each of the two appenders has a param with a full file path in it. This param is the first param for each appender. That path has to point to the default log file for the application.
- Below the appenders are a series of categories. Each one of these assigns an appender and a priority value for each type of logger in the application. The only thing that should be changed here is the level, by default it’s set to “debug” for most of them, this can be raised or lowered depending on how detailed the user wants the logging to be.
- Externalize Configuration
- All three configuration files come within the eiPlatform installation.
- The web.xml should never be moved.
- For greater re-usability, it’s generally recommended to copy the eipServer.conf and logConfig.xml out of the installation into another location, generally within or adjacent to the “eip-root”.
- The default log location should also be externalized in the same way.
- The properties in the web.xml and eipServer.conf that point to the locations of the other files need to be updated accordingly.