# Configure ONEWEB on WildFly

This section describes how to **configure ONEWEB on WildFly Application Server** in a structured, step‑by‑step manner.

To run ONEWEB on **WildFly 10.0.0.Final**, administrators must prepare the database, configure WildFly management access, install required drivers, configure data sources, deploy application archives, and set up authentication and encoding options.

WildFly supports two operating modes:

* **Standalone Server Mode**
* **Managed Domain Mode**

ONEWEB requires a **full profile** configuration. Sample full profiles are provided for both modes.

WildFly provides two administrative interfaces:

* **Management Console**
* **Management CLI**

These interfaces are used throughout the configuration steps below.

***

### Step 1: Prepare Database User and Permissions

Before deploying ONEWEB archives, the database must be created and prepared.

This includes:

* Creating required **database schemas**
* Creating and configuring **database roles**
* Assigning appropriate **privileges**

Database schemas should be created using the SQL scripts described in **Prepare Database Server**.

All database connections are handled through a dedicated **database user**, for example:

```
erp_oneweb
```

This user is referenced by the data sources and must have sufficient privileges on the associated schemas.

***

### Step 2: Configure Access to WildFly Management Console

WildFly management interfaces are secured by default using a **SASL authentication mechanism**.

To manage deployments, an **administrator user** must be created.

From the `<JBOSS_HOME>/bin` directory, run:

```
./add-user.sh <username> <password> <ManagementRealm>
```

Example:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FSklw0VnvzJn8AxRzQ0Z4%2Fimage.png?alt=media&#x26;token=febacba7-029d-42ce-90ca-a5527deec2fc" alt=""><figcaption></figcaption></figure>

Restart WildFly, then verify access:

```
http://<IP Address>:9990
```

Successful login redirects to the management console:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F5PWoYt5dPBy0OF76A4kQ%2Fimage.png?alt=media&#x26;token=33529aa7-82f1-4ba7-87e9-752149d8f951" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FUex2nuYuJrwZfb3M4n87%2Fimage.png?alt=media&#x26;token=6c8fabbc-cf6e-4576-a2bb-90318e603d2d" alt=""><figcaption></figcaption></figure>

***

### Step 3: Install Database Driver

If ONEWEB uses data‑source persistence, install the JDBC driver **before** creating data sources.

1. Download the JDBC driver (e.g. `postgresql.jar`)
2. Open WildFly Management Console
3. Navigate to **Deployments → Add**
4. Select the driver file and proceed

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Frxz6zRV0lPz8uw3eXt5r%2Fimage.png?alt=media&#x26;token=6adb7012-fe0b-49dc-ad9f-d6d7dadb180a" alt=""><figcaption></figcaption></figure>

Enable the driver and finish:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FpBmTjGmOQuWcy4OSDZMt%2Fimage.png?alt=media&#x26;token=d99bf32a-d04c-4541-8f68-2e3f9a7597cf" alt=""><figcaption></figcaption></figure>

***

### Step 4: Create Datasources

Create the required datasources using **WildFly Management Console**.

#### ONEWEB Datasource Mapping

| Datasource Name | JNDI Name                | Product                                   | Schema      |
| --------------- | ------------------------ | ----------------------------------------- | ----------- |
| a2m             | `java:/jdbc/a2m`         | A2M                                       | eaf\_master |
| IAM2            | `java:/jdbc/iamDS`       | IAM2                                      | iam2        |
| application     | `java:/jdbc/application` | App Designer & Runtime                    | erp\_oneweb |
| master          | `java:/jdbc/master`      | —                                         | eaf\_master |
| pd              | `java:/jdbc/pd`          | Process Designer / PD Monitor / Microflow | pd          |
| bpm             | `java:/jdbc/bpm`         | Process Runtime / Microflow Runtime       | bpm         |
| asp             | `java:/jdbc/asp`         | AppSpace                                  | asp         |
| dpc             | `java:/jdbc/dpc`         | Deployment Center                         | dpc         |
| page            | `java:/jdbc/page`        | Page Designer                             | page        |

#### Creation Flow

1. Configuration → Subsystems → Datasources
2. Select **Non‑XA** → Add
3. Choose **Custom datasource**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FkxeV2t6TSCVJWEJeRIwj%2Fimage.png?alt=media&#x26;token=d27b9489-92ad-4bd9-9dd5-2bdc02a21dcb" alt=""><figcaption></figcaption></figure>

Specify **Datasource Name** and **JNDI Name**:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FWli0aXIXUKbXP4TxOEEE%2Fimage.png?alt=media&#x26;token=ea0e1503-a565-4996-80e4-9565366f10b2" alt=""><figcaption></figcaption></figure>

Select JDBC driver:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FohQWlV1fWNwPT7ga6x3C%2Fimage.png?alt=media&#x26;token=a9018ce4-eff4-40ec-9922-81a3cd40a0a7" alt=""><figcaption></figcaption></figure>

Test connection and finish:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FxDKNDC6aUwygiIatn7Mf%2Fimage.png?alt=media&#x26;token=69b4855b-cf9e-4728-a03b-6da97ad87ada" alt=""><figcaption></figcaption></figure>

***

### Step 5: Deploy the Application Archives

Deploy ONEWEB application archives (WAR/EAR) using the procedure described in:

* **Install ONEWEB Application Components**

This step deploys all ONEWEB modules to the configured application server.

***

### Step 6: Configure Single Sign‑On (SSO)

SSO allows multiple applications deployed on different servers to authenticate users within the same **security domain**.

Before enabling SSO:

* Ensure the security domain is configured
* Verify all EAR/WAR files use the same security domain

Edit:

```
{WILDFLY_HOME}/standalone/configuration/standalone.xml
```

Enable SSO in the configuration:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FQg2FsfaUeDZmfFMqzdjg%2Fimage.png?alt=media&#x26;token=ebc43557-07b3-4ef2-85c4-798a1ad88c9b" alt=""><figcaption></figcaption></figure>

***

### Step 7: WildFly Encoding and Undertow

WildFly uses **Undertow** instead of Tomcat.\
Legacy `org.apache.catalina.*` properties no longer apply.

Edit:

```
{WILDFLY_HOME}/standalone/configuration/standalone.xml
```

Add system properties:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FvKWZ78TgkCuFGOg3HG43%2Fimage.png?alt=media&#x26;token=aa397139-c2aa-4e89-97c9-1297b4c7b18c" alt=""><figcaption></figcaption></figure>

Edit servlet container:

```
XML<servlet-container name="default">
```

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FBwmy5z2wdIJ92qTAnlAy%2Fimage.png?alt=media&#x26;token=134dccdd-b8b9-4ac0-81bd-f7a0aae47a6c" alt=""><figcaption></figcaption></figure>

***

### Step 8: Authentication with WildFly

To integrate ONEWEB with WildFly authentication:

* Register an **Application user** (type **b**)
* Refer to **Step 2** for user creation

Edit `standalone.xml` and add `<login-module>`:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FQWkqyoiPbxqIbd5aHkdW%2Fimage.png?alt=media&#x26;token=268bc9d0-ecae-452a-b627-f6c35edaa75a" alt=""><figcaption></figcaption></figure>

***

### Step 9: Authentication with LDAP

Configure LDAP authentication by editing:

```
{WILDFLY_HOME}/standalone/configuration/standalone.xml
```

LDAP information example:

| Name           | Value         |
| -------------- | ------------- |
| IP             | 192.168.0.183 |
| Port           | 389           |
| Domain         | avalant.co.th |
| Admin User     | xxxxxxxx      |
| Admin Password | xxxxxxxx      |
| Group          | users         |

Add `<login-module>` for LDAP:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FoKNQenFcJIb38cJorWjt%2Fimage%20(1).png?alt=media&#x26;token=5fc662a7-c60b-4d0d-bdf8-452843c291ee" alt=""><figcaption></figcaption></figure>

Configure LDAP values:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FnajvAeIruaaeN1fq8HAw%2Fimage%20(2).png?alt=media&#x26;token=abee4f97-c19b-4dc1-b00d-b6e732441725" alt=""><figcaption></figcaption></figure>

***

### Configuration Complete

After completing all nine steps:

* WildFly is fully configured
* ONEWEB archives are deployed
* Datasources and security are ready
* Authentication (SSO / LDAP) is enabled

The ONEWEB platform is now ready for runtime operation on WildFly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/getting-started/platform-configuration/platform-components-overview-and-management/prepare-prerequisite-software/prepare-application-server/configure-oneweb-on-wildfly.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
