Uživatelské nástroje

Nástroje pro tento web


aplikacni-server-jboss

JBOSS AS

Aplikační server JBOSS.

ORACLE JAVA 6 pro JBOSS AS

Nainstalovat do systému (CentOS 6) JAVA SE JDK 6.

Download: http://www.oracle.com/technetwork/java/index.html

shell# mkdir /opt/java-jboss
shell# chmod 755 /opt/java-jboss/jdk-6u45-linux-x64.bin
shell# cd /opt/java-jboss
shell# ./jdk-6u45-linux-x64.bin
shell# chown -R root:0 /opt/java-jboss

Přidat do výběru nastavení

shell# alternatives --install /usr/bin/java java /opt/java-jboss/jdk1.6.0_45/bin/java 3

Nastavit jako výchozí

shell# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
*+ 2           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   3           /opt/java-jboss/jdk1.6.0_45/bin/java

Enter to keep the current selection[+], or type selection number: 3
shell#

Ověření zda je výchozí

shell# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Instalace a konfigurace AS JBOSS

Download: http://www.jboss.org/jbossas/downloads

Rozbalení staženého JBOSS AS v /opt

shell# cd /opt
shell# wget -c -t 0 http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
shell# unzip jboss-as-7.1.1.Final.zip

Nastavení startovacího skriptu

Pro CentOS 6.X.

shell# cp /opt/jboss-as-7.1.1.Final/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
shell# cp /opt/jboss-as-7.1.1.Final/bin/init.d/jboss-as.conf /etc/sysconfig/jboss
shell# chkconfig --add jboss
shell# chkconfig --level 35 jboss on

Úprava konfigurace /etc/sysconfig/jboss

/etc/sysconfig/jboss
JBOSS_USER=jboss
JBOSS_HOME=/opt/jboss-as-7.1.1.Final
JBOSS_CONSOLE_LOG=/var/log/jboss-as/console.log

Úprava /etc/init.d/jboss

/etc/init.d/jboss
JBOSS_CONF="/etc/sysconfig/jboss"

Vytvoření uživatele JBOSS

shell# useradd -m -d /opt/jboss-as-7.1.1.Final -s /bin/bash jboss

Nastavení práv vlastníka

shell# chown -R jboss:jboss /opt/jboss-as-7.1.1.Final

Vytvoření /etc/profile.d/jboss.sh

Nastavení proměnných pro JBOSS a JAVA cest, mohu nakonec využívat jinou verzi JAVA než je standardně definováno v systému.

/etc/profile.d/jboss.sh
# jboss java
JAVA_HOME=/opt/java-jboss/jdk1.6.0_45
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$JAVA_HOME/lib
LD_LIBRARY_PATH=$JAVA_HOME/jre/lib
export JAVA_HOME PATH CLASSPATH LD_LIBRARY_PATH
 
# jboss settings
JBOSS_HOME=/opt/jboss-as-7.1.1.Final
PATH=$PATH:$JBOSS_HOME/bin
export JBOSS_HOME PATH

Konfigurace /opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml

0.0.0.0 platí pro všechna rozhraní.

/opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml
<interfaces>
    <interface name="management">
        <!-- <inet-address value="${jboss.bind.address.management:127.0.0.1}"/> -->
        <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
    </interface>
    <interface name="public">
        <!-- <inet-address value="${jboss.bind.address:127.0.0.1}"/> -->
        <inet-address value="${jboss.bind.address:0.0.0.0}"/>
    </interface>
    <!-- TODO - only show this if the jacorb subsystem is added  -->
    <interface name="unsecure">
        <!--
          ~  Used for IIOP sockets in the standard configuration.
          ~                  To secure JacORB you need to setup SSL
          -->
        <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
    </interface>
</interfaces>

Start, restart, stop

shell# /etc/init.d/jboss start
shell# /etc/init.d/jboss restart
shell# /etc/init.d/jboss stop

nebo

shell# service jboss start
shell# service jboss restart
shell# service jboss stop

Přidání uživatele pro přístup k management console

Uživatel: blazek
Heslo: – nejaketajneheslo –

shell# cd /opt/jboss-as-7.1.1.Final/bin
shell# ./add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a):

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : blazek
Password :
Re-enter Password :
About to add user 'blazek' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'blazek' to file '/opt/jboss-as-7.1.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'blazek' to file '/opt/jboss-as-7.1.1.Final/domain/configuration/mgmt-users.properties'
shell#

JBOSS AS URL

JBOSS AS MANAGEMENT CONSOLE URL

Deploy aplikací

Nahrát WAR do /opt/jboss-as-7.1.1.Final/standalone/deployments.

Zvýšení deploy timeoutu (v sekundách), default je 60 s.

/opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
   <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="1000"/>
</subsystem>

Integrace s NetBeans

NetBeans

Od verze NetBeans 7.3.1 lze nastavit apikační server JBOSS 7.X.

Nový projekt s JBOSS 7.1.1 Final

  1. click on menu FileNew Project
  2. select Categories: Java or Maven
  3. select Projects: Web Application
  4. click on button Next >
  5. set any Project Name: testjboss7 → click on button Next >
  6. set Server: …. → click on button Add… (or ServerToolsServers without create project)
  7. select Server: JBoss Application Server → click on button Next >
  8. set Server Location: … click button Browse… select place with unziped JBoss AS directory download here
  9. for windows example: C:\work\JAVA\as\jboss-as-7.1.1.Final
  10. click on button Next >
    • default Domain: standalone
    • default Location: localhost
    • default Port: 8080
  11. click on button Finish
aplikacni-server-jboss.txt · Poslední úprava: 2016/06/17 09:40 autor: blazek