Sie sind auf Seite 1von 18

Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.

Global Open Versity


Systems Integration Hands-on Lab Training Manual

Using SugarCRM with OpenDS on JBoss Portal for SSO

Kefa Rabah
Global Open Versity, Vancouver Canada
krabah@globalopenversity.org
www.globalopenversity.org

Table of Contents Page No.

USING SUGARCRM WITH OPENDS ON JBOSS PORTAL FOR SSO 2

Part 1: Install JBoss Server and OpenDS 2


Step 1: Install JBoss Server 2
Step 2: Preparing the LDAP directory & Provision LDAP with Sample Data. 3
1: OpenDS Setup 3
2: Install LDAPBROWSER 4
Step 3: JBoss Portal Setup 6
Step 4: Configure JBoss Portal LDAP support 7
Step 5: Basic Testing of Integrated OpenDS & JBoss Portal 7

Part 3: Install & Configure SugarCRM on XAMPP 11


Step1: Install XAMP Server 11
Step 2: Install SugarCRM on XAMPP 12

Part 4: Putting it all Together: SugarCRM with OpenDS and JBoss 15

1
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

Global Open Versity


Systems Integration Hands-on Lab Training Manual

Using SugarCRM with OpenDS on JBoss Portal for SSO

By Kefa Rabah, krabah@globalopenversity.org April 17, 2009

Introduction
JBoss Application Server (or JBoss AS) is a free software/open-source Java EE-based
application server. It’s the #1 most widely used Java application server on the market.
JBoss AS enables you deploy more applications, and manage them more cost-effectively.
Update more business processes, faster. And integrate more services and data on the go
effectively increasing your ROI.

OpenDS is an open source community project building a free and comprehensive Java LDAP
based directory service which gives you the capability for Single-Sign-On (SSO) across your
network.

XAMPP from apache friends - is an easy to install Apache distribution containing MySQL,
PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and
start.

SugarCRM is the market-leading, commercial Open Source customer relationship


management (CRM) application. SugarCRM’s Open Source architecture easily adapts to any
business environment by offering a more flexible, cost-effective alternative than proprietary
applications. It offers a complete CRM system for businesses of all sizes. For a small
business SugarCRM can be a huge time and expense saver. It requires minimal technical
knowledge to get it installed and the built in web administration console and backup system
allow you to feel comfortable that it’s going to keep running. Core SugarCRM functionality
includes sales automation, marketing campaigns, support cases, project mgmt, calendaring
and more. Built in PHP, supports MySQL, SQL Server and LDAP support allows it that cool
functionality LAMP system.

In this Hands-on Systems Integration Training Lab, we’re going undertake a step-by-step
installation, configuration and finally integration of these systems on Linux CentOS5 server
running on VMware machine.

Part 1: Install JBoss Server and OpenDS

Step 1: Install JBoss Server


The goal of this hands-lab is to provide step by step instructions on how to integrate and
configure JBoss Portal with LDAP support. The OpenDS LDAP server is used as a user store.
You will learn the basic configuration that needs to be done to leverage a directory server in
your portal deployment. Before we start you will need to get the following packages:

1. JBoss Portal sources:


The best way to obtain latest JBoss Portal 2.6 sources is to use Subversion:

2
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

$ svn co http://anonsvn.jboss.org/repos/portal/tags/JBoss_Portal_2_6_0/ jboss-portal-2.6

2. JBoss Application Server 4.2.3.GA.

It can be downloaded from here: http://labs.jboss.com/jbossas/downloads

You need to download the .zip version and simply unpack it somewhere on your disk.
Before you proceed, the 'JBOSS_HOME' environment variable should be set to point to
directory containing unpacked archive. Under Linux you can use:

$ export JBOSS_HOME=/usr/JBoss/jboss-4.2.3.GA

For complete JBoss setup HowTo, check out our blog URL www.serengetisys.com/blog
or else within scrbd.com by the same author.

3. Run JBoss AS:

$ cd $JBOSS_HOME/bin
[bin]$ ./run.sh

Step 2: Preparing the LDAP directory & Provision LDAP with Sample Data.

1: OpenDS Setup
1. In this tutorial we'll use OpenDS directory server. Download the QuickSetup.jnlp
version to your temp directory.
2. Locate the package and double-click it to start the installation process and follow the
installation Wizard the instruction.
3. I use port 10389, use "password" as password, Directory Base DNS:
"dc=example,dc=com";
4. Do not pre-populate with random use. Instead "Import Data from LDIF file"
option. You will find ldif containing sample LDAP tree in portal sources (jboss-
portal-2.6/identity/src/resources/example/portal-sample-local.ldif), see
figure below.

3
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

5. The final setup page should look like the figure shown below:

6. Click "Launch Control-Panel" to startup your OpenDS server listening on port 10389,
or via cmd type:

/usr/OpenDS/bin/control-panel

from the OpenDS Control Pane > Server Status click Start to start the OpendDS
server, and enter your credentials to logon.

2: Install LDAPBROWSER
1. At the moment you should have an instance of the OpenDS LDAP server listening on
port 10389.
2. To be able to use it with portal we need to provision it with sample data. To do this
we'll use simple LDAP tool with GUI written in Java – the LDAP Browser/Editor. It's
a very lightweight tool that runs on many environments. Follow installation notes
specified here: http://www.openchannelsoftware.com/projects/LDAP_Browser_Editor
3. You will simply need to download the archive, unpack it and run the lbe.sh or
lbe.bat script (assuming that you have the java command in your operating system
path).
4. My standard setup puts the unarchived app code into a directory called
/usr/ldapbrowser, which I normally create by simply copying Browser282b2.tar.gz
to /usr and doing a tar xvzf on it right there
5. Next cd to the installed directory, and run the ./lbe.sh on Linux or double-click
lbe.bat on windows script to start the ldapbrowser
6. If you are using Fedora Linux you can also find 'lbe' rpm package in Dries repository.
7. Run LDAP Browser/Editor, and choose menu File > Connect

4
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

• Change to 'Quick Connect' tab and enter following information:


• host: localhost
• port: 10389
• leave 'Base DN' empty
• uncheck 'Annonymous bind' checkbox
• user DN: cn=Directory Manager
• password: password
• click 'Connect'

8. You should be able to see the imported LDAP tree.

5
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

9. Shutdown JBOSS AS:

$ cd $JBOSS_HOME/bin
[bin]$ ./shutdown.sh -S

Step 3: JBoss Portal Setup


JBoss Portal leverages OpenDS for unit tests so in the source distribution you can find an
embedded directory server that can be deployed on JBoss Application Server.

1. Build JBoss Portal sources by doing:

[jboss-portal-2.6] $ ./build/build.sh

This may take a while as all necessary libraries have to be downloaded from a library
repository. During this tutorial we'll assume that you’re using Linux. But you will also
find proper '.bat' scripts for Windows operating system as well.

2. Deploy OpenDS directory server

[jboss-portal-2.6] $ ./identity/build.sh deploy-ldap

this will copy necessary files into the JBoss AS pointed by 'JBOSS_HOME'
environment variable.

6
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

Step 4: Configure JBoss Portal LDAP support

JBoss is preconfigured to work with a locally deployed OpenDS. To enable LDAP support only
tiny modification is needed:

1. Edit file jboss-portal-2.6/core/src/resources/portal-core-sar/META-INF/jboss-


service.xml and change following line:

'conf/identity/identity-config.xml'
to
'conf/identity/ldap_identity-config.xml'

You will find configuration details in jboss-portal-2.6/core/src/resources/portal-core-


sar/conf/identity/ldap_identity-config.xml

2. Install JBoss Portal:

[jboss-portal-2.6] $ ./build/build.sh deploy-all


[jboss-portal-2.6] $ ./core/build.sh datasource
[jboss-portal-2.6] $ cp ./core/output/resources/setup/portal-hsqldb-
ds.xml $JBOSS_HOME/server/default/deploy/

3. Run JBoss Portal

$ cd $JBOSS_HOME/bin
[bin] $ ./run.sh

Step 5: Basic Testing of Integrated OpenDS & JBoss Portal

• Ensure first that no server is running


• Start OpenDS server
• Start JBoss Portal
• If portal starts clean and lets you log in as admin then it verifies that the setup is
correct.
• Try modifying some property of any user through Identity Management Portlet
such as email address. You should be able to see the change through LDAP
browser on LDAP server as well.

1. At the moment JBoss Portal should store identity related data in LDAP store. Let's
check it out.

2. Open your browser and go to http://localhost:8080/portal

Click Login link and enter your credentials

7
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

3. Login as user 'jduke' with password 'theduke'. This is the user account we added
into LDAP in previous steps.

4. On the bottom left hand side of the page, click on the 'Edit your profile' link.
5. In the 'Real e-mail' field enter 'testemail@email.com' and click 'Save changes'
button at the bottom.
8
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

6. Refresh the view in LDAP Browser and check that new email address was updated
in proper user entry
7. Logout from portal and login back as user 'admin' with password 'admin'.
8. Click on the 'Admin' link in the top right corner and go into 'Members' tab.
9. Click on the 'Create User Account' link.

9
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

10. Fill in the form to create user account for scrmuser & click 'New user registration'
11. Verify in LDAP Browser that new user entry was added to the directory

12. Try to login with username and password you specified for the new account, logout.
13. Log back with admin account and again click the 'Members' tab – from here you can
also list and manage all the users that are present in LDAP, e.g., from user role click
members link.

10
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

14. It’s also possible to assign specific roles to them. For example, we can assign user
srcmuser an Admin role. Try it out!

Part 3: Install & Configure SugarCRM on XAMPP


To avoid the nightmarish scenario of struggling with the LAMP setup on Linux, we will just
use the XAMP open source LAMP, which comes pre-configured.

Step1: Install XAMP Server


XAMPP is a LAMPP package developed by Apache Friends. Many people know from their own
experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL,
PHP and Perl as you can see from Method I above.

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very
easy to install and to use - just download, extract and start.

1: Download

Download XAMPP from http://www.apachefriends.org/en/xampp.html. Choose option for your favorite OS,
mine is Linux. The latest package as of this writing is: xampp-linux-1.7.tar.gz.

2: Installation

After downloading simply type in the following commands:

1. Go to a Linux shell and login as the system administrator root:

# su \\ to change to root user


11
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

2. Extract the downloaded archive file to /opt:

# tar -xvzf xampp-linux-1.7.tar.gz -C /opt

Warning: Please use only this command to install XAMPP. DON'T use any Linux tools to extract
the archive, it won't work.

Warning 2: already installed XAMPP versions get overwritten by this command.

That's all. XAMPP is now installed below the /opt/lampp directory.

3. Edit the php.ini file in /opt/lampp/etc/ as follows:

Search for: memory_limit = 8M, change 8M to 32M


Again search: upload_max_filesize = 8M change 2M to 8M

Save & Close file

3: Start XAMPP

4. To start XAMPP simply call this command:

# /opt/lampp/lampp start

5. You should now see something like this on your screen:

Starting XAMPP 1.7...


LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.

Ready. Apache and MySQL are running. If you get any error messages please take a look at the
Linux FAQ.

4: Test XAMPP
OK, that was easy but how can you check that everything really works? Just type in the following URL
at your favorite web browser:
http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the
installed software and some small programming examples. Make to click the Security link and follow
the instruction necessary to secure your XAMPP engine.

Step 2: Install SugarCRM on XAMPP


1. Go to http://www.sugarcrm.com/crm/download/sugar-suite.html and download SugarCRM Community
Edition - the open source option or buy the commercial version as desired. We’re going to download
and install the: SugarCE 5.2.0i.zip, which we found to be robust and doesn’t crush. However, its
advisable to use the latest version.
To perform the installation procedure ensure that you change to root user, i.e., su

2. Copy and extract the downloaded archive file to /opt/lampp/htdocs directory


12
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

# cp SugarCRM-5.2.0i.zip /opt/lampp/htdocs

# cd /opt/lampp/htdocs
[root @fcds httdocs]# unzip SugarCRM-5.2.0i.zip

3. Rename the SugarCRM-5.2.0i to sugarsuite and then issue these commands from the terminal
window to set the permission as follows:

#chmod -R 755 /opt/lampp/htdocs/sugarsuite


#cd /opt/lampp/htdocs/sugarsuite
#chmod -R 777 ./cache/
#chmod -R 777 ./custom/
#chmod -R 777 ./data/
#chmod -R 777 ./modules/
#chmod -R 777 config.php
#chmod -R 777 .htaccess

4. To install SugarCRM, open a browser and type: http://localhost/sugarsuite/


5. From the Welcome to the SugarCRM 5.2.0.i Setup Wizard, click the Next button.

13
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

6. Follow installation instruction: Create User, Create Database. Click Finish Installation when
done.

Hooray! SugarCRM install on Linux XAMPP is done!

7. Login into the SugarCRM with username and password credentials you entered during setup, in our
case: Username: Admin and Password: Password for the SugarCRM administrator.

8. Click Admin link > Systems Settings

14
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

Part 4: Putting it all Together: SugarCRM with OpenDS and JBoss

9. Scroll down LDAP Authentication Support section, and check mark Enable LDAP. The
LDAP connectivity section opens-up, see figure below.

Complete sections with entries that was used with OpenDS (refer to Part 2), but
remember to replace the data with your own settings.

Note: It’s critically important to tick mark the Auto Create Users check box.

15
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

10. Log out and try and login back with OpenDS LDAP user, e.g., scrmuser, we created with
JBoss Portal in Part 1, Step 5.

11. Accept or change the default time zone and voila you’re home inside SugarCRM – Enjoy.
12. Test other LDAP users, and or create new users form JBoss Portal and see if you can
login into SugarCRM using these users.

16
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

17
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication


Global Open Versity, Vancouver Canada Integration of SugarCRM & OpenDS LDAP Server on JBoss Portal v1.1

You’re good to go – Enjoy to performance systems integration and great ROI, why not – it’s
all the joy of the open source goodies.

Stay tuned for the continuing HowTo series on how to of the systems integration with open
source.

Good Luck and Enjoy working with cool system integration.

Summary
Once you have your integrated OpenDS LDAP & SugarCRM on JBoss Portal – you can extend
it to implement Single-Sign-On (SSO) and other network access and related users
provisioning solutions.

-----------------------
Kefa Rabah is the Founder and CIO, of Serengeti Systems Group Inc. Kefa is knowledgeable in
several fields of Science & Technology, IT Security Compliance and Project Management, and
Renewable Energy Systems. He is also the founder of Global Open Versity, a Center of Excellence
in online eLearning.

18
© September 2008, Kefa Rabah, Ph.D. Global Open Versity, Vancouver Canada

www.globalopenversity.com A GOV Open Knowledge Access License Technical Publication

Das könnte Ihnen auch gefallen