build and deploy your own erp powered by apache ofbiz erp on fedora 17 server v1.0

17

Upload: kefa-rabah

Post on 18-Apr-2015

1.460 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0
Page 2: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

1

Global Open Versity

IT System Integration Hands-on Labs Training Manual

Build and Deploy your own ERP Powered by Apache OFBiz ERP on Fedora 17 Server

Kefa Rabah

Global Open Versity, Vancouver Canada [email protected]

www.globalopenversity.org

Table of Contents Page No.

BUILD AND DEPLOY YOUR OWN ERP POWERED BY APACHE OFBIZ ERP ON FEDORA 17 SERVER 2

1.0 Introduction 2

Apache OFBiz™ 2

Part 1: Overview of Apache OFBiz 3 Technology of Apache OFBiz 3

Part2: Install Apache OfBiz ERP 4 Step 1: Downloading 4 Step 2: Installing Base Dataset 5

Option A: Installing Demo Data 5 Staring / Executing OfBiz 6

Option B: Installing Seed Data for Production Setup 9 Staring / Executing OfBiz 10

Part 3: Configuring OfBiz To Use A MySQL Database 13 Step 1: Configuring OfBiz 13 Step 2: Installing the JDBC Connector 15

Install the mysql-java-connector 15

A GOV Open Access Technical Academic Publications Enhancing education & empowering people worldwide through eLearning in the 21st Century

Page 3: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

2

Global Open Versity

IT Systems Integration Hands-on Labs Training Manual

Build and Deploy your own ERP Powered by Apache

OFBiz ERP on Fedora 17 Server

By Kefa Rabah, [email protected] October, 2012 GTS Institute

1.0 Introduction

Fedora formerly Fedora Core, is an RPM-based, general purpose collection of software, including an

operating system based on the Linux kernel, developed by the community-supported Fedora Project and

owned by Red Hat. The Fedora Project's mission is to lead the advancement of free and open source

software and content as a collaborative community.

Fedora is a Linux-based operating system that brings the latest in free and open source software to your

desktop, laptop and server, and gives you access to thousands of different open source applications. This

helpful, user-friendly operating system is built by people across the globe; who work together as a

community to create the Fedora Project. The current release of the operating system is Fedora 17,

codenamed "Beefy Miracle", which was released on May 29, 2012. Fedora released Fedora 18 alpha on

18 September 2012. The final release is currently predicted to be released on 2012-12-04.

Apache Open For Business (Apache OFBiz) is an open source enterprise resource planning (ERP)

system. It provides a suite of enterprise applications that integrate and automate many of the business

processes of an enterprise. By enterprise automation we mean: ERP, CRM, E-Business / E-Commerce,

MRP, SCM, CMMS/EAM, and so on.

Apache’s Open For Business (OFBiz) is one of the most promising open source ERP projects today.

Apache projects are known for their high quality and are being used in almost every computing

environment – either on the Internet or inside large organizations.

One can also run multiple shops on one instance of OFBiz. It can be useful to run multiple stores, even if

they are selling related products (specialized stores) or if you are a distributor and want to offer your

customers individual own stores (white labeling). Having only one system, which runs all of your stores

can save you a lot of money.

Apache OFBiz™

Apache OFBizTM (The Apache Open For Business Project) is an open source enterprise automation

software project licensed under the Apache License Version 2.0. By open source enterprise automation

we mean: Open Source ERP (Enterprise Resource Planning), Open Source CRM (Customer Relationship

Management), Open Source E-Business / E-Commerce, Open Source SCM (Supply Chain Management),

Open Source MRP (Manufacturing Resources Planning), Open Source CMMS/EAM (Maintenance

Management System/Enterprise Asset Management), Open Source POS (Point Of Sale), and so on.

Page 4: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

3

Apache OFBiz is a foundation and starting point for reliable, secure and scalable enterprise solutions. Use

it out-of-the-box (OOTB) or customize to suit even your most challenging business needs. With OFBiz in

place, you can get started right away and then grow your operations as your business grows, without the

huge deployment and maintenance costs of traditional enterprise automation systems.

Apache OFBiz is a project of The Apache Software Foundation.

Being open source under the Apache 2.0 license and driven by a community Apache OFBiz offers both

flexibility by design and by access to code, and a solution where you're not alone but rather can work with

many others to get things done.

If you plan to go to production with OFBiz, you should not use Derby – you can go for any other database

engine you like. The first database that comes to mind is MySQL, however, it's important to note that

MySQL JDBC has some licensing issues that you should checkout first before moving into production.

That does not mean you cannot use MySQL with OFBiz, but it does have implications if you intend to

resell a MySQL-OFfbiz solution.

Part 1: Overview of Apache OFBiz

Apache OFBiz is a framework, provides a common data model and a rich set of business process. All

applications are built around a common architecture using common data, logic and process components.

Beyond the framework itself, Apache OFBiz offers a huge range of functionality including:

• Accounting (Agreements, Invoicing, Vendor Management, General Ledger)

• Asset Maintenance

• Catalogue and Product Management

• Facility and Warehouse Management

• Manufacturing

• Order Processing

• Inventory Management, automated stock replenishment etc.

• Content management system (CMS)

• Human resources (HR)

• People and Group Management

• Project Management

• Sales Force Automation

• Work Effort Management

• Electronic point of sale (ePOS)

• Electronic commerce (eCommerce)

• Scrum (development) (Scrum software development support)

Technology of Apache OFBiz

All of Apache OFBiz functionality is built on a common framework. The functionality can be divided into

the following distinct layers:

Page 5: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

4

• Presentation Layer: Apache OFBiz uses the concept of "screens" to represent the Apache

OFBiz pages. Each page is, normally, represented as a screen. A page in Apache OFBiz consists

of components. A component can be a header, footer, etc. When the page is rendered all the

components are combined together as specified in the screen definition. Components might be

Java Server Pages ([JSP]s) <deprecated>, FTL pages built around FreeMarker template engine,

Forms and Menus Widgets. Widgets are an OFBiz specific technology.

• Business Layer: The business, or application layer defines services provided to the user. The

services can be of several types: Java methods, SOAP, simple services, workflow, etc. A service

engine is responsible for invocation, transactions and security. Apache OFBiz uses a set of well

established, open source technologies and standards such as Java, Java EE, XML and SOAP.

Although Apache OFBiz is built around the concepts used by Java EE, many of its concepts are

implemented in different ways; either because Apache OFBiz was designed prior to many recent

improvements in Java EE or because Apache OFBiz authors didn’t agree with those

implementations.

• Data Layer: The data layer is responsible for database access, storage and providing a common

data interface to the Business layer. Data is accessed not in Object Oriented fashion but in a

relational way. Each entity (represented as a row in the database) is provided to the business

layer as a set of generic values. A generic value is not typed, so fields of an entity are accessed

by the column name.

Hands on Lab

In this Hands-on Labs module, it is assumed that you know how to install and configure Linux Fedora 17.

In this hands on lab, you'll learn how to install and configure Apache OFBiz server with live demo data

loaded which you can use for testing, training and capacity building. You'll also learn how to install OFBiz

with an empty system (only seed data loaded). We'll guide you on how to enter your company information,

first catalog, category and product and customer to make the system ready for production. Upon

completion of this hands on lab, you should have gained expertise and capability to install and maintain

Apache OFBiz server.

Part2: Install Apache OfBiz ERP

OfBiz is an open source ERP/CRM system from the Apache Foundation offering complete

accounting/ledger, inventory management, CRM, and project management systems. Also OfBiz includes

a complete CRM system and ecommerce shopping cart. OfBiz offers a solid framework for plugin

development allowing complete customization. Using OfBiz allows small businesses to compete with

larger competitors without the large investments in SAP or Oracle installations.

Step 1: Downloading

1. The best way to download OfBiz is to checkout the latest build from the subversion (svn) repository

and then build it using ant.

2. Let's first install the pre-requisites:

Page 6: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

5

yum install svn \\if not installed

yum install ant

$ svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz

3. Change to ofbiz directory and issue the ant command:

cd ofbiiz

ant

Fig. 1

Step 2: Installing Base Dataset

There is a demo dataset that comes with OfBiz. This is the recommended configuration while

experimenting with OfBiz. For production installations installing the minimal seed data is preferred.

Option A: Installing Demo Data

The demo data contains a complete example installation of OfBiz. This complete company has a store,

example vendors, warehouse, content, etc. This data is an invaluable reference when building a

production enterprise.

4. To install the demo data run, (when done you should be presented with BUILD SUCESSFUL display

as shown in Fig. 3)

# cd ofbiiz

# ant run-install

or

# java -jar ofbiz.jar -install

Page 7: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

6

Fig. 2

5. As per the instruction above run, (when done you should be presented with BUILD SUCESSFUL

display as shown in Fig. 3)

# ant load-demo

Fig. 3

6. You're done with this section.

Staring / Executing OfBiz

7. Now that OfBiz has been built and configured it's time to start OfBiz.

# ant start

or

Page 8: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

7

# ./startofbiz.sh

8. Once OfBiz has started point a browser to http://HOSTNAME:8080/myportal/control/main/ . If the

demo data was loaded the default login is 'admin' with a password of 'ofbiz'. Click on the "I

Understand the Risks" link and follow the instruction to access the main page for the ofbiz server.

Fig. 4

9. When done with the security exception above, you should be brought to the ofbiz login page as

shown in Fig. 5.

Page 9: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

8

Fig. 5

10. You should be logged in as shown in Fig. 6.

Fig. 6

Page 10: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

9

11. To view available applications, click on the dropdown menu, as shown in Fig.

7.

Fig. 7

Option B: Installing Seed Data for Production Setup

The seed data is the recommended dataset to install for a production setup. This just builds the database

and prepares the OfBiz backend for use. No default companies or accounts are created.

1. To install the seed data run

# cd ofbiiz

# ant run-install-extseed

or

# java -jar ofbiz.jar -install -readers=seed,ext

Page 11: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

10

Fig. 8

2. As per the instruction of Fig. 8 above run, (when done you should be presented with BUILD

SUCESSFUL display as shown in Fig. 9)

# ant load-extseed

Fig. 9

3. Then create the administrative account

# ant create-admin-user-login

when prompted, enter username, in our case ′admin′ with temporary password ′ofbiz′, when done

you should be presented with BUILD SUCESSFUL display as shown in Fig. 10)

Fig. 10

Staring / Executing OfBiz

4. Now that OfBiz has been built and configured it's time to start OfBiz.

# ant start

or

# ./startofbiz.sh

you should be presented with the display shown in Fig. 11.

Page 12: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

11

Fig. 11

Once OfBiz has started point a browser to http://HOSTNAME:8080/myportal/control/main/ . Follow

the security exception s in the previous case, when done you should be presented with login screen,

(ogin with username 'admin' with a password of 'ofbiz'. You should next be presented with the

change of password screen as shown in Fig. 12.

Fig. 12

5. You should be logged in as shown in Fig. 13.

Page 13: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

12

Fig. 13

6. To view available applications, click on the dropdown menu, as shown in Fig.

14.

Page 14: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

13

Fig. 14

7. You're done with this section.

Part 3: Configuring OfBiz To Use A MySQL Database

While OfBiz ships with the capable Derby database you might decide you want to use another database

such as MySQL. OfBiz can easily be configured to use a variety of external database sources through

fairly simple configuration changes. The entityengine.xml file will have to be edited and the appropriate

JDBC connector will have to be installed.

Step 1: Configuring OfBiz

The first thing to do is to edit ″{ofbiz}/framework/entity/config/entityengine.xml″. Scroll

through the file, take note of the delegator entries. These are used for declaring the different data store

types available and selecting the one to use. The "default" one is the one that OfBiz uses. Verify there is a

field type entry for the database you plan on using.

1. Basic derby delegator:

<delegator name="default" entity-model-reader="main"

entity-group-reader="main" entity-eca-reader="main"

distributed-cache-clear-enabled="false">

<group-map group-name="org.ofbiz"

datasource-name="localderby"/>

<group-map group-name="org.ofbiz.olap"

Page 15: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

14

datasource-name="localderbyolap"/>

</delegator>

2. Basic MySQL delegator:

<delegator name="default" entity-model-reader="main"

entity-group-reader="main" entity-eca-reader="main"

distributed-cache-clear-enabled="false">

<group-map group-name="org.ofbiz"

datasource-name="custommysql"/>

<group-map group-name="org.ofbiz.olap"

datasource-name="customolapmysql"/>

</delegator>

The datasource entries are the database connection and configuration definitions for each data store type.

Look at the derby statements, notice there's three of them. The ofbiz store, the odbc connector, and the

olap (online analytic processing) store. Make a copy of the entire datasource statement for the database

being deployed. There's no need to copy the odbc datasource.

3. Example MySQL datasource statement:

<datasource name="custommysql"

helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"

field-type-name="mysql"

check-on-start="true"

add-missing-on-start="true"

check-pks-on-start="false"

use-foreign-keys="true"

join-style="ansi-no-parenthesis"

alias-view-columns="false"

drop-fk-use-foreign-key-keyword="true"

table-type="InnoDB"

character-set="latin1"

collate="latin1_general_cs">

<read-data reader-name="seed"/>

<read-data reader-name="seed-initial"/>

<read-data reader-name="demo"/>

<read-data reader-name="ext"/>

<inline-jdbc

jdbc-driver="com.mysql.jdbc.Driver"

jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"

jdbc-username="ofbiz"

jdbc-password="ofbiz"

isolation-level="ReadCommitted"

pool-minsize="2"

Page 16: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

15

pool-maxsize="250"/>

<!-- <jndi-jdbc jndi-server-name="localjndi"

jndi-name="java:/MySqlDataSource" isolation-

level="Serializable"/> -->

</datasource>

4. Next adjust the jdbc-username & jdbc-password, and set the mysql host and database name in the

jdbc-uri line. Make a copy of this new datasource and append olap to the database name in the jdbc-

uri line.

Step 2: Installing the JDBC Connector

For OfBiz to be able to connect to the database an appropriate JDBC connector must be installed into

″{ofbiz}/framework/entity/lib/jdbc/″. JDBC connectors are usually provided by the database

provider.

Install the mysql-java-connector

5. First download the connector from http://dev.mysql.com/downloads/connector/j/ and uncompress the

archive. Then copy ″mysql-connector-java-X.X.X-bin.jar″ to

″{ofbiz}/framework/entity/lib/jdbc/″.

# cp mysql-connector-java-X.X.X-bin.jar {ofbiz}/framework/entity/lib/jdbc/

6. Next create the ofbiz and ofbizolap databases and associated accounts declared in the

datasource statements. The databases will be populated during the and install, ″run-install-

seedext″, etc.

7. Prepare database <create database ,grant user>

mysql> create database ofbiz; Query OK, 1 row affected (0.05 sec) mysql> create database ofbizolap; Query OK, 1 row affected (0.05 sec) mysql> grant all on *.* to 'ofbizuser'@'localhost' identified by 'mypass'; Query OK, 0 rows affected (0.03 sec) mysql>

8. Now we're ready to run ant to load database into mysql. Let's go.

[admin@localhost ofbiz]$ ./ant run-install ... [java] 2008-06-19 10:59:06,245 (main) [ ContainerLoader.java:114:INFO ] Shutting down containers

Page 17: Build and Deploy Your Own ERP Powered by Apache OfBiz ERP on Fedora 17 Server v1.0

Global Open Versity ICT Labs Build & Deploy your own ERP Powered by Apache OFBiz on F17 Server v1.0

April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org ICT203 - Mastering CentOS/RHEL Server Administration & System Integration

16

BUILD SUCCESSFUL Total time: 5 minutes 25 seconds [admin@localhost ofbiz]$

Fellow us on Twitter: Global Open Versity and Kefa Rabah

-----------------------------------------------

Kefa Rabah is the Founder of Global Technology Solutions Institute. Kefa is knowledgeable in several

fields of Science & Technology, Information Security Compliance and Project Management, and

Renewable Energy Systems. He is also the founder of Global Open Versity, a place to enhance your

educating and career goals using the latest innovations and technologies.