How to install Jboss + DB2 on CentOS Linux 4.5 ?

How to install Jboss + DB2 on CentOS Linux 4.5 ?

I am using Gentoo Linux at home, but I had to install Jboss and DB2 Express-C on CentOS 4.5 at work, here is what you need to do to set them up:

First at all, on CentOS 4.5, I have SELinux disabled and firewall/iptables enabled.

Install JDK 1.5 on CentOS 4.5

In order to use EJB from Jboss, you will need to install JDK 1.5.

  1. CentOS 4.5 comes with Yum (the package management), which makes it much easier to install packages, but there are not so much packages managed in Yum’s default repositories, like Java related packages, so you will need to install an repository for Yum called “jpackage” first.
    cd /etc/yum.repos.d
    wget http://www.jpackage.org/jpackage17.repo

  2. Update your yum repositories
    yum check-update
  3. install JDK 1.5
    cd /usr/local/src
    wget ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.13-1jpp.nosrc.rpm
    download jdk-1_5_0_13-linux-i586.bin from sun
    (under Linux Platform - Java Development Kit 5.0 Update 13 / Linux self-extracting file) and copy to /usr/src/redhat/SOURCES/
    rpmbuild –rebuild /usr/local/src/java-1.5.0-sun-1.5.0.13-1jpp.nosrc.rpm
    rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-1.5.0-13-1jpp.i586.rpm
    rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.13-1jpp.i586.rpm
  4. set up environment variable
    create a file /etc/profile.d/jdk.sh which contains this line in it:
    export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13
    and make it executable:
    chmod +x /etc/profile.d/jdk.sh

Install Jboss 4.2.2 GA on CentOS 4.5

  1. download jboss 4.2.2 GA (or the latest version)
    download jboss from:
    http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=16942
    and extract to /usr/local/, rename the directory from Jboss-4.x.x.GA
    to jboss
    now will have jboss files under /usr/local/jboss directory
  2. create jboss user and group
    groupadd jboss
    useradd -d /usr/local/jboss -g jboss jboss

  3. change password for user jboss
    passwd jboss
  4. change ownership of the whole directory /usr/local/jboss to
    jboss:jboss
    chown jboss:jboss -R /usr/local/jboss


  5. make the jboss control script /etc/init.d/jboss
    cp /usr/local/jboss/bin/jboss_init_redhat.sh /etc/init.d/jboss

    make necessary changes in the file, for example, instead of binding the ip to 127.0.0.1 only, you might want to bind it to external ip, then put this line in the file:
    JBOSS_HOST=0.0.0.0
    make the file executable
    chmod +x /etc/init.d/jboss
  6. enable auto start with OS by making symbolic link of /etc/init.d/jboss to system start up level directory
    find out the default start level you are using:
    open the file /etc/inittab, look at the beginning of the file, you will see something like this:
    id:5:initdefault:
    which means your default run level is 5
    cd /etc/rc5.d (if your default run level is 3, you will need to change directory to /etc/rc3.d)
    ln -s ../init.d/jboss S96jboss

  7. how to start/stop jboss manually ?
    to start:
    /etc/init.d/jboss start
    or
    service jboss start
    to stop:
    /etc/init.d/jboss stop
    or
    service jboss stop
  8. add exception to firewall
    add this line to /etc/sysconfig/iptables
    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT
    restart your firewall:
    /etc/init.d/iptables restart
  9. start jboss and type in http://127.0.0.1:8080 in your browser to check if jboss is running

Install DB2 Express-C 9.5 on CentOS 4.5

  1. fix missing /usr/lib/libstdc++.so.5 (db2 was compiled with older c++ library)
    yum install compat-libstdc++-33
  2. install required package libaio
    yum install libaio
  3. install db2
    download DB2 Express-C for Linux zip file from:
    http://www-306.ibm.com/software/data/db2/express/download.html
    unzip
    run db2_install and follow the steps
  4. add exceptions on firewall
    add these three lines into /etc/sysconfig/iptables:
    -A RH-Firewall-1-INPUT -m state –state NEW -p udp -m udp –dport 523 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state –state NEW -p tcp -m tcp –dport 523 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state –state NEW -p tcp -m tcp –dport 50000 -j ACCEPT

    restart firewall:
    /etc/init.d/iptables restart
  5. create db2 users
    groupadd db2grp1
    groupadd db2fgrp1
    groupadd dasadm1
    useradd -g db2grp1 -m -d /opt/ibm/db2/V9.5/db2inst1 db2inst1 -p PASSWORD
    useradd -g db2fgrp1 -m -d /opt/ibm/db2/V9.5/db2fenc1 db2fenc1 -p PASSWORD
    useradd -g dasadm1 -m -d /opt/ibm/db2/V9.5/dasusr1 dasusr1 -p PASSWORD
  6. create a db2 instance (I chose the
    default install path)
    cd /opt/ibm/db2/V9.5/instance
    ./db2icrt -p 50000 -u db2fenc1 db2inst1
  7. create DAS(Administration Server)
    cd /opt/ibm/db2/V9.5/instance
    ./dascrt -u dasadm1
  8. enable db2 auto start with OS
    su - db2inst1
    db2iauto -on db2inst1

Written by lagjazz on November 14th, 2007 with no comments.
Read more articles on General and Java and Database.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值