Windows
Die standalone.xml bearbeiten
jdbc-version-template an zwei Stellen mit der jdbc-version austauschen, z.B. mysql-connector-bin.jar
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
jdbc:mysql://localhost:template-db-port/ece2</connection-url>
<driver>jdbc-version-template</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
<drivers>
<driver name="jdbc-version-template" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
template-db-user mit dem mariadb-wildfly-user ersetzen, z.B. root
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>template-db-user</user-name>
<password>template-db-password</password>
template-db-password mit dem mariadb-wildfly-user-passwort ersetzen
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>template-db-user</user-name>
<password>template-db-password</password>
</security>
wildfly-template-port mit dem WildFly-Port ersetzen, hier in der Regel 8080
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:wildfly-template-port}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
template-db-port mit dem Datenbank-Port ersetzen, z.B. 3306
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
jdbc:mysql://localhost:template-db-port/ece2</connection-url>
<driver>jdbc-version-template</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>
module.xml bearbeiten
jdbc-version-template mit JDBC-Version ersetzen, z.B. mysql-connector-bin.jar
<Install-path>\WildFly\modules\system\layers\base\com\h2database\h2\main\module.xml
XML
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
<resources>
<resource-root path="jdbc-version-template"/>
</resources>
<dependencies>
add-user.bat im Verzeichnis <Install-path>\WildFly\bin bearbeiten und template_path mit dem Verzeichnis von JAVA_HOME-SED ersetzen.
<Install-path>\WildFly\bin\add-user.bat
XML
set JAVA_HOME=template_path
rem -------------------------------------------------------------------------
standalone.bat im Verzeichnis <Install-path>\WildFly\bin bearbeiten und template_path mit dem Verzeichnis von JAVA_HOME-SED ersetzen.
<Install-path>\WildFly\bin\standalone.bat
XML
set JAVA_HOME=template_path
rem -------------------------------------------------------------------------
standalone.conf.bat im Verzeichnis <Install-path>\WildFly\bin bearbeiten und template_path mit dem Verzeichnis von JAVA_HOME-SED ersetzen.
<Install-path>\WildFly\bin\standalone.conf.bat
XML
rem set "JAVA_HOME=C:\opt\jdk1.6.0_23"
set JAVA_HOME=template_path
WildFly-Administrator anlegen
Konsole als Administrator öffnen
In das Verzeichnis <Install-path>\WildFly\bin wechseln
add-user.bat aufrufen
Fragen wie folgt beantworten:
WildFly als Service einrichten
Aus dem Verzeichnis <Install-path>\WildFly\docs\contrib\scripts den Ordner service in das Verzeichnis <Install-path>\WildFly\bin kopieren.
In der Adminkonsole in das Verzeichnis <Install-path>\bin\service wechseln
Mit den entsprechenden Variablen für %wildfly-servicename%, %wildfly-ipaddr% und %wildfly-managementport% den unten stehenden Befehl eingeben
<Install-path>\bin\service
BASH
service.bat install /startup /name=%wildfly-servicename% /display=%wildfly-servicename% /controller=%wildfly-ipaddr%:%wildfly-managementport% /config standalone.xml
Datenbank erstellen
a. In der Konsole in das Verzeichnis <Install-path>\<datenbank>\bin wechseln.
b. Bei MariaDB als Datenbank ist es das Verzeichnis <Install-path>\mariadb\bin,den Befehl mysql.exe -u "username" -p ausführen
Hinweis
Hier müssen der Username und das Passwort der Datenbank benutzt werden.
c. Folgende Befehle, mit den entsprechenden Variablen für %mariadb-db-name%,%mariadb-wildfly-user%, %mariadb-wildfly-pw% und %host% eingeben und ausführen lassen.
XML
CREATE DATABASE %mariadb-db-name%;
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'localhost' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'127.0.0.1' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'::1' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'%host%' IDENTIFIED BY '%mariadb-WildFly-pw%';
FLUSH PRIVILEGES;
d. mysql.exe beenden