You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 65 Next »


Article donated by: Hernan Cunico

This article is an attempt to cover as many administrative tasks as possible, common and not so common tasks. This article is grouped in four main sections having a similar flow to what you would find while using the Geronimo Administration Console, this way should be easier for you to familiarize on both tasks and console.

This article is organized in the following sections:

Additional reference:

Administering the Apache Geronimo Server

Covered in this section are the most common, every day, server related administrative tasks you may deal with. Subsequent sections will focus on configuring services, managing applications and configuring security.

Changing the Web container (Jetty or Tomcat)

When you download and build Apache Geronimo from source code (from svn) you would get a directory structure similar to this one:

  • applications
  • assemblies
  • configs
  • docs_nopublish
  • etc
  • modules
  • openejb
  • plugins
  • sandbox
  • xdocs

If you look under the assemblies directory you will find the following subdirectories:

  • j2ee-installer
  • j2ee-jetty-server
  • j2ee-tomcat-server

We will focus on the last two directories that, as you may expect, contain self-contained images of Apache Geronimo configured to use either of these two Web containers.

Depending on whether you want to use Jetty or Tomcat you will change to the respective directory (j2ee-jetty-server or j2ee-tomcat-server), the internal subdirectory structure will be the same. Once in the Web container specific directory, change directory once again to target/geronimo-1.0. This directory is your self-contained, totally complete, Apache Geronimo server. You may copy this directory to a different location. This directory is being referenced as <geronimo_home> throughout these series of articles.

So, selecting the Web container is no longer a matter of changing configuration files but rather choosing a directory structure for the different assemblies. Within this structure you will find a /bin directory, the next section explains the commands located in this directory and how to start and stop the server.

Back to Top

Starting and stopping the server

There are two command line ways to start the server. From a command line window or terminal change directory to <geronimo_home>/bin. From there you can either type:

java -jar server.jar

or simply

startup

Refer to the Startup and Geronimo sections for all the options for this command.

To stop the server you will have to open a new command line window or terminal, change directory to <geronimo_home>/bin and run the shutdown command. You will be prompted for username and password. Refer to the Shutdown and Geronimo sections for the available options for this command.

If the server is already running you have the option of using the Geronimo Administration Console to shutdown the server remotely. With the server up and running open a Web browser and point to the following URL to access the console:

http://localhost:8080/console

Log in to the Geronimo Administration Console and click on Shutdown on the Console Navigation menul on the left.

When you click on the Shutdown button in the Server Manager portlet, you will be prompted one more time to confirm the server shutdown. Click OK to confirm and shutdown the server. No need to mention that the connection from the Administration Console will be lost and you will need to restart the server from a terminal or command line window.

Back to Top

Configure log level

As explained in the Geronimo Administration Console section, the Administration Console provides four portlets for configuring and viewing the server's logs, these portlets are the Log Manager, Server Log Viewer, Derby Log Viewer and Web Access Log Viewer.

Back to Top

Log Manager

The Log Manager portlet options are illustrated in the following figure. From this portlet you can specify the location of the log configuration file. By default this value is set to var/log/server-log4j.properties.

Other value you can modify in from this portlet is the Refresh Period. This value tells Geronimo how often (in seconds) it should check for any changes to the configuration file. By default this value is set to 60 seconds.

From this portlet you can also change the Log Level. By default this value is set to INFO, the possible values you can choose from are All, DEBUG, INFO, WARN, ERROR, FATAL, TRACE and OFF.

Back to Top

Server Log Viewer

The Server Log Viewer portlet options are illustrated in the following figure. From this portlet you can view the Geronimo server logs as well as set filters for refining the results displayed.

The Refresh link on the upper left corner will reset any filtering criteria you may have specified to the Geronimo Administration Console's defaults and will display the last 10 lines (if any) of the current Geronimo server log.

The Filter Results: area will let you specify different filtering criteria to further narrowing down your search. The File pull-down menu allows you to select the log file to view. The logs listed in this pull-down menu are ruled by the Configuration File (server-log4j.properties by default) specified in the #Log Manager portlet. The number of log files to choose from the File pull-down menu will depend on the number of log files defined in the server-log4j.properties configuration file.

Lines ..to.. lets you specify a range of line of log to analyze. Max Results limits the number of lines to be displayed. Level displays only those errors occurred for that Log Level. Containing text lets you enter a specific string to search through the server log. With Exceptions by clicking this checkbox will be displayed not just the error but also the exception, the stack trace display will be limited to the number lines set by the Max Results value.

Back to Top

Derby Log Viewer

The Derby Log viewer portlet options are illustrated in the following figure. From this portlet you can view the Derby server logs as well as set filters for refining the results displayed.

The Refresh link on the upper left corner will reset any filtering criteria you may have specified to the Geronimo Administration Console's defaults and will display the last 10 lines (if any) of the current Derby server log.

Similar to the #Server Log Viewer portlet, the Filter Results: area will let you specify different filtering criteria to further narrowing down your search. Lines ..to.. lets you specify a range of line of log to analyze. Max Results limits the number of lines to be displayed and Containing text lets you enter a specific string to search through the server log.

Back to Top

Web Access Log Viewer

The Web Access Log Viewer portlet options are illustrated in the following figure. From this portlet you can view the Web server logs as well as set filters for refining the results displayed.

The Refresh link on the upper left corner will reset any filtering criteria you may have specified to the Geronimo Administration Console's defaults. In contrast with the other portlets, the Web Access Log Viewer will display all the lines in the log, it will just be limited by your Web browser display capabilities.

The Filter Results: area will let you specify different filtering criteria to further narrowing down your search. For the Web Access Log Viewer this area is divided in three main groups, Date, Identity and Requests.

  • Date:
    Lets you specify a date range. If the Ignore Dates checkbox is selected, filtering will not be done using the date. All log lines that match the other filtering criteria will be displayed regardless of the date.
  • Identity:
    Lets you specify Remote Address (i.e. 192.168.0.1) and Authenticated User (i.e. system).
  • Request:
    Lets you specify the Request Method from and the Requested URI. You can select the Requested Method from a drop-down menu, the possible values are ANY, POST and GET. To filter by Requested URI just enter a URI, for example http://localhost:8080/console/login.jsp.

Back to Top

Performance monitoring

For monitoring the Web server performance the Web Server Manager portlet is available by selecting Web Server on the Console Navigation menu on the left hand side. By default this portlet is not enabled, click on the enable button to start collecting statistics.

Once enable you will start collecting information on the number of requests, concurrent connections, requests duration, etc. The following figure illustrates all the values being collected.

The three links at the bottom let you refresh the current statistics, disable the portlet and stopping the collection of new data and reset the data collected.

Note that any request from you via the Geronimo Administration Console (for example refreshing statistics) will be reflected in this collection.

Back to Top

Adding new listeners for the Web containers

For configuring new listeners (HTTP, HTTPS and AJP) to the Web container in use (either Jetty or Tomcat) the Network Listener portlet is available by selecting Web Server on the Console Navigation menu on the left hand side. From this portlet you can add new listeners as well as change the status (stop, start, delete) of the existing connectors.

The processes described next are the same for both Jetty and Tomcat Web containers.

Add new HTTP listener

To add a new HTTP listener click on the respective link. The following figure illustrates the different parameters needed for creating a new HTTP listener. This process is very simple and the parameters are self explanatory, fill in with your values and click on Save.

Back to Top

Add new HTTPS listener

To add a new HTTPs listener click on the respective link. The following figure illustrates the different parameters needed for creating a new HTTPs listener. This process is very simple and the parameters are self explanatory, fill in with your values and click on Save.

Back to Top

Add new AJP listener

To add a new AJP listener click on the respective link. The following figure illustrates the different parameters needed for creating a new AJP listener. This process is very simple and the parameters are self explanatory, fill in with your values and click on Save.

Back to Top

Configuring the JMS server

For configuring the JMS Server, the JMS Network Listeners portlet is available by selecting JMS Server on the Console Navigation menu on the left hand side. When clicking on JMS Server you will be also presented with the JMS Server Manager portlet that displays the JMS brokers available in the server and theis status. The following figures illustrate these two portlets and options.

From the JMS Network Listeners portlet you can add new listeners as well as change the status (stop, start, delete) of the existing ones. The available options for adding connectors to ActiveMQ are already shown in the figure.

To add a new connector to ActiveMQ click on the appropriate link. The following figure illustrates the different parameters needed for creating these connectors. This process is very simple and the parameters are self explanatory, fill in with your values and click on Save.

Note that the same options will be presented independently of which listener you want to add.

Details on how to configure connection factories, queues, topics and destinations are covered in the next section #Configuring JMS.

Back to Top

Configuring Services

There are three majors tasks covered in this section, this tasks are:

  • Adding artifacts to the Geronimo repository
  • Configuring database pools
  • Configuring JMS

Adding artifacts to the Geronimo repository

For adding artifacts to the repository the Repository Viewer portlet is available by selecting Common Libraries on the Console Navigation menu on the left hand side. The Repository Viewer portlet illustrated in the following figure displays the artifacts installed in the server's repository. The layout of the repository is the same as that used by Apache Maven making it possible to easily copy files The over.

To use an artifact in an application, add a dependency element into it's deployment plan. For example, to use Castor XML add the following XML to the plan:

<dependency>
	<uri>castor/jars/castor-0.9.5.3.jar</uri>
</dependency>

Back to Top

Configuring database pools

To configure database pools, the Database Pools portlet is available by selecting Database Pools on the Console Navigation menu on the left hand side. The Database Pools portlet illustrated in the following figure shows all the available database pools and provides wizards for importing or creating new pools.

Create new database pools

You can create new pools by clicking on the Using the Geronimo database pool wizard link on the Database Pools portlet. This wizard will guide you through a four easy steps procedure.

Refer to Configuring DB2 Datasource for an additional working example on datasources with multiple jar (driver+license) files.

First you need to specify the name of the database pool and the database type.

Then you select the JDBC drivers which, by default, it has been pre-filled based on the database type you selected in the previous step. You also have to select the driver JAR from the pull-down menu and then specify the database name. For this example a test database was previously created, this is a single step procedure and it is explained in #Create a database.

The following step lets you configure some connection parameters such as pool size (min and max) and timeouts. Once you are satisfied with the paramenters click on Test Connetion.

When you successfully tested the connection, click on Deploy Pool. Alternatively you can click on Show Deployment Plan, this option shows you the deployment plan for this database pool and lets you edit it. This option also provides intructions on how to deploy manually this plan.

Back to Top

Import database pools from JBoss 4

Import database pools from WebLogic 8.1

Removing database pools

To remove the database pools you can use the Deployer tool. Among other things, this tool allows you to list the available modules, the pool you just deployed will be listed as a module.

To list all the available modules type the following command:

E:\geronimo\bin>deploy --user system --password manager list-modules | grep user/database

  + user/database-pool-Derby_Test/1/car

For this command example grep was used for display purposes, the use of grep is optional.

Once you identified the database pool (in this example user/database-pool-Derby_Test/1/car) you may remove by typing the following command:

E:\geronimo\bin>deploy --user system --password manager undeploy user/database-pool-Derby_Test/1/car

    Module user/database-pool-DerbyTest/1/car unloaded.

    Module user/database-pool-DerbyTest/1/car uninstalled.

    Undeployed user/database-pool-DerbyTest/1/car

As an additional step for verification the removal of the database pool you can run the following command, there should be no entries listed.

deploy --user system --password manager list-modules | grep Derby_Test

Back to Top

Create a database

To create a new embedded database in Geronimo the DB Manager portlet is available. Near the bottom of the Console Navigation menu you will see Misc -> Embedded DB -> DB Manager. This portlet trigers the DB Viewer and Run SQL portlets illustrated in the following figures.


The DB Viewer portlet displays all the available databases, their tables (application and system) and displays the contents of the tables.

The RunSQL portlet allows you to run SQL commands to create or delete databases and to modify the content of the tables. This portlet provides pull-down menus for selecting the database to which you want to run the command against.

To create a test database specify Derby_Test in the Create DB: field and click on Create. After a few seconds you should see a confirmation message near the bottom of the Run SQL portlet stating * Database created: Derby_Test*. You should see now the Derby_Test entry in the DB Viewer portlet.

If you want to run any SQL command on this database make sure you select Derby_Test from the Use DB: pull-down menu, enter the SQL command and then click on the Run SQL button. The results of the command will be displayed near the bottom of the protlet.

Configuring JMS

Connection factories, queues, topics and destinations.

Full detailed JMS configuration example is covered in the Configure JMS section.

Back to Top

Administering applications

Installing and removing applications

include hot deployment and redeployment

Starting and stopping application modules

Administering security

Adding security realms

Importing certificates

Back to Top

  • No labels