Downloads
Reference

网记家园

Support This Project

DLOG4J多用户博客

  • Introduction
    • STEP 1: Prerequisites [1]
    • STEP 2: Unpack the downloaded ZIP or TAR file [2]
    • STEP 3: Create Dlog4j tables in your database [3]
    • STEP 4: Deploy Dlog4j to your app servr [4]
    • STEP 5: Modify the configure file [5]
    • STEP 6: Start Tomcat and Dlog4j [6]
    • STEP 7: Finishing Touches [7]

     

    This document describes how to install the Dlog4j Version 1.4 on the Tomcat Servlet Engine and assumes the following configuration.

    • Java 1.4.X SDK or later
    • Tomcat 4.X or 5.X Servlet Container (NOT a Tomcat "LE" release)
    • A MySQL 4.X or later database
    • Windows or UNIX based operating system

    What about other servlet containers? These instructions favor Tomcat, but with some expertise you should be able to make Dlog4j work on any Servlet API 2.3 compatible Servlet Container (e.g. Weblogic, WebSphere, Jetty, Resin, ...).

    What about other databases? These instructions favor MySQL, but Dlog4j also includes database setup scripts for HSQL-DB. With some expertise you should be able to make Dlog4j work on any JDBC accessible database (e.g. Oracle, Informix, Sybase, MS SQL Server, ...).

    STEP 1: Prerequisites

    Before you install the Dlog4j software you need to make sure you have installed your Java SDK, your Servlet Engine, and your database installed and configured on your system.

    STEP 2: Unpack or Build the downloaded file

    If you downloaded the source code, you can do like this(and you need ant tool):

    UNIX/Linux:

    1. using "./build.sh" to compile project

    2. copy dist/dlog4j.war to {tomcat}/webapps or other application servers

    Windows:

    1. using "build" to compile project

    2. copy dist/dlog4j.war to {tomcat}/webapps or other application servers

    if you downloaded the Binaries,copy the file to {tomcat}/webapps or other application servers.

    Unzip the file.

    STEP 3: Create Dlog4j tables in your database

    Now you need to create a new database, create a user with appropriate privileges, and use an SQL script to create the database tables required to run Dlog4j. To do this, login to your database and run one of the Dlog4j database creation scripts located in Dlog4j's doc/database directory.

    • doc/database/dlog4j_mysql_323.sql - creates tables for MySQL
    • doc/database/dlog_DB2.sql - creates tables for DB2
    • doc/database/dlog_oracle.sql - creates tables for oracle

    If you use the HSQL DB ,you will do nothing on this step.

    The examples below show you how you might do this using MySQL, assuming your Dlog4j user will have username dlog4j and password dlog4j.

    UNIX example

      % cd $webapps/doc/database
      % mysql -u root -p
      password: *****
      mysql> create database dlog4j;
      mysql> grant all on dlog4j.* to dlog4j@'localhost' identified by ‘dlog4j’;
      mysql> flush privileges
      mysql> use dlog4j;
      mysql> source dlog4j_mysql_323.sql
      mysql> quit

     

    Windows example, from an MS-DOS or Command Prompt window:

      C> cd %webapps\doc\database
      C> mysql -u root -ppassword: *****
      mysql> create database dlog4j;
      mysql> grant all on dlog4j.* to dlog4j@'%' identified by 'dlog4j';
      mysql> flush privileges
      mysql> use dlog4j;
      mysql> source dlog4j_mysql_323.sql
      mysql> quit

     

    STEP 4: Deploy Dlog4j to your application server

    Deploy Roller to your J2EE application server. You have to do this:

    Tell app server where to find Roller's install directory

    Example: For Tomcat users, this means editing the Tomcat Servlet engine's conf/server.xml (tomcat 4) or conf/Catalina/yourHost/somefile.xml (tomcat 5) configuration file to add a the Dlog4j Servlet Context.

      <Context path="/dlog4j" reloadable="true" docBase="full path"/>

     

    STEP 5: Modify the configure file

    Some final steps before you startup...

    Step 5.1: Configure the Deployment Descriptor Elements

    If you use the tomcat 4.x, you need to uncomment this content.

      <init-param>
          <param-name>encoding</param-name>
          <param-value>GBK</param-value>
      </init-param>

     

     

    if you don’t use the HSQL Engine, you must be comment the content, otherwise you can jump to the step6.

      <!--

      <servlet>
          <servlet-name>HSQLEngine</servlet-name>
          <servlet-class>dlog4j.hsqldb.HSQLEngineServlet</servlet-class>
          <init-param>
              <param-name>path</param-name>
              <param-value>/WEB-INF/db</param-value>
          </init-param>
          <init-param>
              <param-name>port</param-name>
              <param-value>9001</param-value>
          </init-param>
          <init-param>
              <param-name>database</param-name>
              <param-value>dlog4j</param-value>
          </init-param>
          <load-on-startup>1</load-on-startup>
      </servlet>

      -->

     

     

    Step 5.2: Data Source Configuration

    Configure a datasource for your database(mysql).

      <data-source type="org.apache.commons.dbcp.BasicDataSource">

      <set-property property="driverClassName" value=" com.mysql.jdbc.Driver" />

      <set-property property="url" value=" jdbc:mysql://localhost:3306/dlog4j" />

      <set-property property="username" value="dlog4j" />

      <set-property property="password" value="dlog4j" />

      <set-property property="maxActive" value="20" />

      <set-property property="maxWait" value="5000" />

      <set-property property="defaultAutoCommit" value="false" />

      <set-property property="defaultReadOnly" value="false" />

      <!--

      <set-property property="validationQuery" value="SELECT 1 FROM dlog_site" />

      -->

      <set-property property="removeAbandoned" value="true" />

      <set-property property="removeAbandonedTimeout" value="120" />

      <set-property property="encoding" value="true" />

      </data-source>

     

    STEP 6: Start Tomcat and Dlog4j

    Start your Servlet Container, open your web browser, browse to the Dlog4j start page and start using Dlog4j.

    If you are installing Dlog4j on Tomcat then your Dlog4j start page URL is probably http://localhost:8080/dlog4j.

    UNIX example:

       

      % cd $CATALINA_HOME/bin

      % ./startup.sh

       

     

    windows example:

       

      C> cd %CATALINA_HOME%\bin

      C> startup

       

     

    Step 7: optional steps

    Configure the mail sender:In the struts-config.xml.

       

      <plug-in className="dlog4j.plugins.MailPlugin">
          <set-property property="sender" value="dlog4j@gmail.com"/>
      </plug-in>

       

     


Copyright ©2004 Winter Lau, All Rights Reserved