이 페이지는 Wildfly Maven plugin과 Jenkins를 이용해 JBoss 용 웹 애플리케이션을 자동으로 빌드하고 배포하는 방법을 기술한다. JBoss는 Redhat 사의 WAS 이고 무료 제품인 community version과 상용 제품인 enterprise로 구성된다.
JBoss 관리는 command line console과 Web console로 접근 가능
JBoss는 두 가지 모드로 운영할 수 있다. 본 문서는 standalone mode를 기준으로 작성되었다.
JBoss는 로컬에서 접근하는 것이 기본이므로 원격 PC에서 관리하려면 설정이 필요함
설정파일
<install-directory>/standalone/configuration/standalone.xml
기본 설정:
1 2 3 4 5 6 | <interface name="management"> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> |
위의 설정을 다음과 같이 변경
1 2 3 4 5 6 | <interface name="management"> <any-address/> </interface> <interface name="public"> <any-address/> </interface> |
JBoss 설정 로딩하여 반영
<install-directory>/bin/jboss-cli.sh --connect --command=:reload
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/> <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/> <socket-binding name="http" port="${jboss.http.port:8080}"/> <socket-binding name="https" port="${jboss.https.port:8443}"/> <socket-binding name="txn-recovery-environment" port="4712"/> <socket-binding name="txn-status-manager" port="4713"/> <outbound-socket-binding name="mail-smtp"> <remote-destination host="localhost" port="25"/> </outbound-socket-binding> </socket-binding-group> |
TBD
Prerequisites
Procedure 3.17. Setup the Service
Locate the start-up script and configuration file
EAP_HOME
/bin/init.d/
directory. Open the configuration file jboss-as.conf
to edit it.Customize the start-up options in the jboss-as.conf
file
jboss-as.conf
file. At the minimum, specify the correct values for JBOSS_HOME
and the JBOSS_USER
variables. If these variables are absent, add them.Copy files into system directories
/etc/jboss-as
directory.[user@host init.d]$
sudo mkdir /etc/jboss-as
[user@host init.d]$
sudo cp jboss-as.conf /etc/jboss-as/
/etc/init.d
directory.[user@host init.d]$
sudo cp jboss-as-standalone.sh /etc/init.d
Add the start-up script as a service.
jboss-as-standalone.sh
service to list of automatically started services, using the chkconfig
service management command.[user@host init.d]$
sudo chkconfig --add jboss-as-standalone.sh
Start the service.
[user@host bin]$
sudo service jboss-as-standalone.sh start
Make the service start automatically when you restart your server.
[root@host ~]# chkconfig jboss-as-standalone.sh on
# > <install-directory>/bin/standalone.sh |
이 절은 JBoss 용 애플리케이션을 빌드하고 배포하는 방법을 정리한다. 이 문서는 Maven 프로젝트를 기준으로 설명한다.
Maven 프로젝트의 경우 Wildfly 플러그인을 이용해 배포한다.
# > mvn install wildfly:deploy -Dname=admin -Dpassword=password |
# > mvn wildfly:undeploy -Dname=admin -Dpassword=password |