|
|
|
## Steps to install and configure the development environment
|
|
|
|
|
|
|
|
### Java: OpenJDK 17
|
|
|
|
```
|
|
|
|
$ sudo apt install openjdk-17-jre-headless
|
|
|
|
```
|
|
|
|
|
|
|
|
### Build tool: Maven
|
|
|
|
```
|
|
|
|
$ sudo apt install maven
|
|
|
|
```
|
|
|
|
|
|
|
|
### DB: PostgreSQL/PgAdmin4 (Management tool for PostgreSQL)
|
|
|
|
#### PostgreSQL:
|
|
|
|
```
|
|
|
|
$ sudo apt install -y postgresql-common -y
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh (Press Enter when prompted.)
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo apt install -y postgresql
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo systemctl restart postgresql
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo systemctl status postgresql
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo -u postgres psql
|
|
|
|
```
|
|
|
|
```
|
|
|
|
postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD '<password>';
|
|
|
|
```
|
|
|
|
```
|
|
|
|
postgres=# CREATE USER db_manager ENCRYPTED PASSWORD '<password>';
|
|
|
|
```
|
|
|
|
```
|
|
|
|
postgres=# \q
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo sed -i '/^local/s/peer/scram-sha-256/' /etc/postgresql/17/main/pg_hba.conf
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo systemctl restart postgresql
|
|
|
|
```
|
|
|
|
|
|
|
|
#### PgAdmin4:
|
|
|
|
```
|
|
|
|
$ sudo apt install pgadmin4-desktop
|
|
|
|
```
|
|
|
|
|
|
|
|
#### DB Setup:
|
|
|
|
- Open PgAdmin4
|
|
|
|
- Create a new database and add the user (//Example: Database: “regAppDev” and the Owner: “regapp-dev”)
|
|
|
|
- Create new user in Login/Group Roles and assign assign required permissions (//Example: Name: regapp-dev and set Privileges: Can login? Yes)
|
|
|
|
|
|
|
|
#### Inject the existing “regApp” DB to the Postgresql:
|
|
|
|
- Download the `regapp_dev.sql` file from [bws&s](https://bwsyncandshare.kit.edu/s/Ma62SwGfB37TyGL)
|
|
|
|
```
|
|
|
|
$ psql --username=<db_user_name> databasename < data_base_dump.sql
|
|
|
|
```
|
|
|
|
- Edit the file `/etc/postgresql/17/main/postgresql.conf` file and set `max_prepared_transactions` to `32`, instead of 0. //On the production system it is set to 128.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Apache Web Server:
|
|
|
|
```
|
|
|
|
$ sudo apt install apache2
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo a2ensite default-ssl
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo a2enmod ssl
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo a2enmod proxy_ajp
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ systemctl restart apache2
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ sudo vim /etc/apache2/sites-enabled/default-ssl.conf
|
|
|
|
```
|
|
|
|
Add the line `ProxyPass/ajp://127.0.0.1:8010/` to the `default-ssl.conf` file
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo vim /etc/hosts
|
|
|
|
```
|
|
|
|
Add the line `127.0.0.1 bwidm-test.scc.kit.edu` to the `/etc/hosts` file
|
|
|
|
|
|
|
|
```
|
|
|
|
$ systemctl restart apache2
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### IDE:
|
|
|
|
- Eclipse (recommended version is [4.29.0](https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-09/R/eclipse-jee-2023-09-R-linux-gtk-x86_64.tar.gz))
|
|
|
|
|
|
|
|
### Wildfly on Eclipse:
|
|
|
|
- Download the `wildfly-29.0.1.Final.tar.gz` file from [bws&s](https://bwsyncandshare.kit.edu/s/Ma62SwGfB37TyGL)
|
|
|
|
- Open Eclipse
|
|
|
|
- `Help` → `Eclipse Marketplace` → `JBoss Tools` → `Install` → Follow the steps → `Restart Eclipse`
|
|
|
|
- `Window` → `Show View` → `Other` → `Servers (Server)` → `Open`
|
|
|
|
- Click on the link “No servers are available. Click this link to create a new server…” provided on the Servers tab.
|
|
|
|
- `JBoss Community` →` WildFly 27+` → Choose `The server is`: `Local`, `Controlled by`: `Filesystem and shell operations`, `The selected profile requires a runtime`: `Create new runtime (next page)`
|
|
|
|
- Choose your desired wildfly file in `Home directory`: `/your/directory/wildfly-29.0.1.Final.tar.gz`, `Execution environment`: `JavaSE-17`, `Configuration file`: `standalone-full-ha.xml` → `Add and Remove` → Select the server and add it to the right panel → `Finish`
|
|
|
|
- Right click on the `WildFly 27+` → `Start`
|
|
|
|
|
|
|
|
The first “Start” will fail as the DB info need to be changed in the `standalone-full-ha.xml` file.
|
|
|
|
|
|
|
|
- Edit the `standalone-full-ha.xml` file and change the database _name/username/password_ to the one that you have created earlier. Fields to change are marked in Italic, see the provided example:
|
|
|
|
|
|
|
|
```xml
|
|
|
|
<xa-datasource jndi-name="java:/ds/bwidmDS" pool-name="bwidmDS" enabled="true" use-ccm="true">
|
|
|
|
...
|
|
|
|
<xa-datasource-property name="DatabaseName">
|
|
|
|
_regAppDev_
|
|
|
|
</xa-datasource-property>
|
|
|
|
...
|
|
|
|
<security>
|
|
|
|
<user-name>_regapp-dev_</user-name>
|
|
|
|
<password>_123_</password>
|
|
|
|
</security>
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
- Double click on `Wildfly 27+` → `Open launch configuration` → on the section `VM Arguments` set `-XX:MaxMetaspaceSize=512M` (default is 128M).
|
|
|
|
|
|
|
|
### Source Code
|
|
|
|
|
|
|
|
- Download the `regApp` source code from [GitLab](gitlab.kit.edu)
|
|
|
|
```
|
|
|
|
- $ git clone https://gitlab.kit.edu/kit/reg-app/regapp
|
|
|
|
```
|
|
|
|
|
|
|
|
- From Eclipse: `File` → `Import` → `Maven (Existing Maven Projects)` → Specify the path to the `regApp` directory → `Finish`
|
|
|
|
|