====== 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**
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í.
=== 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 ===
http://isn.cz:8080
=== JBOSS AS MANAGEMENT CONSOLE URL ===
http://isn.cz:9990
===== 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.
===== Integrace s NetBeans =====
[[netbeans|NetBeans]]
Od verze NetBeans 7.3.1 lze nastavit apikační server JBOSS 7.X.
**Nový projekt s JBOSS 7.1.1 Final**
- click on menu **File** -> **New Project**
- select **Categories: Java** or **Maven**
- select **Projects: Web Application**
- click on button **Next >**
- set any **Project Name:** testjboss7 -> click on button **Next >**
- set **Server:** .... -> click on button **Add...** (or **Server** -> **Tools** -> **Servers** without create project)
- select **Server: JBoss Application Server** -> click on button **Next >**
- set **Server Location:** ... click button **Browse...** select place with unziped JBoss AS directory [[aplikacni-server-jboss#instalace-a-konfigurace-as-jboss|download here]]
- for windows example: **C:\work\JAVA\as\jboss-as-7.1.1.Final**
- click on button **Next >**
* default **Domain: standalone**
* default **Location: localhost**
* default **Port: 8080**
- click on button **Finish**