서버 설치 · 6 min read · Sep 10, 2025

Debian 11에 WildFly(JBoss) 설치 및 구성 방법

Wildfly는 Java로 작성되고 RedHat에서 개발한 애플리케이션 서버입니다. CLI와 관리 콘솔을 갖춘 간단하고 가벼우며 강력한 서버입니다. 오픈 소스이며 크로스 플랫폼으로, 필요에 따라 추가하거나 제거할 수 있는 플러그형 서브시스템을 기반으로 합니다. Java 웹 애플리케이션을 실행하는 데 필요한 모든 기능을 제공합니다.

이 튜토리얼에서는 Debian 11에서 Nginx를 리버스 프록시로 사용하여 Wildfly를 설치하는 방법을 보여드리겠습니다.

전제 조건

  • Debian 11이 실행되는 서버.
  • 서버 IP를 가리키는 유효한 도메인 이름.
  • 서버에 구성된 루트 비밀번호.

Java JDK 설치

Wildfly는 Java 기반 애플리케이션이므로 서버에 Java가 설치되어 있어야 합니다. 설치되지 않은 경우 다음 명령어를 실행하여 설치할 수 있습니다:

apt-get install default-jdk -y

Java가 설치되면 다음 명령어를 사용하여 확인할 수 있습니다:

java --version

다음 출력에서 Java 버전을 확인할 수 있습니다:

openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2deb10u1, mixed mode, sharing)

Wildfly 설치

먼저, 다음 명령어를 사용하여 Wildfly 애플리케이션을 실행할 사용자 및 그룹을 생성합니다:

groupadd -r wildfly  
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly

다음으로, wget 명령어를 사용하여 Wildfly의 최신 버전을 다운로드합니다:

wget https://github.com/wildfly/wildfly/releases/download/25.0.1.Final/wildfly-25.0.1.Final.zip

다운로드가 완료되면 다음 명령어로 다운로드한 파일의 압축을 풉니다:

unzip wildfly-25.0.1.Final.zip

다음으로, 추출된 디렉토리를 /opt로 이동합니다:

mv wildfly-25.0.1.Final /opt/wildfly

다음으로, /opt/wildfly 디렉토리의 소유권을 변경합니다:

chown -RH wildfly:wildfly /opt/wildfly

다음으로, /etc에 Wildfly 구성 디렉토리를 생성합니다:

mkdir -p /etc/wildfly

다음으로, Wildfly 디렉토리에서 /etc/wildfly 디렉토리로 필요한 모든 파일을 복사합니다:

cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/  
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/  
cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/

다음으로, 모든 셸 스크립트 파일에 실행 권한을 설정합니다:

chmod +x /opt/wildfly/bin/*.sh

다음으로, 다음 명령어로 systemd 데몬을 다시 로드합니다:

systemctl daemon-reload

다음으로, 다음 명령어를 사용하여 Wildfly 서비스를 시작하고 활성화합니다:

systemctl start wildfly  
systemctl enable wildfly

Wildfly 서비스 상태를 확인하려면 다음 명령어를 실행합니다:

systemctl status wildfly

다음과 같은 출력을 얻을 수 있습니다:

? wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-12-10 14:55:07 UTC; 6s ago
 Main PID: 20928 (launch.sh)
    Tasks: 59 (limit: 4701)
   Memory: 171.6M
   CGroup: /system.slice/wildfly.service
           ??20928 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.xml 0.0.0.0
           ??20929 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b 0.0.0.0
           ??21022 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=tru

Dec 10 14:55:07 debian11 systemd[1]: Started The WildFly Application Server.

Wildfly 관리 콘솔 활성화

기본적으로 Wildfly 관리 콘솔은 비활성화되어 있습니다. Wildfly 애플리케이션을 관리하기 위해 활성화하는 것이 좋습니다.

Wildfly 구성 파일을 편집하여 활성화할 수 있습니다:

nano /etc/wildfly/wildfly.conf

다음 줄을 변경합니다:

WILDFLY_BIND=127.0.0.1
WILDFLY_CONSOLE_BIND=127.0.0.1

파일을 저장하고 닫은 후 Wildfly 실행 스크립트를 편집하여 관리 콘솔을 활성화합니다.

nano /opt/wildfly/bin/launch.sh

파일을 아래와 같이 변경합니다:

if [[ "$1" == "domain" ]]; then
    $WILDFLY_HOME/bin/domain.sh -c $2 -b $3 -bmanagement $4
else
    $WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement $4
fi

파일을 저장하고 닫은 후 Wildfly systemd 파일을 편집합니다:

nano /etc/systemd/system/wildfly.service

다음 줄을 변경합니다:

ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND

파일을 저장하고 닫은 후 구성 변경 사항을 적용하기 위해 systemd 데몬을 다시 로드합니다:

systemctl daemon-reload

다음으로, 변경 사항을 적용하기 위해 Wildfly 서비스를 재시작합니다:

systemctl restart wildfly

다음 명령어로 Wildfly 상태를 확인할 수 있습니다:

systemctl status wildfly

다음과 같은 출력을 얻을 수 있습니다:

? wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-12-10 14:57:22 UTC; 3s ago
 Main PID: 21182 (launch.sh)
    Tasks: 64 (limit: 4701)
   Memory: 205.6M
   CGroup: /system.slice/wildfly.service
           ??21182 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.xml 127.0.0.1 127.0.0.1
           ??21183 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b 127.0.0.1 -bmanagement 127.0.0.1
           ??21282 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=tru

Dec 10 14:57:22 debian11 systemd[1]: Started The WildFly Application Server.

이 시점에서 Wildfly가 시작되고 포트 8080과 9990에서 수신 대기합니다. 다음 명령어로 확인할 수 있습니다:

ss -plnt

다음과 같은 출력을 얻을 수 있습니다:

State        Recv-Q       Send-Q             Local Address:Port             Peer Address:Port                                                 
LISTEN       0            128                      0.0.0.0:22                    0.0.0.0:*           users:(("sshd",pid=678,fd=3))            
LISTEN       0            128                    127.0.0.1:8443                  0.0.0.0:*           users:(("java",pid=21282,fd=485))        
LISTEN       0            50                     127.0.0.1:9990                  0.0.0.0:*           users:(("java",pid=21282,fd=487))        
LISTEN       0            80                     127.0.0.1:3306                  0.0.0.0:*           users:(("mysqld",pid=12461,fd=21))       
LISTEN       0            128                    127.0.0.1:8080                  0.0.0.0:*           users:(("java",pid=21282,fd=476))        
LISTEN       0            128                         [::]:22                       [::]:*           users:(("sshd",pid=678,fd=4))            

작업이 완료되면 다음 단계로 진행할 수 있습니다.

Wildfly 관리 사용자 생성

다음으로, Wildfly 관리 콘솔에 접근하기 위해 관리 사용자를 생성해야 합니다. 다음 명령어를 실행하여 생성할 수 있습니다:

sh /opt/wildfly/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): a

a를 입력하고 Enter 키를 눌러 관리 사용자를 추가합니다. 사용자 이름과 비밀번호를 정의하라는 메시지가 표시됩니다:

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : hitesh
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should be different from the username
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : 
Re-enter Password : 

사용자 이름과 비밀번호를 입력하고 Enter를 누릅니다. 다음으로 사용자를 어떤 그룹에 추가할 것인지 묻는 메시지가 표시됩니다:

What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
About to add user 'hitesh' for realm 'ManagementRealm'
Is this correct yes/no? yes

yes를 입력하고 Enter 키를 눌러 계속 진행합니다. 사용자가 추가되면 다음과 같은 출력을 얻을 수 있습니다:

Added user 'hitesh' to file '/opt/wildfly/standalone/configuration/mgmt-users.properties'
Added user 'hitesh' to file '/opt/wildfly/domain/configuration/mgmt-users.properties'
Added user 'hitesh' with groups  to file '/opt/wildfly/standalone/configuration/mgmt-groups.properties'
Added user 'hitesh' with groups  to file '/opt/wildfly/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
 e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server Jakarta Enterprise Beans calls.
yes/no? yes
To represent the user add the following to the server-identities definition 

작업이 완료되면 다음 단계로 진행할 수 있습니다.

Nginx를 리버스 프록시로 설치 및 구성

다음으로, Wildfly에 접근하기 위해 Nginx를 리버스 프록시로 구성해야 합니다.

먼저, 아래 명령어를 사용하여 Nginx 패키지를 설치합니다:

apt-get install nginx -y

Nginx가 설치되면 다음 명령어로 Nginx 프록시 파일을 생성합니다:

nano /etc/nginx/conf.d/proxy_headers.conf

다음 줄을 추가합니다:

proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Front-End-Https on;
add_header Cache-Control no-cache;

파일을 저장하고 닫은 후 Wildfly에 대한 Nginx 가상 호스트 구성 파일을 생성합니다:

nano /etc/nginx/conf.d/wildfly.conf

다음 줄을 추가합니다:

server {
  listen          80;
  server_name     wildfly.yourdomain.com;

  location / {
    include conf.d/proxy_headers.conf;
    proxy_pass http://127.0.0.1:8080;
  }

  location /management {
    include conf.d/proxy_headers.conf;
    proxy_pass http://127.0.0.1:9990/management;
  }

  location /console {
    include conf.d/proxy_headers.conf;
    proxy_pass http://127.0.0.1:9990/console;
  }

  location /logout {
    include conf.d/proxy_headers.conf;
    proxy_pass http://127.0.0.1:9990/logout;
  }

  location /error {
    include conf.d/proxy_headers.conf;
    proxy_pass http://127.0.0.1:9990;
  }

}

파일을 저장하고 닫은 후 다음 명령어로 Nginx의 구문 오류를 확인합니다:

ginx -t

다음과 같은 출력을 확인할 수 있습니다:

ginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

마지막으로, 변경 사항을 적용하기 위해 Nginx 서비스를 재시작합니다:

systemctl restart nginx

아래 명령어로 Nginx 상태를 확인할 수 있습니다:

systemctl status nginx

다음과 같은 출력을 얻을 수 있습니다:

? nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-12-10 15:12:26 UTC; 9s ago
     Docs: man:nginx(8)
  Process: 22115 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 22116 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 22117 (nginx)
    Tasks: 3 (limit: 4701)
   Memory: 3.8M
   CGroup: /system.slice/nginx.service
           ??22117 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ??22118 nginx: worker process
           ??22119 nginx: worker process

Dec 10 15:12:25 debian11 systemd[1]: Starting A high performance web server and a reverse proxy server...
Dec 10 15:12:26 debian11 systemd[1]: Started A high performance web server and a reverse proxy server.

이 시점에서 Nginx가 설치되고 Wildfly를 제공하도록 구성되었습니다. 이제 다음 단계로 진행할 수 있습니다.

Wildfly 웹 UI 접근

이제 웹 브라우저를 열고 URL http://wildfly.yourdomain.com을 사용하여 Wildfly 애플리케이션 페이지에 접근합니다. 다음 화면에서 Wildfly 기본 페이지를 확인할 수 있습니다:

WildFly JAVA 애플리케이션 서버

Wildfly 관리 콘솔에 접근하려면 웹 브라우저에서 URL http://wildfly.yourdomain.com/console/을 입력합니다. 다음과 같이 관리자 사용자 이름과 비밀번호를 입력하라는 메시지가 표시됩니다:

WildFly 로그인

관리자 사용자 이름과 비밀번호를 입력하고 로그인 버튼을 클릭합니다. 로그인하면 Wildfly 관리 대시보드를 확인할 수 있습니다:

WildFly 관리 대시보드

결론

축하합니다! Nginx를 리버스 프록시로 사용하여 Debian 11에 Wildfly를 성공적으로 설치했습니다. 이제 Wildfly를 사용하여 인터넷에서 Java 애플리케이션을 호스팅할 수 있습니다. 질문이 있으면 언제든지 문의해 주세요.

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.