Quantcast
Channel: The Middleware Shop » WebSphere
Viewing all 70 articles
Browse latest View live

Installing WebSphere Message Broker 8 on Linux

$
0
0

I am installing Broker as root on a CentOS 6.3 VM.

Here is a note from IBM: If you plan to run the installation as a user with root authority, then complete the following steps:

Under root authority, the installation automatically creates a security group called mqbrkrs. You must add your root authority login ID to the group after it has been created.

If you have already installed WebSphere MQ on this system, a group called mqm and a user called mqm have already been defined. If you have not yet installed WebSphere MQ, you must create this group and user.

Add your root authority user login ID to the group mqm, along with the user ID mqm.

On some systems, you must log off and log on again for these new group definitions (mqbrkrs and mqm) to be recognized.

Uploaded the following files and unpacked them

Then ran chmod 750 on WMB install folders so I can run installer

./setupLinux64.bin

Configuring the installer for this system’s environment…

strings: ‘/lib/libc.so.6′: No such file

Launching installer…

./setuplinuxx64.bin: /tmp/install.dir.32648/Linux/resource/jre/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

./setuplinuxx64.bin: line 2506: /tmp/install.dir.32648/Linux/resource/jre/jre/bin/java:

There is a missing dependency, so I ran the following command

yum install ld-linux.so.2

Result:
[root@localhost messagebroker_ia_runtime1]# yum install ld-linux.so.2

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* base: mirror.simwood.com

* extras: mirror.for.me.uk

* updates: www.mirrorservice.org

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package glibc.i686 0:2.12-1.80.el6_3.7 will be installed

–> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.80.el6_3.7.i686

–> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.80.el6_3.7.i686

–> Running transaction check

—> Package nss-softokn-freebl.i686 0:3.12.9-11.el6 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================

Package Arch Version Repository Size

===========================================================================================================================================================================

Installing:

glibc i686 2.12-1.80.el6_3.7 updates 4.3 M

Installing for dependencies:

nss-softokn-freebl i686 3.12.9-11.el6 base 116 k

Transaction Summary

===========================================================================================================================================================================

Install 2 Package(s)

Total download size: 4.4 M

Installed size: 13 M

Is this ok [y/N]: y

Downloading Packages:

(1/2): glibc-2.12-1.80.el6_3.7.i686.rpm | 4.3 MB 00:01

(2/2): nss-softokn-freebl-3.12.9-11.el6.i686.rpm | 116 kB 00:00

—————————————————————————————————————————————————————————

Total 2.0 MB/s | 4.4 MB 00:02

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : glibc-2.12-1.80.el6_3.7.i686 1/2

Installing : nss-softokn-freebl-3.12.9-11.el6.i686 2/2

Verifying : nss-softokn-freebl-3.12.9-11.el6.i686 1/2

Verifying : glibc-2.12-1.80.el6_3.7.i686 2/2

Installed:

glibc.i686 0:2.12-1.80.el6_3.7

Dependency Installed:

nss-softokn-freebl.i686 0:3.12.9-11.el6

Let’ stry again, and then we get this error

libgcc_s.so.1 must be installed for pthread_cancel to work

libgcc_s.so.1 must be installed for pthread_cancel to work

Launching installer…

libgcc_s.so.1 must be installed for pthread_cancel to work

JVMDUMP006I Processing dump event “abort”, detail “” – please wait.

JVMDUMP032I JVM requested System dump using ‘/tmp/install.dir.412/core.20130209.233058.412.0001.dmp’ in response to an event

libgcc_s.so.1 must be installed for pthread_cancel to work

Aborted (core dumped)

yum install libgcc_s.so.1

Result
[root@localhost messagebroker_ia_runtime1]# yum install libgcc_s.so.1

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* base: mirror.ox.ac.uk

* extras: mirror.ox.ac.uk

* updates: mirror.ox.ac.uk

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package libgcc.i686 0:4.4.6-4.el6 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================

Package Arch Version Repository Size

=============================================================================================================================================================================================================================================

Installing:

libgcc i686 4.4.6-4.el6 base 111 k

Transaction Summary

=============================================================================================================================================================================================================================================

Install 1 Package(s)

Total download size: 111 k

Installed size: 144 k

Is this ok [y/N]: y

Downloading Packages:

libgcc-4.4.6-4.el6.i686.rpm | 111 kB 00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : libgcc-4.4.6-4.el6.i686 1/1

Verifying : libgcc-4.4.6-4.el6.i686 1/1

Installed:

libgcc.i686 0:4.4.6-4.el6

Complete!

[root@localhost messagebroker_ia_runtime1]#

Lets’s try again:

root@localhost messagebroker_ia_runtime1]# ./setuplinuxx64

Preparing to install…

Extracting the JRE from the installer archive…

Unpacking the JRE…

Extracting the installation resources from the installer archive…

Configuring the installer for this system’s environment…

Launching installer…

Graphical installers are not supported by the VM. The console mode will be used instead…

===============================================================================

Select language

—————

1- Deutsch

->2- English

3- Español

4- Français

5- Italiano

6- Português (Brasil)

Select language by number:

Follow instructions, I chose to install on

Default Install Folder: /opt/ibm/mqsi/8.0.0.1

[User] /opt/ibm/mqsi/8.0.0.1/IBM_WebSphere_Message_Broker_InstallLog.log

[Debug] /var/mqsi/WMB_8001_installer_debug.log

mqbrkrs:x:501:

[root@localhost wmb8]# cat /etc/group

You can see the new group has been created.

We then continue on and the installer completes. We now need to install WMQ 7.5

We have now only just installed the Broker components,

We now need to install WMQ.

Upload WMQ files and install WMQ core.

Installing WMQ 7.5

[root@localhost wmq75]# rpm -ivh MQSeriesRuntime-7.5.0-0.x86_64.rpm MQSeriesServer-7.5.0-0.x86_64.rpm

Preparing… ########################################### [100%]

1:MQSeriesRuntime ########################################### [ 50%]

2:MQSeriesServer ########################################### [100%]

mqm:x:495:502::/var/mqm:/bin/bash

[root@localhost wmq75]# cat /etc/passwd

OK so now we need to do a bit of profile and ownership maintenance:

We need to add root and mqm to the mqbrkrs group.

[root@localhost wmq75]# usermod -g mqm root

[root@localhost wmq75]# usermod -g mqbrkrs root

[root@localhost wmq75]# usermod -g mqbrkrs mqm

[root@localhost wmq75]# usermod -g mqm mqm

Now we can modify mqm’s profile so that it can automatically run MQ and MQSI commands:

[root@localhost wmq75]# su – mqm

-bash-4.1$ pwd

/var/mqm

We have proven we can login to the mqm account and we find that our home directory is /var/mqmq we can now modify .bashrc

Now since we did not create our mqm user correctly (should have done this first to ensure that we have a well prepared user’s hoe folder) we can use

cp /etc/skel/.* /etc/skel/* .

This command will copy in the profile scripts such as

-rw——-. 1 mqm mqm 63 Feb 10 00:06 .bash_history

-rw-r–r–. 1 mqm mqm 18 Feb 10 00:09 .bash_logout

-rw-r–r–. 1 mqm mqm 176 Feb 10 00:09 .bash_profile

-rw-r–r–. 1 mqm mqm 124 Feb 10 00:09 .bashrc

drwxrwsr-x. 13 mqm mqm 4096 Feb 10 00:09 .

-rw-r–r–. 1 mqm mqm 500 Feb 10 00:09 .emacs

Issue the mqsiprofile command:

. install_dir/bin/mqsiprofile

You must include the period and space preceding the location for this invocation to work correctly. Add this command to your login profile if you want it to be run at the start of every session.

This command accesses additional scripts that you have copied to the common/profiles directory, therefore the environment is initialized for runtime components and other resources such as databases.

OK, lets edit .bashrc as follows:

# User specific aliases and functions

#load MQ environment

. /opt/mqm/bin/setmqenv -s

#Load MQSI (WMB) environment

. /opt/ibm/mqsi/8.0.0.1//bin/mqsiprofile

A good idea is to test that we have access to both mq and mqso commands:

[mqm@localhost ~]$ dspmqver

Name: WebSphere MQ

Version: 7.5.0.0

Level: p000-L120604

BuildType: IKAP – (Production)

Platform: WebSphere MQ for Linux (x86-64 platform)

Mode: 64-bit

O/S: Linux 2.6.32-279.el6.x86_64

InstName: Installation1

InstDesc:

InstPath: /opt/mqm

DataPath: /var/mqm

Primary: No

MaxCmdLevel: 75

mqsilist
Result
[mqm@localhost ~]$ mqsilist

(utility.mqsilist)[1]BIP2229W: Warning: abend file directory (/var/mqsi/common/errors) open failed: errno 13. Using directory /tmp 0

Failed to open file /var/mqsi/common/log/utility.mqsilist.trace.bin.0 with error No such file or directory

Failed to open file /var/mqsi/common/log/utility.mqsilist.userTrace.bin.0 with error No such file or directory

BIP4516S: Failed to find all the required WebSphere MQ java classes. Class ‘com.ibm.mq.MQException’ not found in CLASSPATH ‘/opt/mqm/java/lib/com.ibm.mqjms.jar:/opt/mqm/java/lib/connector.jar:/opt/mqm/java/lib/com.ibm.mq.pcf.jar:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mq.headers.jar:/opt/mqm/java/lib/com.ibm.mq.commonservices.jar:/opt/ibm/mqsi/8.0.0.1/messages:/opt/ibm/mqsi/8.0.0.1/classes:/opt/ibm/mqsi/8.0.0.1/classes/ConfigManagerProxy.jar:/opt/ibm/mqsi/8.0.0.1/classes/brokerutil.jar:/var/mqsi/common/wsrr’.

Not all the WebSphere MQ jars are installed on this machine. Message Broker requires that WebSphere MQ for Java is installed to work correctly.

Make sure that all the correct WebSphere MQ components are installed and that the CLASSPATH correctly contains the WebSphere MQ jar files.

As root…
[root@localhost wmq75]# rpm -ivh MQSeriesJava-7.5.0-0.x86_64.rpm MQSeriesJRE-7.5.0-0.x86_64.rpm

Preparing… ########################################### [100%]

1:MQSeriesJRE ########################################### [ 50%]

2:MQSeriesJava ########################################### [100%]

[mqm@localhost ~]$ mqsilist

(utility.mqsilist)[1]BIP2229W: Warning: abend file directory (/var/mqsi/common/errors) open failed: errno 13. Using directory /tmp 0

Failed to open file /var/mqsi/common/log/utility.mqsilist.trace.bin.0 with error No such file or directory

Failed to open file /var/mqsi/common/log/utility.mqsilist.userTrace.bin.0 with error No such file or directory

BIP1281I: No brokers have been defined on this machine.

BIP8071I: Successful command completion.

We can see that MQSI command work, but we get a few log errors:

We also need to ensure that we have ownership for mqsi folders

[root@localhost var]# chown -R mqm:mqbrkrs /var/mqsi/

[root@localhost var]# chown -R mqm:mqbrkrs /opt/ibm/mqsi/

If we still get the error then consult: http://www-01.ibm.com/support/docview.wss?uid=swg21580249

yum install ksh

and mkdir – p /var/mqsi/common/log/

We are now cool and can run MQSI and MQ command as mq user.

Install MQ Explorer

[root@localhost wmq75]# rpm -ivh MQSeriesExplorer-7.5.0-0.x86_64.rpm

Preparing… ########################################### [100%]

1:MQSeriesExplorer ########################################### [100%]

Running MQ Explorer

Log in to an X11 desktop session. Note you may need to either create a sudo account for your user to login as mqm or if this is a test environment like mine, you can change the mqm password using root and log in directly as mqm.

I use FREENX to connect to my Linux Server’s Gnome Desktop.

Anyway, however you connect to your dekstop you can run MQ Explorer if installed using the RPM by running to

/opt/mqm/bin/MQExplorer

You can search my blogs and sites for article’ son how to sue MQ Explorer

http://www.themiddlewareshop.com/2013/02/05/mq-explorer-security-examples-2/

Installing Message Broker Toolkit

You really do need MBTK installed. Both for development and administration purposes.

Unzip and untar the the three install disk sets.

I presume you are using a shell within g an X11 session

if running ./installToolkit.sh does nothing on CENTOS, then run Nothing to do

[root@localhost disk1]# ./installToolkit-silent.sh

CRIMA9C35370BE ERROR: The package IBM® WebSphere® Message Broker Toolkit requires system library libstdc++.so.5 or libstdc++.so.6. Make sure libstdc++.so.5 or libstdc++.so.6 is available in the system library path before installing this package.

We can now see the error.

yum install libstdc++.so.6

I did not try to get GUI to work in this example, but I do cover how to install it correctly on a on certified platform as described in module 1 of my Message Broker Developer course.

http://www.themiddlewareshop.com/products

I decided to run the silent install option, but unless you fix with my suggestion as per my course, you will not be able to launch MBTK.

Once you have applied my fixes you will be able to launch Message Broker Toolkit. In the example screen shot below, I just happened to be rung as root. But if you have set up your desktop correctly, you can use your user or mqm etc.

Reference

http://www-01.ibm.com/software/integration/wbimessagebroker/library/

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp


Issues with Free NX and mqm user – Websphere MQ

$
0
0

I had issues using NX server (FREE NX, No Machine Client) for my WebSphere MQ user (mqm)

As you can see when I try to use NX to connect to server using mqm, I get a hang.

Checking the session Log I see:

Info: Display running with pid ’8028′ and handler ’0x110eae’.

NXPROXY – Version 3.5.0

Copyright (C) 2001, 2011 NoMachine.

See http://www.nomachine.com/ for more information.

Info: Proxy running in client mode with pid ’6652′.

Session: Starting session at ‘Sun Feb 10 14:39:26 2013′.

Info: Connection with remote proxy completed.

Info: Using ADSL link parameters 512/24/1/0.

Info: Using cache parameters 4/4096KB/16384KB/16384KB.

Info: Using pack method ‘adaptive-7′ with session ‘gnome’.

Info: Using ZLIB data compression 1/1/32.

Info: Using ZLIB stream compression 4/4.

Info: Using cache file ‘D:\nx/cache-gnome/S-3F1385A0331C19B01DF902465C24DB21′.

Info: Forwarding X11 connections to display ‘:0′.

Info: Listening to font server connections on port ’11000′.

Session: Session started at ‘Sun Feb 10 14:39:26 2013′.

Warning: Protocol mismatch or no X authentication data.

Session: Terminating session at ‘Sun Feb 10 14:39:29 2013′.

Info: Your session was closed before reaching a usable state.

Info: This can be due to the local X server refusing access to the client.

Info: Please check authorization provided by the remote X application.

Session: Session terminated at ‘Sun Feb 10 14:39:29 2013′.

) when I was trying to connect as mqm user? This is what I did to solve issue.

Now before I go over this, I must say that I am using the default nx install and I have added the client dsa key to my nx client config. I tested with a new user and yet when I test with the actual mqm user I could not get a connection. I would get typical session errors like the following:

  • Error: Aborting session with ‘Cannot establish any listening sockets – Make sure an X server isn’t already running’.
  • Your session was closed before reaching a usable state.
  • This can be due to the local X server refusing access to the client.
  • Please check authorization provided by the remote X application.

So I logged in as mqm user and ran nxagent command:

[mqm@localhost ~]$ nxagent
_XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Error: Aborting session with ‘Cannot establish any listening sockets – Make sure an X server isn’t already running’.
Session: Aborting session at ‘Sun Feb 10 14:26:15 2013′.
Session: Session aborted at ‘Sun Feb 10 14:26:15 2013′.

I then thought maybe SELinux was enabled and causing me issues?

root@localhost ~]# selinuxenabled && echo enabled || echo disabled
enabled

echo 0 > /selinux/enforce

root@localhost ~]# selinuxenabled && echo enabled || echo disabled
disabled

I then tried connecting an voila, success. So in short all I had to do was turn of SE Liniux. This is a security hole I can live with on a test server. When I get time I shall investigate SE Linux and understand how I can solve this for the wmq user.

Note: With SE Linux on, this does not affect any other user!




Success, I am now running a Desktop as mqm via Free NX. Wicked! I can no use my Message Broke r Tookit as mqm user.

Installing Message Broker 8 Fixpack

$
0
0

Locate and download the ;latest fixpack

http://www-01.ibm.com/support/docview.wss?rs=849&uid=swg24033147

Login with your IBM id

Download the file:

8.0.0-WS-MB-LINUXX64-FP0001.tar.Z, de-compress and untar to a suitable location on your server.

Applying WebSphere Message Broker Fix pack

  • Change to <WMB_FIX_PACK_IMAGE> directory
  • Create a file called response_file_silent_installation with the following content

LICENSE_ACCEPTED=TRUE

USER_INSTALL_DIR=/opt/ibm/mqsi/8.0.0.1

For example:

[root@localhost disk1]# cat response_file_silent_installation

LICENSE_ACCEPTED=TRUE

USER_INSTALL_DIR=/opt/ibm/mqsi/8.0.0.1

  • Execute setuplinuxx64 with the as shown below

[root@localhost disk1]# ./setuplinuxx64 -i silent -f ./response_file_silent_installation

  • A return code of zero indicates successful installation of the fix pack

If the command is successful, then it does not print anything and remains silent. If the command fails due to some reason, a return code is printed in the console by the script.

Applying Fixpack to Message Broker Toolkit

$
0
0

Get the Fix pack from IBM:

http://www-01.ibm.com/support/docview.wss?uid=swg27009742

Installing using IBM Installation Manager (GUI example). We do this manually as this is not usually done on mass. Only ever for you workstation.

Upload MB8001_800102.zip to your server and expand

Run IM

I was logged in as mqm

I needed to switch to root, once IM has loaded add the repository location of th efixpack

Click OK and on the workbench click Update

One the fixpack repository has been scanned, it will be presented

Click Next

Click Next after reviewing, then Update as seen below

That’s all folks. We now have upgraded MBTK.

Troubleshooting – Default broker configuration in Message Broker 8

$
0
0

Load the Message Broker toolkit

Note: If the IM (MBTK) loads slowly, this is because the user that is launching the work-bench is not in the mqm group.

In the Welcome screen, click the create the Default Configuration link

Firefox willl oad (Wel this is CentOS 6.3, and we have FF)

Click on the Start the Default Configuration wizard

Click Next

Note: If you get an error like the following:

Click on Open log file

TIMESTAMP [Sun Feb 10 23:28:02 GMT 2013]

Feb 10, 2013 11:28:02 PM com.ibm.etools.mft.eou.wizards.EouWizard logAction

INFO: Verifying that the user has sufficient group authority for brokers commands.

Feb 10, 2013 11:28:02 PM com.ibm.etools.mft.eou.wizards.EouWizard logAction

SEVERE: Insufficient authority: user must be in groups mqm and mqbrkrs.

Collected output from task >

Stdout: [mqbrkrs]

Stderr: []

the solution for this is

as root
usermod -a -G mqm,mqbrkrs
This will ensure that th emqm user (in my case I am logged in to X11 as mqm) has access. If you want to use another user then modify the command for example:

usermod -a -G mqm, mqbrkrs stever

Secondly

Create a line similar to this in your profile for example bash_profile
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mqm/java/lib64:/opt/ibm/mqsi/8.0.0.1/xml4c/lib:/opt/mqm/lib64:/opt/ibm/mqsi/8.0.0.1/lib:/opt/ibm/mqsi/8.0.0.1/bin:/opt/ibm/mqsi/8.0.0.1/ODBC/V6.0/lib:/opt/ibm/mqsi/8.0.0.1/xlxpc/lib:/opt/mqm/java/lib
 

export LD_LIBRARY_PATH

Thirdly

Feb 11, 2013 12:02:06 AM com.ibm.etools.mft.eou.wizards.EouWizard logAction

INFO: Creating the default broker [MB8BROKER] and the queue manager [MB8QMGR].

Feb 11, 2013 12:02:06 AM com.ibm.etools.mft.eou.wizards.EouWizard logAction

SEVERE: Could not create the broker.

Collected output from task >

Stdout: [BIP8050E: Unable to create WebSphere MQ Queue Manager 'MB8QMGR'.

This command attempts to create a WebSphere MQ Queue Manager. The Queue Manager could not be created.

Locate and resolve the problem and retry the command.]

Stderr: [AMQ7077: You are not authorized to perform the requested operation.]

Logged in as mqm I tried this command
[mqm@localhost ~]$ crtmqm TEST1

AMQ7077: You are not authorized to perform the requested operation.

[mqm@localhost ~]$ groups

mqbrkrs mqm

So why this error? I can only think it is because I deleted the user and re-created it and somehow we have lost some mq permissions?

dr-xr-xr-x. 14 495 mqm 4096 Feb 10 00:23 mqm

drwxr-xr-x. 6 root root 4096 Feb 10 01:51 .

drwxr-xr-x. 5 root mqbrkrs 4096 Feb 10 01:52 IBM

drwxrwxr-x. 4 root root 4096 Feb 10 21:31 ibm

dr-xr-xr-x. 27 root root 4096 Feb 11 00:19 ..

[root@localhost opt]# pwd

/opt

What I did was issue

chown -R mqm:mqm /opt/mqm
chown -R mqm:mqbrkrs /opt/IBM
chown -R mqm:mqbrkrs /opt/ibm

We are now all OK

Click Finish

Close the welcome message

Congratulations, we have message broker 8 running and we can even administer as mqm.

Related articles:

http://www.themiddlewareshop.com/2013/02/10/installing-message-broker-8-fixpack/

http://www.themiddlewareshop.com/2013/02/10/message-broker-version/

http://www.themiddlewareshop.com/2013/02/10/issues-with-free-nx-and-mqm-user-websphere-mq/

http://www.themiddlewareshop.com/2013/02/10/installing-websphere-message-broker-8-on-linux/

WebSphere and MQ

$
0
0

Introduction

In this example HowTo we see an example of the type of information you will learn about connecting WebSphere Application server 8 and WebSphere MQ (WAS 8.x and WMQ connectivity). This about 75% of one of the modules in my course title: WebSphere MQ 7.5 Administration Essentials course.

Here, we are going to use WebSphere MQ, a messaging system from IBM. WebSphere MQ is a robust product and supports the highest QoS i.e. delivering a message exactly once.

WebSphere Application Server supports connectivity to MQ through JMS interface, and due to this support, application developers can use the same set of JMS interfaces to send and receive messages i.e. they need not learn a new API.

Steps involved

First we will be installing WebSphere MQ product. Then we will be creating a Queue Manager and a Queue. In MQ, Queues are hosted using Queue Managers.

We need to reconfigure the wastest application to use a different connection factory that helps creating a connection to MQ. Also the wastest application will be used to post a message to a queue that resides on external MQ Queue Manager as opposed to the Queue that was hosted on the default JMS provider present within WAS.

IBM WebSphere MQ – Product Installation

MQ trial version can be downloaded from the following web page.

http://www.ibm.com/developerworks/downloads/ws/wmq

You will need an IBM user id to download. So you can use the same IBM user id that you used to download WAS. Select the flavour that is suitable for your Operating System. In this HowTo we are going to use

WebSphere MQ V7.1 Trial for Linux on x86 64bit Multilingual – CI510ML.tar.gz

The size of the download is 366 MB.

  1. Download WebSphere MQ V7.1
  2. Decompress the file CI510ML.tar.gz

You will find a script called mqlicense.sh under the base directory after the decompression. Execute this script to accept the license agreement.

  1. Accept license agreement

sudo ./mqlicense.sh –accept

$ sudo ./mqlicense.sh -accept

Licensed Materials – Property of IBM

5724-H72

(C) Copyright IBM Corporation 1994, 2011 All rights reserved.

US Government Users Restricted Rights – Use, duplication or disclosure

restricted by GSA ADP Schedule Contract with IBM Corp.

Agreement accepted: Proceed with install.

  • Install MQ using the rpm package manager

rpm -ivh MQSeriesRuntime-7.1.0-0.x86_64.rpm

rpm -ivh MQSeriesServer-7.1.0-0.x86_64.rpm

rpm -ivh MQSeriesSamples-7.1.0-0.x86_64.rpm

Ubuntu users can refer to Appendix A for information on installing the rpm packages.

A Unix user called mqm will be created on running the MQSeriesRuntime installable. All the MQ commands can be executed only as user mqm.

  • So you need to switch to mqm user now

$ su – mqm

It is recommended to reset the password for mqm user at this point. 

$ sudo passwd mqm

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

The first command that we can try after the installation is the dspmqver command.

  • Cd to /opt/mqm/bin directory
  • Issue the dspmqver command as shown below.

/opt/mqm/bin/dspmqver

We can see the product version as a result of executing this command.

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./dspmqver

Name: WebSphere MQ

Version: 7.1.0.0

Level: p000-L111024

BuildType: IKAP – (Production)

Platform: WebSphere MQ for Linux (x86-64 platform)

Mode: 64-bit

O/S: Linux 3.0.0-15-generic

InstName: Installation1

InstDesc:

InstPath: /opt/mqm

DataPath: /var/mqm

Primary: No

MaxCmdLevel: 710

Creating a Queue Manager

  • Create a Queue Manager called TESTMGR1 using crtmqm command

$ crtmqm TESTMGR1

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ crtmqm TESTMGR1

crtmqm: command not found

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./crtmqm TESTMGR1

There are 90 days left in the trial period for this copy of WebSphere MQ.

WebSphere MQ queue manager created.

Directory ‘/var/mqm/qmgrs/TESTMGR1′ created.

The queue manager is associated with installation ‘Installation1′.

Creating or replacing default objects for queue manager ‘TESTMGR1′.

Default objects statistics : 71 created. 0 replaced. 0 failed.

Completing setup.

Setup completed.

  • Issue the dspmq command and check whether the Queue Manager is listed or not

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./dspmq

QMNAME(TESTMGR1) STATUS(Ended immediately)

  • Start the Queue Manager using strmqm command

./strmqm TESTMGR1

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./strmqm TESTMGR1

There are 90 days left in the trial period for this copy of WebSphere MQ.

WebSphere MQ queue manager ‘TESTMGR1′ starting.

The queue manager is associated with installation ‘Installation1′.

5 log records accessed on queue manager ‘TESTMGR1′ during the log replay phase.

Log replay for queue manager ‘TESTMGR1′ complete.

Transaction manager state recovered for queue manager ‘TESTMGR1′.

WebSphere MQ queue manager ‘TESTMGR1′ started using V7.1.0.0.

Creating a Queue

  • Open MQ scripting command line by giving the Queue Manager name

./runmqsc TESTMGR1

  • Create a Queue called “Q1LOCAL”

define qlocal(Q1LOCAL)

  • Quit the MQ command line by typing “end”

In the following example, user input is highlighted in Red colour

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./runmqsc TESTMGR1

5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.

Starting MQSC for queue manager TESTMGR1.

define qlocal(Q1LOCAL)

1 : define qlocal(Q1LOCAL)

AMQ8006: WebSphere MQ queue created.

end

2 : end

One MQSC command read.

No commands have a syntax error.

All valid MQSC commands were processed.

  • Verify the presence of the new queue using the following command.

$ echo “dis QLOCAL(*)” | ./runmqsc TESTMGR1 | grep -i Q1LOCAL

QUEUE(Q1LOCAL) TYPE(QLOCAL)

  • Add Listener definition using the following commands

./runmqsc TESTMGR1

DEFINE LISTENER(TESTMGR1.listener) TRPTYPE (TCP) PORT(1414)

START LISTENER(TESTMGR1.listener)

end

Here we mention the transport type and port number for the listener.

The following example shows both the user input and the text emitted by MQ. User Input is highlighted.

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./runmqsc TESTMGR1

5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.

Starting MQSC for queue manager TESTMGR1.

DEFINE LISTENER(TESTMGR1.listener) TRPTYPE(TCP) PORT(1414)

1 : DEFINE LISTENER(TESTMGR1.listener) TRPTYPE(TCP) PORT(1414)

AMQ8626: WebSphere MQ listener created.

START LISTENER(TESTMGR1.listener)

2 : START LISTENER(TESTMGR1.listener)

AMQ8021: Request to start WebSphere MQ listener accepted.

end

3 : end

2 MQSC commands read.

No commands have a syntax error.

All valid MQSC commands were processed.

  1. Now restart the Queue Manager using endmqm and strmqm commands as shown below

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./endmqm TESTMGR1

Quiesce request accepted. The queue manager will stop when all outstanding work

is complete.

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./strmqm TESTMGR1

There are 90 days left in the trial period for this copy of WebSphere MQ.

WebSphere MQ queue manager ‘TESTMGR1′ ending.

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./strmqm TESTMGR1

There are 90 days left in the trial period for this copy of WebSphere MQ.

WebSphere MQ queue manager ‘TESTMGR1′ starting.

The queue manager is associated with installation ‘Installation1′.

5 log records accessed on queue manager ‘TESTMGR1′ during the log replay phase.

Log replay for queue manager ‘TESTMGR1′ complete.

Transaction manager state recovered for queue manager ‘TESTMGR1′.

WebSphere MQ queue manager ‘TESTMGR1′ started using V7.1.0.0.

If you give the start command strmqm before the Queue Manager stops, the start command just says Queue Manager <Queue Manager Name> ending as shown in the example above.
  1. Verify that the Listener started by issuing the ps command and grepping for mqlsr

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ps -ef | grep mqlsr

mqm 17392 17298 0 20:13 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m TESTMGR1 -t TCP -p 1414

Create a MQ Channel

A Channel is a logical communication link between a WMQ client and a WMQ Queue Manager. In a production environment the communication that happens through this channel has to be secured. The WebSphere MQ end configuration will be usually taken care by WebSphere MQ specialists and we will not be focusing on that topic.

  1. Create a default channel

runmqsc TESTMGR1

DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) +

CHLTYPE(SVRCONN) +

TRPTYPE(TCP) +

DESCR(‘WebSphere MQ Default Channel’) +

REPLACE

End

The example given below shows both user input and text emitted by MQ.

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./runmqsc TESTMGR1

5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.

Starting MQSC for queue manager TESTMGR1.

DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) +

1 : DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) +

CHLTYPE(SVRCONN) +

: CHLTYPE(SVRCONN) +

TRPTYPE(TCP) +

: TRPTYPE(TCP) +

DESCR(‘WebSphere MQ Default Channel’) +

: DESCR(‘WebSphere MQ Default Channel’) +

REPLACE

: REPLACE

AMQ8014: WebSphere MQ channel created.

end

2 : end

One MQSC command read.

No commands have a syntax error.

All valid MQSC commands were processed.

Let us put a sample message using the sample program provided by WebSphere MQ and then get it back, just to verify the setup. This program was installed when we installed the package MQSeriesSamples-7.1.0-0.x86_64.rpm and will be available under /opt/mqm/samp/bin directory.

  • Execute amqsput, type the message text, press Enter key twice

The following example shows the user input and the text emitted by WMQ.

mqm@steve-H67N-USB3-B3:/opt/mqm/samp/bin$ ./amqsput Q1LOCAL TESTMGR1

Sample AMQSPUT0 start

target queue is Q1LOCAL

Hi, Test Message

Sample AMQSPUT0 end

  • Execute amqsget

mqm@steve-H67N-USB3-B3:/opt/mqm/samp/bin$ ./amqsget Q1LOCAL TESTMGR1

Sample AMQSGET0 start

message <Hi, Test Message>

no more messages

Sample AMQSGET0 end

The Unix user account root has to be added to mqm group. This is required in our test environment to make things work. Since our focus is on WebSphere Application Server, let us do this. Note that this is not a recommended practice.

  • Add root user to mqm group

$ usermod -a -G mqm root

Now we are going to configure MQ security to modify access privileges to all the members of the mqm group. This will provide access to all the objects within the Queue Manager.

  • Execute setmqaut command as shown below

setmqaut -m TESTMGR1 -t qmgr -g mqm +all

mqm@steve-H67N-USB3-B3:/opt/mqm/bin$ ./setmqaut -m TESTMGR1 -t qmgr -g mqm +all

The setmqaut command completed successfully.

Creating a Queue Connection Factory

This step is similar to the one explained in Part 1.

  • Expand Resources in the left navigation pane of admin console
  • Expand JMS
  • Click on Queue connection factories

  • Select Cell scope
  • Click New button

Next “Select JMS resource provider” screen comes up. This is where we are going to select MQ as the messaging provider.

  • Select WebSphere MQ messaging provider option

Configure Basic Attributes screen is displayed as shown in the screen shot.

  • Enter “wmq_qcf_1″ for the name of QCF
  • Enter “jms/wmq_qcf_1″ for the JNDI name

  • Select Enter all the required information into this wizard option
  • Click Next button

In this case we give “TESTMGR1” which is the name of the Queue Manager we created earlier.

  • Enter the name of the Queue Manager
  • Click Next button

  • Give the hostname of the machine where MQ Queue Manager is running
  • Give the port number of the listener
  • Enter “SYSTEM.ADMIN.SVRCONN” in the Server connection channel field
  • Click Next button

Now the wizard provides an option to test the connection to WMQ.

  • Click on Test connection button

The test results are shown as seen in the screen shot.

  • Click Next button

Review the summary information.

  • Click Finish button

  • Click Save link

Now the new WMQ Queue Connection Factory is displayed in the table as shown in the screen shot.

Note that we have not used SiBus as the messaging provider is external to WAS

Creating a Queue Destination

This queue created in WAS represents the queue that was created earlier in WMQ.

  • Expand Resources in the left navigation pane
  • Expand JMS
  • Click on Queues
  • Select Cell scope in the drop down
  • Click New button

  • Select WebSphere MQ messaging provider option
  • Click OK button

  • Give a name to the Queue in the Name field (This need not be the same as the MQ Queue name, i.e. Q1LOCAL)
  • Give a unique JNDI name to the Queue in the JNDI Name field
  • In the Queue Name field, provide the actual name of the Queue that was created in WMQ.
  • Click on OK button

  • Click Save link

We have completed the setup and a JEE application deployed in WAS can now start using the MQ messaging infrastructure. We can verify the setup using the test tool that we have.

Note that we have not used SiBus as the messaging provider is external to WAS. The message persistence is taken care by WebSphere MQ.
To get the rest of this course, then have a look at http://www.themiddlewareshop.com/products/ and look for WebSphere MQ Training courses.

Installing WebSphere Message Broker 8 for Windows

$
0
0

Prep work:

Read this page from IBM it is a good starter for 10.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.msgbroker.helphome.doc%2Fhelp_home_msgbroker.htm

As you can see above I have opened the IBM WebSphere Message Broker Information Center. We do this because it is best practice to ensure that you complete the prerequisites

We will be dealing with installing several components:

  • IBM WebSphere Message Broker
  • IBM WebSphere Message Broker Tookit
  • IBM WebSphere MQ 7.5
  • IBM WebShere MQ Explorer
  • WebSphere Message Broker Explorer Plugin

Normally I get some fix packs from IBM FixCentral, but it was down as I was writing this article

I will validate this later

Windows Prerequisites

Essential for windows all need is local admin rights as per your domain or local security policies. This can be tricky in some organisation where workstations are locked down. Being a developer you may have special privileges?

The only other thing we need to do is prepare security users/groups for MQ and Broker

User ID restrictions: some operating systems and other products impose restrictions on user IDs:

  • On Windows systems, user IDs can be up to 12 characters long, but on Linux, UNIX, and z/OS® systems, they are restricted to eight characters. Database products, for example DB2®, might also restrict user IDs to eight characters. If you have a mixed environment, ensure that the user IDs that you use within the broker environment are limited to a maximum of eight characters. This is rally important if you are going to deploy to a Linux Broker. I have several MessageBroker/WMQ Explorer/Security articles on my blog: http://blog.webspheretools.com and on my Courseware site: http://www.themiddlewareshop.com/blog
  • Ensure that the case (upper, lower, or mixed) of user IDs in your broker environment is consistent. In some environments, uppercase and lowercase user IDs are considered the same, but in other environments, user IDs of different case are considered unique. For example, on Windows the user IDs ‘tester’ and ‘TESTER’ are identical, but on Linux and UNIX systems they are recognized as different user IDs.
  • Check the validity of spaces and special characters in user IDs to ensure that, if used, these characters are accepted by all relevant systems and products in your broker environment.

Set up the required security on Windows

Before you install the Broker component, the WebSphere Message Broker Toolkit, or the WebSphere Message Broker Explorer, log on with a user ID that has Administrator authority.

If you are installing the Broker component, the installation wizard calls the mqsisetsecurity command which completes the following tasks:

  • Creates a new security group called mqbrkrs.
  • Adds your current (logged on) user ID to the group mqbrkrs.
  • Adds your current user ID to the group mqm, if that group exists.

The mqm group exists if you have already installed WebSphere MQ on this system. If you have not, call the mqsisetsecurity command when you have completed WebSphere MQ installation. If you use the Windows Launchpad (described in Installing by using the Windows Launchpad), it completes WebSphere MQ installation first.

Note: If you prefer to create principals before you install WebSphere Message Broker, use the security facilities provided by the Windows Control Panel.

If you are running Terminal Services on this computer, change user mode to ensure that actions taken during installation are completed correctly; for example, the creation of .ini files and other related files in the default system directory C:\Windows. If you do not change user mode, files might be written to other locations and, although the installation might complete successfully, the product might not work as expected.

Before you install any product components, enter the following command to change user mode:

change user /install

When installation is complete, enter the following command to restore the original user mode:

change user /execute

To complete verification, your user ID must have Administrator authority. If you log in with a different user ID from the ID with which you perform installation, you must add that user ID to the groups mqbrkrs and mqm. Use either the Windows security facilities or the mqsisetsecurity command (run this command after you have logged on with that different ID) to complete these additions.

The Windows Launchpad.

This program installs prerequisite products if they are not already installed, and identifies prerequisite products that are not at the supported level.

We are going to start with running this tool form the installation media and see what it reports to us

As you can see below I am running the Launch pad that is inside the WebSphereMessage Broker (WMB) media folder.

As you can see, when this installation wizard was created WMQ 1.0.1.3 was the latest. I am going to try and use WMQ 7.5 instead.

Installing IBM WebSphere MQ

Before install any WMB tools/Broker etc, I am going to install WMQ 7.5

Run setup for WMQ

Click launch IBM WebSphere MQ Installer.

Read and Accept License

Choose a custom installation to learn about how it will install

WMQ 7.5 allows for many instances. If you want to know more about install practices then I cover this in my course http://www.themiddlewareshop.com/product/websphere-mq-7-5-admin-essentials-course/

I have opted to not install WMQ in the default Windows suggested folder, this saved me typing complex paths in CMD prompts. It also stops issues with Windows Virtual folder security.

Click Next

This is a local install, so data folder is not important. In production this would be a separate file-system drive ie D-Drive or similar. Depends on your VMWare or other VM setups.

Click Next and set your log folder. Think about storage limits!

Click Next

Chose you extended features as required…

click Next, Review and Install

Click Finish

The Prepare WebSphere MQ wizard will launch

A Windows Service will be added so you can decide to change the auto start ability of WMQ by modifying the service in the Windows control panel.

I am local so no domain servers.

Click Next and the WMQ Service will start, Click Next and finish.

Here is a look at the 2 services created:

http://www-01.ibm.com/support/docview.wss?uid=swg21182193

What is the purpose of the AMQSVC.EXE process on Windows platforms ie the Service called IBM MQSeries?

Well, the amqsvc.exe is the MQ Service process, which launches amqmsrvn.exe by way of dcom. It normally runs under SYSTEM account.

MQ needs a dcom object, because it does not run as a traditional Windows service. amqsvc.exe is the operating system service that acts as a stub, which creates the dcom object, and MQ is launched from that dcom object. It is done this way to enable MQ to run under a user specified account, which is required for some of the MQ operations.

To stop the amqsvc.exe process (other than by using the ‘net stop IBM MQSeries’ command), run the command “amqsvc -stop”.

The MQSeries (Windows) service (amqsvc) has a few command line options to help should problems arise:

amqsvc.exe

-INSTALL : Reinstalls the registry keys to make the MQ Service defined

-UNINSTALL : Removes the MQSeries service

-SILENT : Hides error messages when install/uninstall performed

-START : Starts the service (Use Net Start “MQSeries Service” instead?)

-STOP : Stops the service (Use Net Stop “MQSeries Service” instead?)

OK let’s look at the user/groups that were created:

I think these are self explanatory and we can have another peek after we have installed WMB.

I think we should launch MQ Explorer one to prove it is OK.

I am creating a Queue Manager called TEST.MQ to see if I can put on a Queue called TEST.Q

I used 2414 as the port in case I forget to remove it and so it doesn’t conflict with Broker Default configuration.

Create the QLocal called TEST.Q

Let us put a test message

Let’s get the message

We now have a queue depth of 1.

OK I am happy; we have proven WMQ is OK. We should install a Fixpack, bit you can see that in my course.

Completing WebSphere Message Broker now that we have WMQ installed

Installing WMB and MBTK and MBE

We can now see that the next time we run the Launchpad that WMQ is detected. Lists wrong version, but we don’t care!

Click Launch Installation for WebSphere Message Broker

Click OK

Click Next

Click Next

I chose to not use IBM default location.

Click Next

Click Done.

Next you will be asked to find our media for IBM Installation Manager. It all depends on how your local installation media was unpacked.

Browse for disk 1 etc and continue

Note we will be prompted for the other disks during installation

I changed the install location

Click Next

Note: I skipped a few screen captures; I am sure by now you get the idea.

Click Install

Click finish

Now it will install the Message Broker Explorer. A bit weird as we already have WMQ Explorer, so it will just update them both to be the same i.e. WebSphere MQ Explorer is updated with the MB Explorer plug-in.

Click Next, review summary then Click install

Click Done.

Let us now go an see what has been installed

Loads of WMB goodies.

I will now look at Users/Groups to see what we have. Essentially we have the new mqbrkrs group. Make sure you have access!

When we launch MQ Explorer or Mb Explorer we get

We can see the new WMB plug-in that allows WMA admins to see the Brokers.

I am now going to run Message Broker toolkit (MBTK)

It will prompt for a default workspace

Choose a suitable location, click OK

You can consult my WMB blog articles for how to sort out configuring a default broker.

http://www.themiddlewareshop.com/2013/02/11/troubleshooting-default-broker-configuration-message-broker-8/

Well that’s it we have WMQ, WMB, MBExplorer, MQExplorer, MBTKit and a running system on windows.

Enjoy your new Broker Test/Dev environment.

WebSphere Application Server 8.5 Performance Tuning Course Released 24th May 2013

$
0
0

Today, I released the updated WebSphere Performance Tuning course. We now have 8.5 available.

http://www.themiddlewareshop.com/product/websphere-8-5-performance-tuning/

This course provides students with the tools and techniques to tune the performance of WebSphere Application Server Network Deployment Version 8.5 (WAS ND 8.5)

As typical of all our middleware courses, the course material follows a “Do-it-yourself” approach and provides all the necessary instructions and sample code to setup your lab, try out tuning tasks and learn. In short, this course is a highly practical course which teaches performance tuning by example.

Something unique about this course is the 145 slide Power Point pack which covers WebSphere Performance Tuning best practices and theory.

The following topics are covered:

  • Performance tuning process
  • How WAS processes requests
  • Tools that can be used to measure and tune performance of WAS
  • Tuning JVMs, Thread pools, Connection pools
  • Tuning session/replication/persistence

By completing this course, the student will be able to judge the impact of changing major WAS parameters on performance, understand how the various WAS components are inter-related and use various thumb rules to quickly bring WAS to optimal performance levels.

Duration: 3-8 Days Self Study
Price:
$99.95
Audience:

JEE Developers and Administrators having some experience with WebSphere Application Server 7.0 or WebSphere Application Server 8.0.


WebSphere 7 ND Tuning Course now only $47

Running WebSphere MQ 7.5.0.0 and you get MQ Reason Code 2009

$
0
0

“If you are running WebSphere MQ 7.5.0.0 and you get MQ Reason Code 2009 for Client Channel Applications then there may be a change you can make to prevent the MQRC 2009. Often the problem is intermittent.

In the qm.ini file add the following lines :-

TCP:

DNSLookupOnError=No

The actual problem was introduced in 7.5.0.0. There is a fix for the problem in a future fix pack. But you may get round the problem with the qm.ini change above. “

IBM Portal 8 Administration Basics Course

$
0
0

This course follows a simple “Do-it-yourself” style that is unique to The Middleware Shop’s courses. Containing > 650 pages and slides, the student learns through doing WebSphere Portal 8 Administration. We have designed this course to include all the necessary instructions to install the product, try out various administrative tasks and can be used easily to refresh your knowledge after the course has been attended

The following are the topics covered:

  • Module 1 – WebSphere Portal Server 8 Installation and Uninstall
  • Module 2 – Portal Upgrading and Exploring
  • Module 3 – Virtual Portals , Users and Groups
  • Module 4 – Portal Administration and Configuration tools
  • Module 5 – Portal Database Domains and Clustering
  • Module 6 – Themes and Skins
  • Module 7 – Web Content management,LDAP configuration.

By completing this course, the student will understand basic WebSphere Portal Administration concepts. Powered with this knowledge the student will be able to work on Portal 8 Administration.

Duration:

  • Ideal duration for an instructor led course: 5 days.
  • Duration for self-learning: 3 weeks

Audience:
Basic knowledge of Windows or Linux Operating system. An appreciation for the need of enterprise web-portal systems.

Price: $135.95

IBM WebSphere Portal Server 8 Administration Course
IBM WebSphere Portal 8 Admin Membership
Price: $249.00
Price: $135.95

Note: Once you have paid and registered, you will gain instant access to download your course materials.

IBM WebSphere Application Server 8.5 Essentials Course

$
0
0

WebSphere 8.5 Administration Course

This course provides the student with the necessary skills to handle all sorts of administrative tasks on WebSphere Application Server Network Deployment version 8.5. The course material is practical and “hands-on” and covers a wide range of topics derived from industry experience. We have designed this course to include all the necessary instructions to install the product, try out various administrative tasks and can be used easily to refresh your knowledge after the course has been attended. The course also contains over 900 pages of “How To” guides and more than 300 Power Point slides along with Labs, resources and questions and answers

The course has been written by Steve Robinson who is a well known WebSphere product specialist and the author of several published WebSphere related books. Version 8.5 was also prepared and updated updated by Chandan Kumar.

Duration: 5-10 Days Self Study
Price: $154.95
Audience:

  • JEE Developers and Administrators having little or some experience with Java Application Servers.
  • People looking to upgrade their skills to the Latest version of WebSphere Application Server.

Requirements:
Basic knowledge of JEE concepts & Unix commands is expected. Prior experience in administering any JEE application servers will speed up the learning process and allow you to enjoy the course more, but is not mandatory.

WebSphere Application Server 8.5 Administration Essentials
WebSphere Application Server 8.5 Administration Essentials
Price: $279.00
Price: $154.95

Note: Once you have paid and registered, you will gain instant access to download your course materials.

Apache Web Server Hardening and Security

$
0
0

Introduction

The Web Server is a crucial part of web-based applications. Apache Web Server is often placed at the edge of the network hence it becomes one of the most vulnerable services to attack. Having default configuration supply many sensitive information which may help hacker to prepare for an attack the web server.

The majority of web application attacks are through XSS, Info Leakage, Session Management and PHP Injection attacks which is due to weak programming code and failure to sanitize web application infrastructure. According to the security vendor Cenzic, 99% of tested applications have vulnerabilities. Below chart from Cenzic shows the vulnerability trend report of 2013.

 

This practical guide provides you the necessary skill set to secure Apache Web Server. In this course, we will talk about how to Harden & Secure Apache Web Server on Unix platform. Following are tested on Apache 2.4.x and I don’t see any reason it won’t work with Apache 2.2.x.

 

  • This assumes you have installed Apache on UNIX platform. If not, you can go through Installation guide
  • We will call Apache installation directory /opt/apache as $Web_Server throughout this course.
  • You are advised to take a backup of existing configuration file before any modification.

Audience

This is designed for Middleware Administrator, Application Support, System Analyst, or anyone working or eager to learn Hardening & Security guidelines. Fair knowledge of Apache Web Server & UNIX command is mandatory.

Information Leakage

In default Apache configuration you would have many sensitive information disclosure, which can be used to prepare for an attack. It’s one of the most critical tasks for administrator to understand and secure them. As per report by Cenzic, 16% of vulnerability is found in Info leakage.

We require some tool to examine HTTP Headers for verification. Let’s do this by install firebug add-on in Firefox.

  • Click on Install Now
  • Restart Firefox
  • You can see firebug icon at right top bar

We will use this icon to open firebug console to view HTTP Headers information.

 

There are many online tools also available which helps to check in HTTP header information. Below are some of them you can try out.

www.seositecheckup.com

 

  1. Remove Server Version Banner

I would say this is one of the first things to consider, as you don’t want to expose what web server version you are using. Exposing version means you are helping hacker to speedy the reconnaissance process. Default configuration will expose Apache Version and OS type as shown below.

Implementation:

  • Go to $Web_Server/conf folder
  • Modify httpd.conf by using vi editor
  • Add following directive and save the httpd.conf

ServerTokens Prod

ServerSignature Off

  • Restart apache

ServerSignature will remove the version information from the page generated like 403, 404, 502, etc.) by apache web server.

ServerTokens will change Header to production only, i.e. Apache

Verification:

  • Open Firefox
  • Activate firebug by clicking firebug icon at top right side
  • Click on Net tab


  • Hit the URL in address bar
  • Expand the GET request and you could see Server directive is just showing Apache, which is much better than exposing version and OS type.

 

Disable directory browser listing

Disable directory listing in browser so visitor doesn’t see what all file and folders you have under root or sub-directory. Let’s test how does it look like in default settings.

Go to $Web_Server/htdocs directory

Create a folder and few files inside that

# mkdir test

# touch hi

# touch hello

Now, let’s try to access Apache by http://localhost/test

As you could see it reveals what all file/folders you have which is certainly you don’t want to expose.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi
  • Search for Directory and change Options directive to None or –Indexes

<Directory /opt/apache/htdocs>

Options None

Order allow,deny

Allow from all

</Directory>

 

(or)

 

<Directory /opt/apache/htdocs>

Options -Indexes

Order allow,deny

Allow from all

</Directory>

  • Restart Apache

Note: if you have multiple Directory directives in your environment, you should consider doing the same for all.

Verification:

Now, let’s try to access Apache by http://localhost/test

 

As you could see, it displays forbidden error instead showing test folder listing.

 

Etag

It allows remote attackers to obtain sensitive information like inode number, multipart MIME boundary and child process through Etag header. To prevent this vulnerability, let’s implement it as below. This is required to fix for PCI compliance.

Implementation:

  • Go to $Web_Server/conf directory
  • Add following directive and save the httpd.conf

FileETag None

  • Restart apache

Verification:

  • Open Firefox and access your application
  • Check HTTP response headers in firebug, you should not see Etag at all.

Authorization

Run Apache from non-privileged account

Default apache configuration is to run as nobody or daemon. It’s good to use a separate non-privileged user for Apache. The idea here is to protect other services running in case of any security hole.

Implementation:

  • Create a user and group called apache

# groupadd apache

# useradd –G apache apache

  • Change apache installation directory ownership to newly created non-privileged user

# chown –R /opt/apache

  • Go to $Web_Server/conf
  • Modify httpd.conf using vi
  • Search for User & Group Directive and change as non-privileged account apache

User apache

Group apache

  • Save the httpd.conf
  • Restart Apache

Verification:

grep for running http process and ensure it’s running with apache user

# ps –ef |grep http

Note: You could see one process is running with root. That’s because Apache is listening on port 80 and it has to be started with root. We will talk about how to change port number later in this course.

Protect binary and configuration directory permission

By default, permission for binary and configuration is 755 that mean any user on server can view the configuration. You can disallow other user to get into conf and bin folder.

Implementation:

  • Go to $Web_Server directory
  • Change permission of bin and conf folder

# chown –R 750 bin conf

 

Verification:

System Settings Protection

In default installation, users can override apache configuration using .htaccess. if you want to stop users changing your apache server settings, you can add AllowOverride to None as shown below. This must be done at root level.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi
  • Search for Directory at root level

<Directory />

Options -Indexes

AllowOverride None

</Directory>

 

  • Save the httpd.conf
  • Restart Apache

HTTP Request Methods

HTTP 1.1 protocol support many request methods which may not be required and some of them are having potential risk. Typically you may just need GET, HEAD, POST request methods in web application, which can be configured in respective Directory directive. Default apache configuration support OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT method in HTTP 1.1 protocol.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi

Search for Directory and add following

<LimitExcept GET POST HEAD>

deny from all

</LimitExcept>

 

Web Application Security

Apache web server misconfiguration or not hardened properly can exploit web application. It’s critical to harden your web server configuration.

Cookies

Disable Trace HTTP Request

By default Trace method is enabled in Apache web server. Having this enabled can allow Cross Site Tracing attack and potentially giving an option to hacker to steal cookie information. Let’s see how it looks like in default configuration.

  • Do a telnet web server IP with listen port
  • Make a TRACE request as shown below

#telnet localhost 80

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

TRACE / HTTP/1.1

Host: test

 

HTTP/1.1 200 OK

Date: Sat, 31 Aug 2013 02:13:24 GMT

Server: Apache

Transfer-Encoding: chunked

Content-Type: message/http

20

TRACE / HTTP/1.1

Host: test

0

Connection closed by foreign host.

#

 

As you could see in above TRACE request it has responded my query. Let’s disable it and test it.

Implementation:

  • Go to $Web_Server/conf directory
  • Add following directive and save the httpd.conf

TraceEnable off

  • Restart apache

Verification:

  • Do a telnet web server IP with listen port and make a TRACE request as shown below

#telnet localhost 80

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

TRACE / HTTP/1.1

Host: test

 

HTTP/1.1 405 Method Not Allowed

Date: Sat, 31 Aug 2013 02:18:27 GMT

Server: Apache

Allow:

Content-Length: 223

Content-Type: text/html; charset=iso-8859-1

 

<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>

<html><head>

<title>405 Method Not Allowed</title>

</head><body>

<h1>Method Not Allowed</h1>

<p>The requested method TRACE is not allowed for the URL /.</p>

</body></html>

Connection closed by foreign host.

#

As you could see in above TRACE request it has blocked my request with HTTP 405 Method Not Allowed. Now, this web server doesn’t allow TRACE request and help in blocking Cross Site Tracing attack.

Set cookie with HttpOnly and Secure flag

You can mitigate most of the common Cross Site Scripting attack using HttpOnly and Secure flag in cookie. Without having HttpOnly and Secure, it is possible to steal or manipulate web application session and cookies and it’s dangerous.

Implementation:

  • Ensure mod_headers.so is enabled in your httpd.conf
  • Go to $Web_Server/conf directory
  • Add following directive and save the httpd.conf

Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

  • Restart apache

Verification:

  • Open Firefox and access your application
  • Check HTTP response headers in firebug, you should see Set-Cookie is flagged with HttpOnly and Secure as shown below.

 

Clickjacking Attack

Clickjacking is well known web application vulnerabilities. You can refer my previous post Secure Your Web Site from Clickjacking Attack.

 

Implementation:

  • Ensure mod_headers.so is enabled in your httpd.conf
  • Go to $Web_Server/conf directory
  • Add following directive and save the httpd.conf

Header always append X-Frame-Options SAMEORIGIN

  • Restart apache

Verification:

  • Open Firefox and access your application
  • Check HTTP response headers in firebug, you should see X-Frame-Options as shown below.

Server Side Include

Server Side Include (SSI) has a risk in increasing load on the server. If you have shared environment and heavy traffic web applications you should consider disable SSI by adding Includes in Options directive. SSI attack allows the exploitation of a web application by injecting scripts in HTML pages or executing codes remotely.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi
  • Search for Directory and add Includes in Options directive

<Directory /opt/apache/htdocs>

Options –Indexes -Includes

Order allow,deny

Allow from all

</Directory>

  • Restart Apache

Note: if you have multiple Directory directives in your environment, you should consider doing the same for all.

X-XSS Protection

Cross Site Scripting (XSS) protection can be bypassed in many browsers. You can force apply this protection for web application if it was disabled by the user. This is used by majority of giant web companies like Facebook, twitter, Google, etc.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi and add following Header directive

    Header set X-XSS-Protection “1; mode=block”

  • Restart Apache

Verification:

  • Open Firefox and access your application
  • Check HTTP response headers in firebug, you should see XSS Protection is enabled and mode is blocked.

 

Disable HTTP 1.0 Protocol

When we talk about security, we should protect as much we can. So why do we use older HTTP version of protocol, let’s disable them as well. HTTP 1.0 has security weakness related to session hijacking. We can disable this by using mod_rewrite module.

Implementation:

  • Ensure to load mod_rewrite module in httpd.conf file
  • Enable RewriteEngine directive as following and add Rewrite condition to allow only HTTP 1.1

    RewriteEngine On

    RewriteCond %{THE_REQUEST} !HTTP/1\.1$

    RewriteRule .* – [F]

Timeout value configuration

By default Apache timed-out value is 300 seconds, which can be victim of Slow Loris attack and DoS. To mitigate this you can lower the timeout value to maybe 60 seconds.

Implementation:

  • Go to $Web_Server/conf directory
  • Open httpd.conf using vi

Add following in httpd.conf

Timeout 60

SSL

Having SSL is additional layer of security you are adding into Web Application. However, default SSL configuration leads to certain vulnerabilities and you should consider tweaking those configurations.

We require some tool to verify SSL settings. There are many available however, I would use SSL-Scan free tool. You can download from http://sourceforge.net/projects/sslscan/

SSL Key

Breaching SSL key is hard, but not impossible. Its just matter of computational power and time. As you might know using a 2009-era PC cracking away for around 73 days you can reverse engineer a 512-bit key. So the higher key length you have, the more complex it becomes to break SSL key. Majority of giant Web Companies use 2048 bit key, as below so why don’t we?

  • Outlook.com
  • Microsoft.com
  • Live.com
  • Skype.com
  • Apple.com
  • Yahoo.com
  • Bing.com
  • Hotmail.com
  • Twitter.com

Implementation:

  • You can use openssl to generate CSR with 2048 bit as below.
  • Generate self-signed certificate

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt

  • Generate new CSR and private key

openssl req -out localhost.csr -new -newkey rsa:2048 -nodes -keyout localhost.key

  • Add Personal Cert, Signer Cert and Key file in httpd-ssl.conf file under below directive

    SSLCertificateFile # Personal Certificate

    SSLCertificateKeyFile # Key File

    SSLCACertificateFile # Signer Cert file

Verification:

  • Execute sslscan utility with following parameter. Change localhost to your actual domain name.

sslscan localhost | grep –i key

 

  • As you can see current ssl key is 2048 bit, which is stronger.

SSL Cipher

SSL Cipher is an encryption algorithm, which is used as a key between two computers over the Internet. Data encryption is the process of converting plain text into secret ciphered codes. It’s based on your web server SSL Cipher configuration the data encryption will take place. So it’s important to configure SSL Cipher, which is stronger and not vulnerable. Let’s validate the Cipher accepted in current SSL configuration.

We will use sslscan utility to validate as below command. Change localhost to your actual domain name.

sslscan –no-failed localhost

As you could see above, in current configuration DHE, AES, EDH, RC4 cipher is accepted. Now if you are performing penetration test or PCI compliance test, your report will say RC4 Cipher detected. Lately, it was found that RC4 is weak cipher and to pass certain security test, you must not accept RC4 or any weak cipher. You should also ensure not to accept any cipher, which is less than 128 bits.

Implementation:

  • Go to $Web_Server/conf/extra folder
  • Modify SSLCipherSuite directive in httpd-ssl.conf as below to reject RC4

    SSLCipherSuite HIGH:!MEDIUM:!aNULL:!MD5:!RC4

  • Save the configuration file and restart apache server

Note: if you have many weak cipher in your SSL auditing report, you can easily reject them adding ! at beginning. For ex – to reject RC4: !RC4

Verification:

Again, we will use sslscan utility to validate as below command. Change localhost to your actual domain name.

sslscan –no-failed localhost

So now we don’t see RC4 anymore as accepted Cipher. It’s good to reject any low, medium, null or vulnerable cipher to keep yourself tension free from getting attacked. You can also scan your domain against Qualys SSL Labs to check if you have weak or vulnerable cipher in your environment.

Disable SSL v2

SSL v2 has many security flaws and if you are working towards penetration test or PCI compliance then you are expected to close security finding to disable SSL v2. Any SSL v2 communication may be vulnerable to Man-in-The-Middle attack that could allow data tempering or disclosure. Let’s implement apache web server to accept only latest SSL v3 and reject SSL v2 connection request.

Implementation:

  • Go to $Web_Server/conf/extra folder
  • Modify SSLProtocol directive in httpd-ssl.conf as below to accept only SSL v3 and TLS v1

    SSLProtocol –ALL +SSLv3 +TLSv1

Verification:

Let’s use sslscan utility to validate as below command. Change localhost to your actual domain name.

sslscan –no-failed localhost

As you could see above, accepted is only SSLv3 and TLSv1, which is safe from SSLv2 vulnerabilities.

Mod Security

Mod Security is an open-source Web Application Firewall, which you can use with Apache. It comes as a module which you have to compile and install. If you can’t afford commercial web application firewall, this would be good choice to go for it. Mod Security says: In order to provide generic web applications protection, the Core Rules use the following techniques:

  • HTTP Protection – detecting violations of the HTTP protocol and a locally defined usage policy
  • Real-time Blacklist Lookups – utilizes 3rd Party IP Reputation
  • Web-based Malware Detection – identifies malicious web content by check against the Google Safe Browsing API.
  • HTTP Denial of Service Protections – defense against HTTP Flooding and Slow HTTP DoS Attacks.
  • Common Web Attacks Protection – detecting common web application security attack
  • Automation Detection – Detecting bots, crawlers, scanners and other surface malicious activity
  • Integration with AV Scanning for File Uploads – detects malicious files uploaded through the web application.
  • Tracking Sensitive Data – Tracks Credit Card usage and blocks leakages.
  • Trojan Protection – Detecting access to Trojans horses.
  • Identification of Application Defects – alerts on application misconfigurations.
  • Error Detection and Hiding – Disguising error messages sent by the server.

Download & Installation

Following prerequisites must be installed on server where you wish to use Mod Security with Apache. If any one of these doesn’t exist then Mod Security compilation will fail. You may use yum install on Linux or Centos to install these packages.

  • apache 2.x or higher
  • libpcre package
  • libxml2 package
  • liblua package
  • libcurl package
  • libapr and libapr-util package
  • mod_unique_id module bundled with Apache web server

Now, let’s download the latest stable version of Mod Security 2.7.5 from http://www.modsecurity.org/download/

  • Transfer downloaded file to /opt/apache

  • Extract modsecurity-apache_2.7.5.tar.gz

# gunzip –c modsecurity-apache_2.7.5.tar.gz | tar xvf –

  • Go to extracted folder modsecurity-apache_2.7.5

# cd modsecurity-apache_2.7.5

  • Run the configure script including apxs path to existing Apache

# ./configure –with-apxs=/opt/apache/bin/apxs

  • Compile & install with make script

    # make

    # make install

  • Once installation is done, you would see mod_security2.so in modules folder under /opt/apache as shown below

Now this concludes, you have installed Mod Security module in existing Apache web server.

Configuration

In order to use Mod security feature with Apache, we have to load mod security module in httpd.conf.

mod_unique_id module is pre-requisite for Mod Security. This module provides an environment variable with a unique identifier for each request, which is tracked and used by Mod Security.

  • Add following line to load module for Mod Security in httpd.conf and save the configuration file

    LoadModule unique_id_module modules/mod_unique_id.so

    LoadModule security2_module modules/mod_security2.so

  • Restart apache web server

Mod Security is now installed! Next thing you have to do is to install Mod Security core rule to take a full advantage of its feature. Latest Core Rule can be downloaded from following link, which is free.

https://github.com/SpiderLabs/owasp-modsecurity-crs/zipball/master

  • Copy downloaded core rule zip to /opt/apache/conf folder
  • Unzip core rule file, you should see the extracted folder as shown below

You may wish to rename the folder to something short and easy to remember. In this example, I will rename to crs.

  • Go to crs folder and rename modsecurity_crs10_setup.conf.example to modsecurity_crs10_setup.conf

Now, let’s enable these rules to get it working with Apache web server.

  • Add following in httpd.conf

<IfModule security2_module>

    Include conf/crs/modsecurity_crs_10_setup.conf

    Include conf/crs/base_rules/*.conf

</IfModule>

In above configuration, we are loading Mod Security main configuration file modsecurity_crs_10_setup.conf and base rules base_rules/*.conf provided by Mod Security Core Rules to protect web applications.

  • Restart apache web server

You have successfully configured Mod Security with Apache! Well done. Now, Apache Web server is protected with Mod Security web application firewall.

Getting Started

Lets get it started with some of the important configuration in Mod Security to harden & secure web applications. In this section, we will do all configuration modification in /opt/apache/conf/crs/modsecurity_crs_10_setup.conf

We will refer /opt/apache/conf/crs/modsecurity_crs_10_setup.conf as setup.conf in this section for example purpose.

It’s important to understand what are the OWASP rules are provided in free. There are two types of rules provided by OWASP.

Base Rules – these rules are heavily tested and probably false alarm ratio is less.

Experimental Rules – these rules are for experimental purpose and you may have high false alarm. It’s important to configure, test and implement in UAT before using these in production environment.

Optional Rules – these optional rules may not be suitable for the entire environment. Based on your requirement you may use them. If you are looking for CSRF, User tracking, Session hijacking, etc. protection then you may consider using optional rules.

We have base, optional and experimental rules after extracting downloaded crs zip file from OWASP download page. These rules configuration file is available in crs/base_rules, crs/optional_rules and crs/experimental_rules folder. Let’s get familiar with some of the base rules.

modsecurity_crs_20_protocol_violations.conf: This rule is protecting from Protocol vulnerabilities like response splitting, request smuggling, using non-allowed protocol (HTTP 1.0).

modsecurity_crs_21_protocol_anomalies.conf: This is to protect from request, which is missing with Host, Accept, User-Agent in header.

modsecurity_crs_23_request_limits.conf: This rule has dependency on application specific like request size, upload size, length of parameter, etc.

modsecurity_crs_30_http_policy.conf: This is to configure and protect allowed or disallowed method like CONNECT, TRACE, PUT, DELETE, etc.

modsecurity_crs_35_bad_robots.conf: Detect malicious robots

modsecurity_crs_40_generic_attacks.conf: This is to protect from OS command injection, remote file inclusion, etc.

modsecurity_crs_41_sql_injection_attacks.conf: This rule to protect SQL and blind SQL inject request.

modsecurity_crs_41_xss_attacks.conf: Protection from Cross Site Scripting request.

modsecurity_crs_42_tight_security.conf: Directory traversal detection and protection.

modsecurity_crs_45_trojans.conf: This rule to detect generic file management output, uploading of http backdoor page, known signature.

modsecurity_crs_47_common_exceptions.conf: This is used as an exception mechanism to remove common false positives that may be encountered suck as Apache internal dummy connection, SSL pinger, etc.

Logging

Logging is one of the first things to configure so you can have logs created for what Mod Security is doing. There are two types of logging available; Debug & Audit log.

Debug Log: this is to duplicate the Apache error, warning and notice messages from the error log.

Audit Log: this is to write the transaction logs that are marked by Mod Security rule

Mod Security gives you flexibility to configure Audit, Debug or both logging. By default configuration will write both logs. However, you can change based on your requirement. Log is controlled in SecDefaultAction directive. Let’s look at default logging configuration in setup.conf

SecDefaultAction “phase:1,deny,log”

To log Debug, Audit log – use “log”

To log only audit log – use “nolog,auditlog”

To log only debug log – use “log,noauditlog”

You can specify the Audit Log location to be stored which is controlled by SecAuditLog directive. Let’s write audit log into /opt/apache/logs/modsec_audit.log by adding as shown below.

Implementation:

Add SecAuditLog directive in setup.conf and restart Apache Web Server

SecAuditLog /opt/apache/logs/modsec_audit.log

After restart, you should see modsec_audit.log getting generated as shown below.

Enable Rule Engine

By default Engine Rule is Off that means if you don’t enable Rule Engine you are not utilizing all the advantages of Mod Security. Rule Engine enabling or disabling is controlled by SecRuleEngine directive.

Implementation:

Add SecRuleEngine directive in setup.conf and restart Apache Web Server

SecRuleEngine On

There are three values for SecRuleEngine:

On – to enable Rule Engine

Off – to disable Rule Engine

DetectionOnly – enable Rule Engine but never executes any actions like block, deny, drop, allow, proxy or redirect

Once Rule Engine is on – Mod Security is ready to protect with some of the common attack types.

Common Attack Type Protection

Now web server is ready to protect with common attack types like XSS, SQL Injection, Protocol Violation, etc. as we have installed Core Rule and turned on Rule Engine. Let’s test few of them.

XSS Attack

  • Open Firefox and access your application and put <script> tag at the end or URL as shown below
  • Monitor the modsec_audit.log in apache/logs folder

http://localhost/?<script>xss attack</script>


As you can see Mod Security blocks request as it contains <script> tag which is the root of XSS attack.

Directory Traversal Attack

Directory traversal attacks can create lot of damage by taking advantage of this vulnerabilities and access system related file. Ex – /etc/passwd, .htaccess, etc.

  • Open Firefox and access your application with directory traversal
  • Monitor the modsec_audit.log in apache/logs folder

http://localhost/?../…/boot

As you can see Mod Security blocks request as it contains directory traversal.

Change Server Banner

Earlier in this guide, you learnt how to remove Apache and OS type, version help of ServerTokens directive. Let’s go one step ahead, how about keeping server name whatever you wish? It’s possible with SecServerSignature directive in Mod Security. You see it’s an interesting.

Note: in order to use Mod Security to manipulate Server Banner from header, you must set ServerTokesn to Full in httpd.conf of Apache web server.

Implementation:

Add SecServerSignature directive with your desired server name in setup.conf and restart Apache Web Server

SecServerSignature YourServerName

Ex:

[/opt/apache/conf/crs] #grep SecServer modsecurity_crs_10_setup.conf

SecServerSignature chandank.com

[/opt/apache/conf/crs] #

Verification:

  • Open Firefox and access your application
  • Check HTTP response headers in firebug, you should see Server banner is changed now as shown below.

General Configuration

We will talk about some of the general configuration as best practice.

Configure Listen

When you have multiple interface and IP’s on single server, it’s recommended to have Listen directive configured with absolute IP and Port number. When you leave apache configuration to Listen on all IP’s with some port number, it may create problem in forwarding HTTP request to some other web server. This is quite common in shared environment.

Implementation:

  • Configure Listen directive in httpd.conf with absolute IP and port as shown example below

Listen 10.10.10.1:80

Access Logging

It’s essential to configure access log properly in your web server. Some of the important parameter to capture in log would be the time taken to serve the request, SESSION ID. By default apache is not configured to capture these data. You got to configure them manually as following.

Implementation:

To capture time taken to serve the request and SESSION ID in access log

Add %T & %sessionID in httpd.conf under LogFormat directive

LogFormat “%h %l %u %t \”%{sessionID}C\” \”%r\” %>s %b %T” common

You can refer http://httpd.apache.org/docs/2.2/mod/mod_log_config.html for complete list of parameter supported in LogFormat directive in Apache Web Server.

Disable Loading unwanted modules

If you have compiled and installed with all modules then there are high chances you will have many modules loaded in Apache, which may not be required. Best practice is to configure Apache with required modules in your web applications. Following modules are having security concerns and you might be interested to disable in httpd.conf of Apache Web Server.

WebDAV (Web-based Distributed Authoring and Versioning)

This module allows remote clients to manipulate files on the server and subject to various denial-of-service attacks. To disable comment following in httpd.conf

#LoadModule dav_module modules/mod_dav.so

#LoadModule dav_fs_module modules/mod_dav_fs.so

#Include conf/extra/httpd-dav.conf

 

Info Module

The mod_info module can leak sensitive information using .htaccess once this module is loaded. To disable comment following in httpd.conf

 

#LoadModule info_module modules/mod_info.so

Authors:

Chandan Kumar, is an accomplished and energetic technical and business professional in leading complex projects and managing cross-border Human Capital to optimise enterprise technology and processes.

Steve Robinson Previously a world-wide lead in WebSphere Application Server and Author of several WAS books, Steve now spends his time on consulting on Airport Integration, SOA practices and Process Governance for Tier1 airports.

References:

This wouldn’t be possible without guidance from the following links:

http://httpd.apache.org/docs/2.4/

http://www.modsecurity.org/documentation/

https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project

Primary administrative user Id does not exist in the registry

$
0
0

When setting an LDAP repository in WebSphere Application WE get the following error:

Validation failed: SECJ7716E: Primary administrative user Id does not exist in the registry.

 

When I click Set as current, I get the following error as seen in SystemError.log

 

 

Error

[14/04/15 21:07:17:768 BST] 00000066 SystemErr R com.ibm.websphere.wim.exception.WIMConfigurationException: CWWIM5020E Could not connect to the ldap://localhostcell01:10389 repository using properties: [port=10389],[bindDN=cn=WebSphere+sn=LDAP Bind+uid=wasladapbind,ou=users,ou=system],[certificateMapMode=exactdn],[sslConfiguration=],[securityDomainName=admin],[sslEnabled=false],[connectTimeout=20],[connectionPool=false],[id=LDAP1],[ldapServerType=CUSTOM],[host=localhostcell01],[referal=ignore],[derefAliases=always],[certificateFilter=],[authentication=simple],[bindPassword=****]. Exception occurred: javax.naming.AuthenticationException.
<Content Removed For Brevity>

[14/04/15 21:07:17:793 BST] 00000066 SystemErr R Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 – INVALID_CREDENTIALS: Bind failed: Attempt to lookup non-existant entry: cn=WebSphere+sn=LDAP Bind+uid=wasladapbind,ou=users,ou=system]

These are the setting used

 

Cause

AS we can see above Bind distrinquished name (DN) field contains

bindDN=cn=WebSphere+sn=LDAP Bind+uid=wasladapbind,ou=users,ou=system

Note the spelling error, there is an extra ‘a’ in the word ldap!

It should contain

bindDN=cn=WebSphere+sn=LDAP Bind+uid=wasldapbind,ou=users,ou=system

 

Note: This error can also happen when you are using an invalid password, best to log into LDAP Administration console of your LDAP server and re-validate the password. Most LDAP Servers have some sort of Administrative GUI that often provides a validate existing password function. Alternatively, just change the password.

 

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

 Key Skills

  • Leadership (Team, Project, Business, People).
  • Architecture (Solutions, Information, Technical, Applications).

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

  • Automation
  • Security, SSL
  • Dev Ops
  • Architecture
  • Performance Tuning

Middleware Integration Skills:

  • .NET programming, and Architecture
  • Java Programming, and Architecture
  • SOA, SOAP and XML messaging
  • JBoss Fuse, WMQ, IIB, Mule

Integration Skills:

  • SOA
  • Process Improvement
  • ICD’s
  • Messaging Architecture
  • Governance

General Digital Architecture & Governance

  • Lightweight Architectures
  • Digital Strategy, platform stacks for example IAAS, PAAS, SAAS
  • PCI DSS

 Industry Qualifications & Recognition

TOGAF 9.1

  • IBM Champion 2013

WebSphere ApacheDS LDAP Example – Introduction

$
0
0

Introduction

This document covers the process of setting up Apache DS as an LDAP server and then shows by example how to use LDAP as provided by Apache DS for use in in the two following scenarios

  1. A Standalone LDAP server configuration
    1. WAS Administrative Security and User Security (Application Role Management) are both managed by a single LDAP server
  2. A federated repository which contains a LDAP server and the default internal file registry
    1. WAS Administrative Security is managed by the file registry and User Security is managed by LDAP.

 

This guide is one of several security guides on the topic of security This guide focuses on the configuration of registries used for security purposes and managed by the Virtual Member Manager.

 

The version of WebSphere Application Server (WAS) we are using in this guide is 8.5.5.x for Developers (WAS DEV) which at the time of writing is a “FREE No Charge” standalone product. It is essentially the same product as WAS Base, but free to download.

 

Topics Covered

Security is an important part of any application server configuration. In this chapter, we will cover how to secure the WebSphere Application Server’s administrative console, as well as how to configure different types of repositories containing the users and groups of authorized users who are given different levels of access to administer a WebSphere server.

 

In this chapter, we will cover the following topics:

  • Global security
  • Standalone Lightweight Directory Access Protocol (LDAP) repository
  • Federated repositories
  • Administrative roles

 

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

 

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

 

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

 

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

 

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

 

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

 

  1. Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

 

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

 

  1. Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

Automation

Security, SSL

Dev Ops

Architecture

Performance Tuning

 

  1. Middleware Integration Skills:

.NET programming, and Architecture

Java Programming, and Architecture

SOA, SOAP and XML messaging

JBoss Fuse, WMQ, IIB, Mule

 

  1. Integration Skills:

SOA

Process Improvement

ICD’s

Messaging Architecture

Governance

 

  1. General Digital Architecture & Governance

Lightweight Architectures

Digital Strategy, platform stacks for example IAAS, PAAS, SAAS

PCI DSS

 

  1. Industry Qualifications & Recognition

TOGAF 9.1

IBM Champion 2013


WebSphere ApacheDS LDAP Example – J2EE and Global Security

$
0
0

JEE security

WebSphere security is based on the JEE application programming model. The JEE security model is designed to separate the application’s need for security and administration of security, allowing applications to be portable between vendors who have a slightly different implementation of the JEE security model. There are two aspects of security which need to be explained:

  • Authentication is essentially asking, “Are you who you say you are?”
  • Authorisation is simply a case of, once we know who you are, “What are you allowed to do?”

WebSphere employs user/group registries which store users and groups and uses these fro Authentication and Authorisation. Groups organize users together for a common action and users are assigned as members of groups. Knowing this, we will now move on to learn how to secure our WebSphere Application Server.

Global security

As documented in the WAS 8.5.5.x Profile Management Guide, we opted to turn on Global Security by supplying a username and password during profile creation. Once the Application Server was started, and we tried to access the WebSphere Integrated Solutions Console (Administrative Console) and we were prompted to enter a username and password. This means that Global Security is turned on. As an Administrator, we need to login with a user that exists in the user registry that WAS is currently using and we need to belong to certain Administrative Roles that allow the use to perform certain Administrative actions in the Administrative Console.

A question that is forth coming is, what kind of user registry is WAS using by default? This then also raises another question, why bother? When we do secure WAS, what kind of User Registries are available? I will now begin to answer these questions in this guide.

As administrators, it is important to secure the administration of WebSphere Application Server even if the applications being installed are not using security. It is paramount to ensure we have control of our WebSphere environments. The larger your team is the more important this becomes. In time, other people in your organization will get to know the console URLs of your WebSphere Application Servers and if they are not secured, you do not really know who is making changes without your approval. Securing the console stops inadvertent access and can ensure that only trained administrators are sanctioned to access and make configurations to environments. This is integral to keeping your WebSphere environment stable.

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

  • Automation
  • Security, SSL
  • Dev Ops
  • Architecture
  • Performance Tuning

Middleware Integration Skills:

  • .NET programming, and Architecture
  • Java Programming, and Architecture
  • SOA, SOAP and XML messaging
  • JBoss Fuse, WMQ, IIB, Mule

Integration Skills:

  • SOA
  • Process Improvement
  • ICD’s
  • Messaging Architecture
  • Governance

General Digital Architecture & Governance

  • Lightweight Architectures
  • Digital Strategy, platform stacks for example IAAS, PAAS, SAAS
  • PCI DSS

Industry Qualifications & Recognition

  • TOGAF 9.1
  • IBM Champion 2013

WebSphere ApacheDS LDAP example – An Unsecured console

$
0
0

An Unsecured console

To learn about how Global Security is configured, we will start by creating a WAS profile that is not secured, then we can look at how to set up Global Security step by step.

To create a profile that is unsecured, we can simply use the custom script we use in previous guides. This script is called was8manage.sh (This comes with a purchased course)

Note: If you have not read the guides on installing WAS and creating profiles using the was8manage.sh, then please review them, and read the was8manage.Usage Guide, which explains how the script works. It is worth your while to learn this script as it will save you hours of manual effort and serves as a great starter towards you WAS automation. You can purchase this course from http://www.themiddlewareshop.com/prodcucts from 01-June-2015 (maybe before)

 

First we set up our environment configuration file, and ensure that the variables that contain the Admin Username and Admin Password are null. Below is an example of such a configuration file which we have named appserver_unsecure.conf.

########################################################################
#WEBSPHERE APPLICATION SERVER Configuration Template for was8manage.sh
#This file is used to pass variables to the script
########################################################################

AUDIT_LOG_DIR=/var/log/was

#Type

TYPE=appserver

#WebSphere Application Server (Standalone) properties

 

UNIQUE_CELL_NAME=DV_AppServer01

#ENV is unused at this time, it is just an audit var

ENV=WASDEV_855_DV

HOST=localhostcell01

PROFILE_NAME=DV_AppServer01Prof

NODE_NAME=DV_AppServer01

#Use default ports when START_PORT = null

START_PORT=

DMGR_ADMIN_USER=

DMGR_ADMIN_PASSWORD=

 

# Directories for target install

#Default WAS installation location can be changed

WAS_BINARY_DIR=/opt/IBM/WebSphere/AppServer

WAS_PROFILE_DIR=/opt/IBM/WebSphere/AppServer/profiles

 

# General Installer parameters

SCRIPT_DIR=/var/apps/scripts/was8manage

 

#Variables that can are designed to be customised as required i.e. other than defaults

INSTALL_SHARED_DIR=/var/IM/im-shared

IM_TOOLS_DIR=/opt/IBM/InstallationManager/eclipse/tools

INSTALL_REPOSITORY_DIR=/var/apps/installs/WAS_DEV_8.5.5.0

INSTALL_LOG=~/wadev8.5.5_install_log.xml

INSTALL_FEATURES=”com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044,core.feature,com.ibm.sdk.6_64bit”

UNINSTALL_FEATURES=”com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044″

 

#Specific Fix Pack variables for UPDATE, are passed as variables via command line to was8admin.sh

#Specific Fix Pack variables for ROLLLBACK are passed as variables via command line to was8admin.sh

 

#The IM_INSTALLER_SRC_DIR variable sets the location of the IBM Installation Manager (IM) installable

IM_INSTALLER_SRC_DIR=/var/apps/installs/IM1.8.1

#if -installationDirectory is not used, then the default is: /var/ibm/InstallationManager

#NOTE: Maybe implement use of -dataLocation flag, as the default location is /opt/IBM/InstallationManager/eclipse

#The IM_DIR is where the IM base binaries will be installed. Note: Use the -installationDirectory directory option to specify a non-default installation directory

IM_DIR=/var/ibm/InstallationManager

#The Agent Data Directory is the directory that contains information about installed packages. This directory is required to update, modify, roll back, or uninstall packages. Stored information includes the state and history of operations.

IM_AGENT_DATA_DIR=/opt/IBM/InstallationManager/eclipse

 

##############################################################################

#The lines below are hardly ever modified! <DO NOT CHANGE UNLESS GOOD REASON>

##############################################################################

#IBM Installation Manager Install/Uninstall

#INSTALL VARIABLES

IM_INSTALLER_SRC_CMD=${IM_INSTALLER_SRC_DIR}/installc

IM_INSTALLER_SRC_LOG=~/im_install_log.xml

IM_INSTALLER_SRC_PARAM=”-log ${IM_INSTALLER_SRC_LOG} -acceptLicense”

 

#UNINSTALL VARIABLES

IM_REMOVE_DIR=${IM_DIR}

IM_REMOVE_CMD=${IM_REMOVE_DIR}/uninstall/uninstallc

 

#WAS 8.5.5 ND install/uninstall using IBM Installation Manager

#INSTALL VARIABLES

# Example Syntax

#./imcl install com.ibm.websphere.ND.v85_8.5.5000.20130514_1044,core.feature,com.ibm.sdk.6_64bit

# -installationDirectory /var/apps/was8.5.5

# -sharedResourcesDirectory /var/IM/im-shared

# -repositories /var/apps/installs/WAS_8.5.5

# -acceptLicense

# -showProgress

# -log /var/log/ibm/install/was8.5.5.xml

# -preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false

 

INSTALL_CMD=”${IM_TOOLS_DIR}/imcl install”

INSTALL_OPTIONS=”-acceptLicense -showProgress”

INSTALL_PREFERENCES=”-preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false”

 

#UNINSTALL VARIABLES

#./imcl uninstall com.ibm.websphere.ND.v85_8.5.5000.20130514_1044 -installationDirectory /var/apps/was8.5.5

UNINSTALL_CMD=”${IM_TOOLS_DIR}/imcl uninstall”

UNINSTALL_LOG=${WAS_BINARY_DIR}/logs/manageprofiles/deleteAll.log

 

#INSTALL FIXPACK VARIABLES

#./imcl install offering_ID_offering_version,optional_feature_ID

# -repositories source_repository

# -installationDirectory product_installation_location

# -keyring keyring_file -password password

# -acceptLicense

 

#Example: /opt/IBM/InstallationManager/eclipse/tools/imcl install com.ibm.websphere.ND.v85_8.5.5005.20150220_0158,core.feature,com.ibm.sdk.6_64bit -installationDirectory /var/apps/was8.5.5 -repositories /var/apps/installs/WAS_ND_8.5.5.5_Fixpack -acceptLicense

UPDATE_CMD=”${IM_TOOLS_DIR}/imcl install”

UPDATE_OPTIONS=”-acceptLicense”

 

#ROLLBACK FIXPACK VARIABLES

#./imcl rollback offering_ID_offering_version

# -repositories source_repository

# -installationDirectory installation_directory

# -preferences preference_key=value

# -properties property_key=value

# -keyring keyring_file -password password

# -acceptLicense

ROLLBACK_CMD=”${IM_TOOLS_DIR}/imcl rollback”

ROLLBACK_OPTIONS=”-acceptLicense”

 

#INSTALL INTERIM FIX VARIABLES

#./imcl install interim_fix_name

# -installationDirectory product_installation_location

# -repositories repository_URL

# -keyring keyring_file

INTERIM_FIX_CMD=”${IM_TOOLS_DIR}/imcl install”

 

#UNINSTALL INTERIM FIX VARIABLES

#./imcl uninstall <interim_fix_name>

# -installationDirectory <product_installation_location>

UNINSTALL_INTERIM_FIX_CMD=”${IM_TOOLS_DIR}/imcl uninstall”

 

Note: We do not cover the variables used in the file as they are covered in other guides, but please note the fact that the variables DMGR_ADMIN_USERNAME and DMGR_ADMIN_PASSWORD are null.

Before we create this example profile, we presume you have already completed the installation sequence and you have existing WAS binaries.

To create the profile using was8manage.sh issue the following command from the scripts home directory.

./was8manage.sh -p create appserver_unsecure

Result:

MAIN ENTRY POINT
ARGS=-p create appserver_unsecure
validating arguments & initialising environment…
$opt=p$, $OPTIND=3, $OPTARG=create

$ENV=appserver_unsecure

initialising environment…

AUDIT_LOG_DIR=/var/log/was

TYPE=appserver

SIMULATE=false

UNIQUE_CELL_NAME=DV_AppServer01

ENV=WASDEV_855_DV

HOST=localhostcell01

PROFILE_NAME=DV_AppServer01Prof

NODE_NAME=DV_AppServer01

START_PORT=

WAS_BINARY_DIR=/opt/IBM/WebSphere/AppServer

INSTALL_SHARED_DIR=/var/IM/im-shared

IM_TOOLS_DIR=/opt/IBM/InstallationManager/eclipse/tools

INSTALL_REPOSITORY_DIR=/var/apps/installs/WAS_DEV_8.5.5.0

INSTALL_LOG=/root/wadev8.5.5_install_log.xml

INSTALL_FEATURES=com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044,core.feature,com.ibm.sdk.6_64bit

UNINSTALL_FEATURES=com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044

IM_INSTALLER_SRC_DIR=/var/apps/installs/IM1.8.1

IM_DIR=/var/ibm/InstallationManager

IM_AGENT_DATA_DIR=/opt/IBM/InstallationManager/eclipse

IM_INSTALLER_SRC_CMD=/var/apps/installs/IM1.8.1/installc

IM_INSTALLER_SRC_LOG=/root/im_install_log.xml

IM_INSTALLER_SRC_PARAM=-log /root/im_install_log.xml -acceptLicense

IM_REMOVE_DIR=/var/ibm/InstallationManager

IM_REMOVE_CMD=/var/ibm/InstallationManager/uninstall/uninstallc

INSTALL_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl install

INSTALL_OPTIONS=-acceptLicense -showProgress

INSTALL_PREFERENCES=-preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false

UNINSTALL_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl uninstall

UNINSTALL_LOG=/opt/IBM/WebSphere/AppServer/logs/manageprofiles/deleteAll.log

UPDATE_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl install

UPDATE_OPTIONS=-acceptLicense

UPDATE_REPOSITORY_DIR=

UPDATE_FEATURES=

ROLLBACK_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl install

ROLLBACK_OPTIONS=-acceptLicense

INTERIM_FIX_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl install

UNINSTALL_INTERIM_FIX_CMD=/opt/IBM/InstallationManager/eclipse/tools/imcl uninstall

[14/04/15 11:43:19] INFO creating a stand-alone application server profile

[14/04/15 11:43:19] INFO About to run /opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh from /var/apps/scripts/was8manage

[14/04/15 11:43:19] WARNING *** Using calculated ports for Application Server, No Admin Security! ***

[14/04/15 11:43:19] INFO Executing CMD:/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -profileName DV_AppServer01Prof -profilePath /opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default -cellName DV_AppServer01 -hostName localhostcell01 -nodeName DV_AppServer01 -isDefault

INSTCONFSUCCESS: Success: Profile DV_AppServer01Prof now exists. Please consult /opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof/logs/AboutThisProfile.txt for more information about this profile.

[14/04/15 11:44:31] INFO WebSphere Installation Success

[14/04/15 11:44:31] INFO The profile [DV_AppServer01Prof] was successfully installed

Application server environment to create: Application server

Location: /opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof

Disk space required: 200 MB

Profile name: DV_AppServer01Prof

Make this profile the default: True

Node name: DV_AppServer01

Host name: localhostcell01

Enable administrative security (recommended): False

Administrative console port: 9060

Administrative console secure port: 9043

HTTP transport port: 9080

HTTPS transport port: 9443

Bootstrap port: 2809

SOAP connector port: 8880

Run application server as a service: False

Create a Web server definition: False

Performance tuning setting: Standard

*** Listing profiles ***

[DV_AppServer01Prof]

************************

The actual manageprofiles.sh command that was executed is as follows:

/opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default -cellName DV_AppServer01 -hostName localhostcell01 -nodeName DV_AppServer01 -isDefault

We now have an Application Server profile that is not secured.

When we start the server using <was_profile_root>/bin/startServer.sh server1 we can then log in to the console. We used default ports so unless there is another profile on your system then the console URL will the same as depicted below.

We can log in using any ID we want. I have logged in as admin. All this will do is log that the user admin logged in, but we do not know who this is.

When we navigate to Users and Group/Manage Users we see the following message

 

You must enable administrative security to manage users and groups using the federated repositories feature.

 

This is because there is no user/group registry configured. Global Administrative Security is no enabled.

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

  • Automation
  • Security, SSL
  • Dev Ops
  • Architecture
  • Performance Tuning

Middleware Integration Skills:

  • .NET programming, and Architecture
  • Java Programming, and Architecture
  • SOA, SOAP and XML messaging
  • JBoss Fuse, WMQ, IIB, Mule

Integration Skills:

  • SOA
  • Process Improvement
  • ICD’s
  • Messaging Architecture
  • Governance

General Digital Architecture & Governance

  • Lightweight Architectures
  • Digital Strategy, platform stacks for example IAAS, PAAS, SAAS
  • PCI DSS

Industry Qualifications & Recognition

  • TOGAF 9.1
  • IBM Champion 2013

WebSphere ApacheDS LDAP Example – Disabling Global Security

$
0
0

Disabling Global Security

What happens if we make a mistake and cannot log in? Maybe we have forgotten a password or user-name. What do we do? Well we can try and modify the xml files, but this is dangerous. A better option is to turn of global security and re-set it. It will depend on your need/problem. A good thing to know is how to disable Global Security if you ever need to do it,

Note: The scripts referenced in this guide, are available then this course is published in Q2 2015.

What we are going to do now, us run the following script to turn of Global Security, look at the security.xml and how it has changed, then we will enable Global security again.

You can run an interactive wsadmin scripting session, and execute this Jython

AdminTask.setGlobalSecurity (‘[-enabled false]’)

Or you can run the script called toggleGlobalSecurity.py, which I have provided for example:

##############################################################################

#

# Script : toggleGlobalSecurity.py

# Purpose : Toggle Global Security on and off

# Authors : Steve Robinson – The MiddlewareShop (http://www.themiddlewareshop.com)

# Created : April 2015

# History

# date ver who what

# ——– — — ———-

# 14-April-2015 0.1 scr Start core script

#

#############################################################################

 

def saveConfiguration():

printer(“”,”Saving configuration….”)

AdminConfig.save( )

printer(“”,”Saved changes”)

#EndDef

 

def printer(prefix,msg):

if(cmp(prefix,”ERR”) == 0):

print “ERR:” + msg

elif(cmp(prefix,”WARN”) == 0):

print “WARN:” + msg

else:

print “INFO:” + msg

#EndIf

#endDef

 

#Get state of Global Security

isGlobalSecurityEnabled = AdminTask.isGlobalSecurityEnabled()

 

if (cmp(isGlobalSecurityEnabled, “true”) == 0):

printer(“”,”Global security is enabled….disabling”)

state=”false”

attr=”[-enabled “+state+”]”

printer(“”,”AdminTask.setGlobalSecurity attributes are as follows:”)

printer(“”,attr)

AdminTask.setGlobalSecurity(attr)

saveConfiguration()

printer(“”,”Restart the server for the changes to take affect”)

#endIf

 

if (cmp(isGlobalSecurityEnabled, “false”) == 0):

printer(“”,”Global security is disabled….enabling”)

state=”true”

attr=”[-enabled “+state+”]”

printer(“”,”AdminTask.setGlobalSecurity attributes are as follows:”)

printer(“”,attr)

AdminTask.setGlobalSecurity(attr)

saveConfiguration()

printer(“”,”Restart the server for the changes to take affect”)

#endIf

 

”’

##AdminTask.setGlobalSecurity requires an attribute:

##AdminTask.SetGlobalSecurity(*enabled)

##The administrative security field in the security.xml file is updated based on the input of true or false.

”’

To run the script, we use wsadmin.sh and pass the Jython file. I have created a sample shell-script called toggleGlobalSecurity.sh, which will demonstrate the -f option.

#!/bin/sh

export ADMIN_USER=wasadmin

echo “ADMIN_USER=”${ADMIN_USER}

export ADMIN_PASSWORD=wasadmin

echo “ADMIN_PASSWORD=”${ADMIN_PASSWORD}

export WAS_PROFILE_DIR=”/opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof”

echo “WAS_PROFILE_DIR=”${WAS_PROFILE_DIR}

export JYTHON_ROOT=”/var/apps/scripts/wasAdmin”

echo “JYTHON_ROOT=”${JYTHON_ROOT}

 

echo “Executing script….”

${WAS_PROFILE_DIR}/bin/wsadmin.sh -username ${ADMIN_USER} -password ${ADMIN_PASSWORD} -f ${JYTHON_ROOT}/security/toggleGlobalSecurity.py

Result of running the script against a running server.

ADMIN_USER=wasadmin

ADMIN_PASSWORD=wasadmin

WAS_PROFILE_DIR=/opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof

JYTHON_ROOT=/var/apps/scripts/wasAdmin

Executing script….

WASX7209I: Connected to process “server1″ on node DV_AppServer01 using SOAP connector; The type of process is: UnManagedProcess

INFO:Global security is enabled….disabling

INFO:AdminTask.setGlobalSecurity attributes are as follows:

INFO:[-enabled false]

INFO:Saving configuration….

INFO:Saved changes

INFO:Restart the server for the changes to take affec

If Global Security is enabled, once the script has been run and we have restarted the Application Server, when we next log into the Admin Console we see that we are no longer asked for a password. We can use any User ID we wish, it does not matter. The console is not secure!

Note: if we have a look at security xml we can see that the attribute enabled=false

<?xml version=”1.0″ encoding=”UTF-8″?>

<security:Security xmi:version=”2.0″ xmlns:xmi=”http://www.omg.org/XMI” xmlns:orb.securityprotocol=”http://www.ibm.com/websphere/appserver/schemas/5.0/orb.securityprotocol.xmi” xmlns:security=”http://www.ibm.com/websphere/appserver/schemas/5.0/security.xmi” xmi:id=”Security_1″ useLocalSecurityServer=”true” useDomainQualifiedUserNames=”false” enabled=”false” cacheTimeout=”600″ issuePermissionWarning=”true” activeProtocol=”BOTH” enforceJava2Security=”false” enforceFineGrainedJCASecurity=”false” appEnabled=”false” dynamicallyUpdateSSLConfig=”true” allowBasicAuth=”true” activeAuthMechanism=”LTPA_1″ activeUserRegistry=”WIMUserRegistry_1″ defaultSSLSettings=”SSLConfig_DV_AppServer01_1″ adminPreferredAuthMech=”RSAToken_1″>

If there is ever an emergency and you are locked out of the console, then you can turn security off by editing this file. I do not advocate manually changing WAS XML files unless you know what you’re doing. If you are going to do it, then best you back up the file first!

Each time we run the Jython script, the security.xml file is updated i.e. it toggles between enabled=true and enabled =false

Now what we are going to do is manually re-enable Global security, so you can see what the wizard does, but before we do, let’s run a security report

We can see below that Administrative is now no longer enabled as shown below.

  • Once we click on the Security Configuration Report, we will get a pop=up screen that shows a report.

If you scroll down you will see the report starts with Security settings and we see that Administrative Security is not enabled.

Then later in the User Registry section, we see that we have Primary administrative username, once again this is because we declared a username and password during our profile creation.

  • Close the Report pop-up window.
  • We can re-enable security using the toggleGlobalSecurity.sh script.
cd /opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof

./toggleGlobalSecurity.sh

Result

ADMIN_USER=wasadmin

ADMIN_PASSWORD=wasadmin

WAS_PROFILE_DIR=/opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof

JYTHON_ROOT=/var/apps/scripts/wasAdmin

Executing script….

WASX7209I: Connected to process “server1″ on node DV_AppServer01 using SOAP connector; The type of process is: UnManagedProcess

INFO:Global security is disabled….enabling

INFO:AdminTask.setGlobalSecurity attributes are as follows:

INFO:[-enabled true]

INFO:Saving configuration….

INFO:Saved changes

INFO:Restart the server for the changes to take affect

  • Restart the server

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

  • Automation
  • Security, SSL
  • Dev Ops
  • Architecture
  • Performance Tuning

Middleware Integration Skills:

  • .NET programming, and Architecture
  • Java Programming, and Architecture
  • SOA, SOAP and XML messaging
  • JBoss Fuse, WMQ, IIB, Mule

Integration Skills:

  • SOA
  • Process Improvement
  • ICD’s
  • Messaging Architecture
  • Governance

General Digital Architecture & Governance

  • Lightweight Architectures
  • Digital Strategy, platform stacks for example IAAS, PAAS, SAAS
  • PCI DSS

Industry Qualifications & Recognition

  • TOGAF 9.1
  • IBM Champion 2013

WebSphere ApacheDS LDAP Example – Installing ApacheDS

$
0
0

 

ApacheDS

ApacheDS is an extensible and embeddable directory server entirely written in Java, which has been certified LDAPv3 compatible by the Open Group. Since ApacheDS is a Java based solution, you will find it easy to administer and configure, and it works well with WebSphere with minimal configuration out of the box.

 

Installing ApacheDS

You can acquire the Apache DS download and installation instructions from http://directory.apache.org/. There are versions available or all major platforms and the documentation is very good. For my installation I have used version 2.0.0-M19 for Linux, which is the latest version available at the time of writing.

 

Once you have downloaded and installed ApacheDS we will need to make some configuration changes for use in our example. To do so, we now need to download and install an LDAP client so we can administer our ApacheDS LDAP sever. To do this, we will use the ApacheDS Eclipse-based admin tool called Apache Directory Studio (ADS), which can be downloaded here: http://directory.apache.org/studio.

I will be using ADS for Windows installed on my Windows desktop. Once you have downloaded and installed ADS, start the application.

I uploaded the installation to /var/apps/installs/ApacheDS

I then ran the following RPM command to install the software

rpm -ivh ./apacheds-2.0.0-M19-x86_64.rpm

Result:

Preparing… ################################# [100%]

Updating / installing…

1:apacheds-2.0.0_M19-1 ################################# [100%]

 

When we issue a find command to locate apacheds we can see the location of the install

find / -name apacheds

Result:

/opt/apacheds-2.0.0_M19/bin/apacheds

 

The structure of the folder is as follows:

 

 

Consult the documentation on the site for more information about the ApacheDS file-structure: https://directory.apache.org/apacheds/advanced-ug/5.1-layout.html

You need to ensure that you have JRE available I installed Open JDK by using yum install java

 

We then need to do a little work to figure out how to run apacheds. Firstly we need to ensure that ApacheDS knows where java is located. I have used OpenJDK, using a yum install.

 

yum install java

This command will install OpenJDK, which is sufficient for our needs.

We now need to edit the wrapper.conf file which defines where the JRE is located.

The wrapper.conf is located in /var/lib/apacheds-2.0.0_M19/default/conf/

We need to add a line that defines the location of java. I have used the command which java

And it reports that java is found in the location: /usr/bin/java

  • Edit the wrapper.conf file as follows:
wrapper.java.command=/usr/bin/java

Note: Use which java to determine path to java

 

The default configuration loaded is located here, but we will not be looking into this ldif file as we will create our own directory partition using Apache Directory Studio.

/var/lib/apacheds-2.0.0_M19/default/conf/config.ldif
  • We also need to open up the firewall on our Linux Server (CentOS 7) for the LDAP protocol
firewall-cmd –zone=public –add-port=10389/tcp –permanent
  • Restart the firewall
firewall-cmd –reload

 

  • Using the following command in CentOS 7 we can start ApacheDS
/etc/init.d/apacheds-2.0.0_M19-default start

Note: To stop change start to stop

  • We can then issue a netstat command to verify that ApacheDS is listening
netstat -an | grep 10389

Result:

tcp6 0 0 :::10389 :::* LISTEN

 

We can now install Apache Directory Studio and connect to your new LDAP Directory.

http://directory.apache.org/studio/download/download-windows.html

  • Download and install Apache Directory Studio (ADS) on to a Windows Desktop (this mimics how you would administer in the real world. We will connect remotely to the LDAP server and then configure our directory to suit our needs.

Once loaded, ADS will present a welcome page.

 

Close the welcome screen and create a new connection to our new ApacheDS LDAP server which will allow us to administer the LDAP directory.

  • From the main menu choose File-New
  • Select LDAP Connection

Click Next

On the New LDAP Connection screen, fill in the Connection name, Hostname and Port as shown below.

  • Click on the Check Network Parameter button to test the network connection to the LDAP server.
  • Once you have a successful connection, then click Next

On the next screen, we will enter uid=admin,ou=system into the Bind DN or user field, and enter secret into the Bind password field. These are the default values for the default instance that we are connecting to.

Note: By default Apache DS provides a default instance, and that instance has a default partition of data ie an LDAP directory which we are connecting to.

Open the connection to the running LDAP server

Once connected we will see the default partition in the LDAP browser as sown below

 

The default partition is called dc=example, dc-system as shown above. We can see the admin user which we used to log into the LDAP server ie uid=admin, ou=system,dc=example,dc=com. Now we will create a new partition, then restart the serve to take effect

 

Adding a new partition

We do not want to sue the default example partition, instead we will create our own. We do this for two reasons.

  1. At the time of writing, there are no succinct articles on the internet that show how to do this using the level of detail we are covering here in this guide. Especially how to use Apache DS as an LDAP sever for WAS.
  2. It is more akin to a production setup, when we use our own directory.

 

It is not recommended that you do not use the default tree starting at dc=example,dc=com. The reason is that with this tree, is the uid=admin,ou=system user is a special admin user user created in the default instance, and though can be used as an LDAP Bind user by WebSphere, Application Server it is not a good idea to use the directory’s admin user. By creating a new tree, we can understand more about how our tree design affects LDAP configurations in WAS. So, with this in mind we are going to create a new partition called dc=themiddlewareshop,dc=com as shown in the screen capture below. It will have one LDAP Bind account called uid=wasldapbind, a group called wasadmins, a group called wasdeployers, a group called applogin and four users. Three users are people and one user will be wasadmin, which is a special account for WAS to use as the Primary Administrator ID for Global Security/LDAP configurations.

 

Below is a table of the data we are creating on our directory i.e. our users, and groups.

DN (Distinguished Name) Role/Description
dc=themiddlewareshop,dc=com Partition name
ou=groups,ou=system,dc=themiddlewareshop,dc=com This is a group organizational unit for categorizing our groups
ou=users,ou=system,dc=themiddlewareshop,dc=com This is a group organizational unit for categorizing our users
uid=wasldapbind,ou=system,dc=themiddlewareshop,dc=com The user WAS will use to connect to the LDAP server i.e. LDAP Bind.
uid=wasadmin,ou=users,ou=system,dc=themiddlewareshop,dc=com Special non “Person/Security” account which WAS will use as the primary administrative account
uid=davidcharles+cn=David+sn=Charles,ou=users,ou=system,dc=themiddlewareshop,dc=com
User
uid=maryroberts+cn=Mary+sn=Roberts,ou=users,ou=system,dc=themiddlewareshop,dc=com
User
uid=bobjackson+cn=Bob+sn=Jackson,ou=users,ou=system,dc=themiddlewareshop,dc=com User
cn=applogin,ou=groups,ou=system,dc=themiddlewareshop,dc=com
Group of users that can log into a test application
cn=wasdeployers,ou=groups,ou=system,dc=themiddlewareshop,dc=com
Group of users who can deploy applications.

Limited WAS administrative capability

cn=wasadmins,ou=groups,ou=system,dc=themiddlewareshop,dc=com Group of WAS admins, with Full administrative capability

 

Table of Group membership we wish to create.

Group CN Members (UIDs) Object Class
applogin uid=davidcharles

uid=maryroberts

inetOrgPerson

organizationalPerson

person

wasdeployers uid=bobjackson inetOrgPerson

organizationalPerson

person

wasadmins uid=wasadmin Account

simpleSecurityObject

 

Creating the partition

Follw these steps to create the new partition

  • Right-click on the LDAP Server Connection

 

Click the Partitions tab, or click the Advanced Partitions configuration link

 

  • In the partitions page, fill in the ID with “The Middleware Shop” and the Suffix field to be “dc=themiddlewareshop,dc=com“, then click then close the page, by clicking the close “X” on the left-hand-side top corner, tab as shown in the image below.

 

  • Save the changes

 

  • Close the connection, so that we can restart the LDAP server.

The LDAP server must be restarted for partition changes to take effect.

  • Issue the stop command
/etc/init.d/apacheds-2.0.0_M19-default
  • Then, once stopped, issue the start command
/etc/init.d/apacheds-2.0.0_M19-default

Now we can log back in to the LDAP server using ADS. We will see a new partition in the LDAP Browser.

In LDAP, an object class defines the collection of attributes that can be used to define an entry. The LDAP standard provides these basic types of object classes:

  • Groups in the directory, including unordered lists of individual objects
    or groups of objects
  • Locations, such as the country name and description
  • Organizations in the directory
  • People in the directory

For instance, the commonName, or cn, attribute is used to store a person’s name. For example, a person named Bob Jackson might be represented in a directory as:

cn=Bob Jackson or cn=Bob, sn=Jackson or commonname

We are now going to manually populate the contents of this directory. First we will add the OUs. Then progress with adding users, then group and populating groups.

Creating OUs

  • Right-click on the new partition and select New->New Entry

On the Entry Creation Method screen, choose Create entry from scratch, and then click Next to continue.

On the New Entry Screen, type “o” to drill down to objects with names starting with “o” and select organizationalUnit, then click Add.

Result

Click Next, then type ou in the RDN (Relative Distinguished Name) field. Then type system in the corresponding value field

 

Click Next

 

We can see that the objectClass is organizationalUnit. We can now add entries beneath this RDN to create further hierarchical RDNs. Hence the term LDAP tree.

Click Finish

The result will be a new ou (ou=system) added to the partition tree, as seen below

 

Now add two other ou’s called Groups and Users underneath system. Follow the same process as above.

Result

Directly under the System OU, we will add a user called wasldapbind, this user is explained in the table of names we looked at earlier.

Adding Users

  • We use the same right-click to create a new entry

In the Object Classes screen you will need to select two object classes from the left-hand-side list of object classes. Scroll or search for inetOrgPerson and click the Add button to populate the right-hand Selected object classes list as show below. Essentially we are defining a schema of required attributes needed to define users.

 

 

 

 

Click Next to progress to the Distinguished Name screen. In this screen you will fill in attribute details required to populate a new user entry. In the RDN section, we can now add entries for fields such the cn, sn and uid attributes as defined by the assigned objectClass, then populate these attributes accordingly.

 

Enter uid in th RDN field and wasldapbind in the value field as shown above, then click next.

 

 

In this example, I did not want to provide a cn, and sn entry, but since they are mandatory objectClass attributes, we can add “” for null.

If you fill out the cn and sn fields, then you will need to specify them in the LDAP Bind in WAS. To make it simpler, I shorten the DN (Distinguished Name) a bit by adding nulls.

Now we wish to create the three people, to do this we select the users OU and add the following new entries that use the inetOrgPerson objectClass.

 

uid=davidcharles+cn=David+sn=Charles,ou=users,ou=system,dc=themiddlewareshop,dc=com
User
uid=maryroberts+cn=Mary+sn=Roberts,ou=users,ou=system,dc=themiddlewareshop,dc=com
User
uid=bobjackson+cn=Bob+sn=Jackson,ou=users,ou=system,dc=themiddlewareshop,dc=com User

Below is a view of the process followed for each user

  • Create a new entry
  • Apply the inetOrgPerson objectclass
  • Fill out the uid, cn, and sn attributes

 

In the example image above, we have just done is create a user (person object) called Bob Jackson with a uid attribute with the value of bobjackson which we will use as a Bob’s username in WebSphere.

Click Finish to Save

Once the new entry has been added, we edit the entry to add a password.

Right-mouse click on a new grid row

Type user in the Attribute type field to search for attributes matching user as seen below

Click Next, then Finish, and you will be presented with the following Password Editor screen:

Type bobjackson as the password and click OK.

Repeat this action for the other two users.

The result being:

 

We have essentially created three new users (people). Before we finish, we need to add a special user known as an account user. This is asecurity ID that will be used by WAS as the Primary Administrative ID when we set up LDAP in WAS.

  • Add a new entry, but this time select the account, and simpleSecurityObject objectClasses as shown below

 

 

Fill in the uid attribute with the value wasadmin

 

 

Click Next, to automatically prompted to add a password. Set the password to wasadmin.

 

Click OK, then Finish

The resulting LDAP tree should now look like the following image

We have completed adding users, now we need to look at how to create groups and assign users to these groups.

Creating a Group

Groups are simple to create, all we do is add a new entry to the appropriate OU, assign an appropriate objectClass for example groupOfNames then we assign the group a CN.

Create a new entry in the Groups OU, and assign the groupOfNames objectClass.

Click Next and fill out the cn attribute for example wasadmins

Click Next and Browse to add members

 

Click Finish, and the result should look something like below

Repeat this process until you have completed this table of groups and memberships

Group CN Members (UIDs)
applogin uid=davidcharles

uid=maryroberts

wasdeployers uid=bobjackson
wasadmins uid=wasadmin

The resulting tree will look like the image below

 

We have now completed setting up our partition for use with WAS LDAP configurations learning how to use role-bases mappings in the console and also later applications.

LDIF Contents

It is possible to import and export LDIF files (.ldif) from Apache Directory Studio. This is very convenient for you to import existing trees. You could in fact create the above partition by creating a file using the contents from the file below.

Note: I have provided this file for download as part of the packaged guides.

For informational purposes, the exported LDIF file of the dc=themiddlewareshop,dc=com tree is as follows:

version: 1

 

dn: uid=maryroberts+cn=Mary+sn=Roberts,ou=users,ou=system,dc=themiddlewaresh

op,dc=com

objectClass: top

objectClass: inetOrgPerson

objectClass: person

objectClass: organizationalPerson

cn: Mary

sn: Roberts

uid: maryroberts

userPassword:: e1NTSEF9QlhKV01MekFDdHpxa204YW5iZmFRenhvS0hUbkN4WWZxcS9qZHc9P

Q==

 

dn: uid=bobjackson+cn=Bob+sn=Jackson,ou=users,ou=system,dc=themiddlewareshop

,dc=com

objectClass: top

objectClass: inetOrgPerson

objectClass: person

objectClass: organizationalPerson

cn: Bob

sn: Jackson

uid: bobjackson

 

dn: ou=groups,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: organizationalUnit

ou: groups

 

dn: dc=themiddlewareshop,dc=com

objectclass: top

objectclass: domain

dc: themiddlewareshop

 

dn: uid=wasadmin,ou=users,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: simpleSecurityObject

objectClass: account

uid: wasadmin

userPassword:: e1NTSEF9K3N0aC9LcHNxc2NZOUw1U3owc3NmYVo0MXFUa0o3RjNxbmRmSlE9P

Q==

 

dn: ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: organizationalUnit

ou: system

 

dn: cn=wasdeployers,ou=groups,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: groupOfNames

cn: wasdeployers

member: uid=bobjackson+cn=Bob+sn=Jackson,ou=users,ou=system,dc=themiddleware

shop,dc=com

 

dn: cn=applogin,ou=groups,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: groupOfNames

cn: applogin

member: uid=davidcharles+cn=David+sn=Charles,ou=users,ou=system,dc=themiddle

wareshop,dc=com

 

dn: ou=users,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: organizationalUnit

ou: users

 

dn: cn=wasadmins,ou=groups,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: groupOfNames

cn: wasadmins

member: uid=wasadmin,ou=users,ou=system,dc=themiddlewareshop,dc=com

 

dn: uid=wasldapbind,ou=system,dc=themiddlewareshop,dc=com

objectClass: top

objectClass: inetOrgPerson

objectClass: person

objectClass: organizationalPerson

cn: “”

sn: “”

uid: wasldapbind

 

dn: uid=davidcharles+cn=David+sn=Charles,ou=users,ou=system,dc=themiddleware

shop,dc=com

objectClass: top

objectClass: inetOrgPerson

objectClass: person

objectClass: organizationalPerson

cn: David

sn: Charles

uid: davidcharles

userPassword:: e1NTSEF9TUhsNGpsYmJacnVCZ01MTWVmOWlmeEtlRUNBMndTc3lZVHJiMXc9P

Q==

 

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

 

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

 

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

 

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

 

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

 

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

 

Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

 

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

 

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

Automation

Security, SSL

Dev Ops

Architecture

Performance Tuning

 

Middleware Integration Skills:

.NET programming, and Architecture

Java Programming, and Architecture

SOA, SOAP and XML messaging

JBoss Fuse, WMQ, IIB, Mule

 

Integration Skills:

SOA

Process Improvement

ICD’s

Messaging Architecture

Governance

 

General Digital Architecture & Governance

Lightweight Architectures

Digital Strategy, platform stacks for example IAAS, PAAS, SAAS

PCI DSS

 

Industry Qualifications & Recognition

TOGAF 9.1

IBM Champion 2013

WebSphere ApacheDS LDAP Example -Changing the OU for LDAP Bind

$
0
0

Changing the OU for LDAP Bind

What I would like to do now is take a walk through the Security – Users and Groups screens so we can see what they look like under Federated Repositories.

  • Navigate to Users and Groups and select Manage Users

We can see the following:

As we can see above, we have a complete listing of the virtual member managed realm ie a federated set of repositories. The wasadmin user exists in fileRegistry.xml and so you can see that it has a different DN. We cannot see the wasadmin user that we do know also exists in the LDAP directory.

Note: The entry highlighted in red, which is our LDAP bind user. We may not wish to see this user in the list of users. We may not want anyone to be able to assign this user to a WAS Role. To hide this user from WAS LDAP searches. Because our Base DN is dc=themiddlewareshop,dc=com we all the users in our directory underneath this bind context. What we can do is move the uid=wasladpabind into a different OU.

  • Create a new OU called security and move the wasldapbind entry to that OU
  • Select the uid=wasldapbind entry and right-mouse click and select Move Entry

Browse for the new destination OU as shown above.

Result:

We now need to change the Federated LDAP settings

  • Navigate to Global Security screen
  • Navigate to User account repository, the click on Configure to enter the Navigate to Global security > Federated repositories screen
  • Click on the Repository Identifier

 

Change the Bind distinguished name to uid=wasldapbind,ou=security,dc=themiddlewareshop,dc=com

 

Click OK and Save

Then click on the Base Entry

 

Change the Unique distinguished name of the base (or parent) entry in federated repositories field to the following:

ou=system,dc=themiddlewareshop,dc=com

When LDAP bind occurs, we will not see the security OU entries in any WAS LDAP searches

 

  • Click OK and Save, now restart WAS.

Next time we view Users and Groups > Manage Users, the result is as follows:

We no longer can see the wasldapbind user.

Using this technique you can now understand how to potentially design/re-design your LDAP directory structure as required for your WAS environment.

Looking a User Groups

We can also see the groups from our LDAP directory when we navigate to Users and Groups > Manage Groups

 

Result:

 

We can now use these users and groups for role-based management. We will cover application security in another guide.

Congratulations, you have now learned the core fundamentals of securing WAS using Federated Repositories. It is also possible to use a standalone LDAP server for both administrative users and application users, we cover this in the next section.

To learn more about the courses available from The Middleware Shop, please go to http://www.themiddlewareshop.com/products to see a full list of the current courses available.

Consulting

If you or your organization require support in architecture, performance tuning, automation or simply advice, then please contact me via my support site and request a conversation, where we can discuss your requirement.

About Steve

Steve is a seasoned passionate technology professional, strategist and leader.

An expert in technical communications, and adept in almost all forms of Internet and mobile related technology, Steve has time and time again proven his tenacity to improve systems around him and deliver.

Steve has worn many hats during his career such as Chief Technical Officer, Founding Member of several business ventures, Programmer, Systems Administrator, Architect, Blogger and Published Author to name a few.

Due to 20 years Industry experience in Middleware, Programming, Networks and Internet Technologies, He combines systems knowledge with efficient working methods and inter personal skills required to build effective relationship with clients and colleagues alike. Exceeding typical expectations in any role undertaken, Steve is certain to become a valuable asset within any organisation He joins.

Key Skills

• Leadership (Team, Project, Business, People).

• Architecture (Solutions, Information, Technical, Applications).

Simply, I help you deal with CANETI: Constant And Never Ending Technological Innovation

Specific IBM WebSphere skills:

WebSphere Application Server (WAS Base, WAS ND & Liberty Profile & Liberty Runtime)

  • Automation
  • Security, SSL
  • Dev Ops
  • Architecture
  • Performance Tuning

Middleware Integration Skills:

  • .NET programming, and Architecture
  • Java Programming, and Architecture
  • SOA, SOAP and XML messaging
  • JBoss Fuse, WMQ, IIB, Mule

Integration Skills:

  • SOA
  • Process Improvement
  • ICD’s
  • Messaging Architecture
  • Governance

General Digital Architecture & Governance

  • Lightweight Architectures
  • Digital Strategy, platform stacks for example IAAS, PAAS, SAAS
  • PCI DSS

Industry Qualifications & Recognition

  • TOGAF 9.1
  • IBM Champion 2013
Viewing all 70 articles
Browse latest View live


Latest Images