Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updates keystore and password locations


Info
titlePre Gradle version

This page documents the usage with Gradle, the pre-Gradle documentation is here: Apache OFBiz Technical Production Setup Guide

This page documents the trunk version, the documentation for the R16.11 version is here: Apache OFBiz Technical Production Setup Guide

NOTE: this is the technical setup guide for OFBiz, for the business oriented one, look here

...

  1. If you decide not to use the embedded Derby database, check/install your database of choice. See below for some information that may help with using or installing OFBiz with alternative databases

    Changing from Derby to MySQL Database
    OFBiz and Oracle
    Connecting OFBiz to PostGIS spatially enabled database
    Switching from a Derby database to another

  2. If necessary, put the correct JDBC driver in the following directory:

    1. ${ofbiz install dir}/framework/entity/lib/jdbc (NOTE: download the last mySQL jdbc driver)
    2. Replace the old or incorrect version of the driver (i.e. copy in with same name to avoid problems with update restoring the old driver later)

  3. To setup the Entity Engine to use a different database from the default Derby database.
    In the: ${ofbiz install dir}/framework/entity/config/entityengine.xml file:
    •  Modify the "localpostgres" (or  "localmysql", etc.) datasources elements to connect to your database.
    •  Modify the "default" delegator element:

          Change
              <group-map group-name="org.apache.ofbiz" datasource-name="localpostgreslocalderby"/>
          to
              <group-map group-name="org.apache.ofbiz" datasource-name="localpostgreslocalpostgres"/>

    •     The OLAP and Tenant data sources will still use Derby. If you want to change those to use PostgreSQL also, then:

      • Modify the "localpostgresolap" datasource element to connect to your OLAP database.

      • Modify the "localpostgrestenant" datasource element to connect to your Tenant database.

    • Modify the "default" delegator element:

          Change
              <group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>
          to
              <group-map group-name="org.apache.ofbiz.olap" datasource-name="localpostgresolap"/>
          Change
              <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>
          to
              <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localpostgrestenant"/>

    • Modify an existing datasource (near the bottom of the file) or create a new one by copying one of the sample datasources already there and giving it a new unique name

...

Run one of the following two options from the command line in the ofbiz home directory to run the default install routine:

Code Block
 

or

Code Block
java -jar build/libs/ofbiz.jar --load-data

Help can be obtained by by the following command:

Code Block
 

Note that you can choose to only load the basic "seed" data and not load the "demo" set of data files. To do this run something like:

Code Block
 
[./]gradlew loadAll (add "./" on *nix systems, to use the embedded Gradle which comes with its wrapper, hence gradlew and not gradle in the command). 
Do this from the ofbiz home directory (i.e. the directory where you installed OFBiz). Note: you can get more information about Gradle task using "gradlew tasks".
or
java -jar build/libs/ofbiz.jar --load-data

Help can be obtained by by the following command:

Code Block
gradlew "ofbiz -help"
or
java -jar build/libs/ofbiz.jar ?

Note that you can choose to only load the basic "seed" data and not load the "demo" set of data files. To do this run something like:

Code Block
gradlew "ofbiz --load-data readers=seed,seed-initial"
or
java -jar build/libs/ofbiz.jar --load-data readers=seed,seed-initial

Definition: Seed Data is data that an application requires in order to run. Definition: Seed Data is data that an application requires in order to run. It is created and maintained along with the code and should be loaded into the database when the code is updated. It should not be changed or removed in the application database without first having done so in the Seed Data XML files. In OFBiz these are the source of the Seed Data and they are maintained in the code repository along with the code. Add in components should do the same for this sort of data.

...

To load the "seed" and "ext" groups run something like:

Code Block
gradlew "ofbiz --load-data readers=seed,ext"
or
java -jar build/libs/ofbiz.jar --load-data readers=seed,ext

...

Code Block
 

The OFBiz demo data includes a Party with ID "admin" and it has a number of UserLogin accounts associated with it that have varying permissions.

...

Fresh from SVN, this file is configured to be development friendly to reload resources frequently. For production use the expire times for the caches in the last section of the file should all be commented out by putting a pound hashtag sign "#" at the beginning of each line. The properties in question start with "minilang.", "script.", "webapp.", "widget." And "template.".

...

Info

Log4J is the engine used by OFBiz to manage its log output. The releases 13.07.*, 12.04.*, 11.04.*, 10.04.* use Log4J 1 (the configuration file is named log4j.xml) while newer releases are bundled with Log4j2 (the configuration file is named log4j2.xml).

For information about advanced configuration of Log4j refer to:

 


Security Settings

${ofbiz install dir}/framework/security/config/security.properties

...

If you want the entire authentication process to fail if LDAP authentication fails, then set the security.ldap.fail.login property in ${ofbiz install dir}/framework/security/config/security.properties to true. Only users who are in the LDAP directory will be able to use OFBiz. This would be appropriate for installations that use only the back office (manager) applications.manager) applications.

Info
titleVulnerabilities
 Be sure to always check the Keeping OFBiz secure page for possible vulnerabilites

URL and Port Settings

The following configuration files contain port configuration configurations that may configured for custom OFBiz installations:

...

.
You may also use the global portoffset Java properties. Use "gradlew "ofbiz ?" or "java -jar build/libs/ofbiz.jar -h" to know more about this option.

  • ${ofbiz install dir}/framework/base/config/ofbiz-containers.xml (The Containers Configuration File)xml (The Containers Configuration File)
  • Deprecated in recent versions: Sometimes other container configuration files are used, but are generally in that same directory and will be specified in the start properties file used (see start.properties, pos.properties, install.properties, etc)
  • The commented out BSH client (the last container in the file) should generally be disabled or at least protected by a firewall for production deployments. Otherwise this is a significant security risk.
  • Note that if an external application server is used instead of the embedded Tomcat or Jetty servers then many things normally configured here will be configured in the setup files for the external application server.
  • ${ofbiz install dir}/framework/webapp/config/url.properties (The URL Properties File)
    • These properties are used to configure the settings to send to the client browser. The port and host settings may be different than the port and host settings of the local machine if it is running through Apache through AJP, through any proxy, or through a load balancer of any sort. The settings in this file should be set to what the client browser will see when communicating with your system.
    • Note that the settings in this file can be overridden on the WebSite record with the ID specified by the webSiteId field in the web.xml file in each webapp, if applicable. These can be viewed and modified in the WebSites tab of the Content Manager application.

...

  • To ease development (Out Of The Box, OFBiz is configured in development mode) the compressHTML properties in general.properties if OFF. If you prefer to strip unnecessary whitespace from HTML output you can set it on ON (uncomment the line "#compress.HTML=true"). Note that, that non html output screens like for example tab delimited exports can be then messed up. Note also that it is NOT the same thing as gzipped HTTP 1.1 compression.
  • For the same reason (development mode) the line "widget.verbose=true" is uncommented. If you do not want to see any informations about widget boundaries in the generated HTLM code, you should comment this line.

Ports, Default Values

  • Admin Port - 10523
    • Configured in: start.properties File
    • Referenced in: Config.java File
  • HTTP - 8080
    • Configured in: ofbiz-containers XML File
    • Referenced in: Service Engine XML File, Client Browser (if running direct), URL Properties File
  • HTTPS - 8443
    • Configured in: ofbiz-containers XML File
    • Referenced in: Client Browser (if running direct)
  • AJP13 - 8009
    • Configured in: ofbiz-containers XML File
    • Referenced in: Apache mod_jk plugin configuration
  • JRMP (JNDI, RMI, etc) - 1099
    • Configured in: Carol Properties (carol.jrmp.url)
    • Referenced in: Containers XML File, JNDI Properties File, Service Engine XML File
  • BSH Client - 9989, 9990 (this should generally be disabled or at least protected by a firewall)
    • Configured in: ofbiz-containers XML File
  • Multicast ports - 45564, etc. (Tomcat clustering)
    • Configured in: ofbiz-containers XML File

...

"keytool -import -alias ssl -trustcacerts -file mysignedcert.cer -keystore [keystore name]"

6. Configure the the framework\catalina\ofbiz-containerscomponent.xml file to point to your new keystore and password:

...

If you are having trouble getting OFBiz to connect to your mail server, try disabling your anti-virus software (temporarily) as it may block attempts to send emails from unknown applications because it thinks they are being sent by a virus.

Another possible issue is the presence in database of SystemProperty data that could overload general.properties configuration. Be sure to check the absence of mail property in SystemProperty table.

Mounting a Root WebApp

It is often desirable to have one of the webapps mounted on the root. This is often either the ecommerce webapp or your own web site, which is created as a webapp in an OFBiz component would be setup the same way.

...

On the command line this can be as simple as (but beware you might need to pass specific JVM arguments, like "-server" if you develop on Windows, see

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-7321
):

Code Block
 

or through Gradle:

Code Block
 
gradlew ofbiz
or
java -jar build/libs/ofbiz.jar

To access the application from your browser follow advice given in the Demo and Test Setup Guide

...

To run all automated tests use the following command:

Code Block
 gradlew testIntegration
or
java -jar build/libs/ofbiz.jar -t

To run just the tests for one component run something like (for the entity component):

Code Block
 gradlew "ofbiz --test component=entity"
or
 java -jar build/libs/ofbiz.jar --test component=entity

Performance Monitoring and Tuning

...