Aplikační server JBOSS.
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)
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
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
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.
# 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í.
<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>
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#
Nahrát WAR do /opt/jboss-as-7.1.1.Final/standalone/deployments.
Zvýšení deploy timeoutu (v sekundách), default je 60 s.
<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>
Od verze NetBeans 7.3.1 lze nastavit apikační server JBOSS 7.X.
Nový projekt s JBOSS 7.1.1 Final