1. 준비사항
리눅스 서버 환경에 JAVA 를 설치합니다.
2. JBOSS 다운로드 및 설정
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@localhost ~] # cd /usr/local/src [root@localhost src] # wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz [root@localhost src] # tar xvfz jboss-as-7.1.1.Final.tar.gz -C /usr/share [root@localhost src] # mv /usr/share/jboss-as-7.1.1.Final/ /usr/share/jboss-as [root@localhost src] # cd /usr/share/jboss-as [root@localhost jboss-as] # groupadd jboss [root@localhost jboss-as] # useradd -s /bin/bash -g jboss jboss [root@localhost jboss-as] # chown -Rf jboss.jboss /usr/share/jboss-as/ [root@localhost jboss-as] # su - jboss [jboss@localhost ] $ java -version java version "1.7.0_10" Java(TM) SE Runtime Environment (build 1.7.0_10-b18) Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode) [jboss@localhost ] $ exit |
3. JBOSS start/stop/restart 스크립트 만들기
1 2 3 4 5 6 7 8 9 |
[root@localhost src] # cd /usr/share/jboss-as/bin/init.d [root@localhost init.d] # cp jboss-as-standalone.sh /etc/init.d/jboss [root@localhost init.d] # vi /etc/init.d/jboss ~~ vi /etc/init.d/jboss 하여 16라인 쯤 'export JAVA_HOME' 아래 다음 두줄을 추가 합니다. JBOSS_USER=jboss export JBOSS_USER ~~ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/bin/sh # # JBoss standalone control script # # chkconfig: - 80 20 # description: JBoss AS Standalone # processname: standalone # pidfile: /var/run/jboss-as/jboss-as-standalone.pid # config: /etc/jboss-as/jboss-as.conf # Source function library. . /etc/init.d/functions # Load Java configuration. [ -r /etc/java/java.conf ] && . /etc/java/java.conf export JAVA_HOME JBOSS_USER=jboss export JBOSS_USER # Load JBoss AS init.d configuration. if [ -z "$JBOSS_CONF" ]; then JBOSS_CONF="/etc/jboss-as/jboss-as.conf" fi ~ 생략 ~ |
1 2 3 4 5 6 7 8 9 10 |
[root@localhost init.d] # cd /etc/init.d/ [root@localhost init.d] # chmod 755 jboss [root@localhost init.d] # chkconfig --add jboss [root@localhost init.d] # chkconfig --level 234 jboss on [root@localhost init.d] # service jboss start Starting jboss-as: [ OK ] [root@localhost init.d] # service jboss stop jboss-as 를 정지 중: *** JBossAS process (1521) received TERM signal *** [ OK ] [root@localhost init.d] # |
4. JBOSS 바인딩 변경
1 2 3 4 |
JBOSS 의 기본 바인드 주소는 127.0.0.1 입니다. 웹브라우저 에서 JBOSS 확인을 위해 바인드 주소를 변경해 보겠습니다. [root@lo ~] # vi /usr/share/jboss-as/standalone/configuration/standalone.xml interface name="public" 부분에 바인드 주소를 변경합니다. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <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> |
1 |
[root@localhost ~] # service jboss start |
5. 웹접속 확인
웹브라우저 주소창에 http://IP어드레스:8080 입력하여 접속합니다.
6. JBOSS Admin 콘솔접속
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@localhost ~] # cd /usr/share/jboss-as/bin [root@localhost bin]# ./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 : user_id Password : Re-enter Password : About to add user 'user_id' for realm 'ManagementRealm' Is this correct yes/no? yes Added user 'user_id' to file '/usr/share/jboss-as/standalone/configuration/mgmt-users.properties' Added user 'user_id' to file '/usr/share/jboss-as/domain/configuration/mgmt-users.properties' [root@localhost bin]# |
웹브라우저 창에 http://ip어드레스:9990 하여 관리콘솔로 접속 합니다.
참조 : http://www.davidghedini.com/pg/entry/install_jboss_7_on_centos