|
|
---
|
|
---
|
|
|
title: To setup the development environment
|
|
title: To setup the development environment
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Steps to install and configure the development environment under the Linux (Ubuntu) distribution
|
|
## Steps to install and configure the development environment under the Linux (Ubuntu) distribution
|
|
|
|
|
|
|
|
### Java: OpenJDK 17
|
|
### Java: OpenJDK 17
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install openjdk-17-jre-headless
|
|
$ sudo apt install openjdk-17-jre-headless
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Build tool: Maven
|
|
### Build tool: Maven
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install maven
|
|
$ sudo apt install maven
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### DB: PostgreSQL/PgAdmin4 (Management tool for PostgreSQL)
|
|
### DB: PostgreSQL/PgAdmin4 (Management tool for PostgreSQL)
|
|
|
|
|
|
|
#### PostgreSQL:
|
|
#### PostgreSQL:
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install -y postgresql-common -y
|
|
$ sudo apt install -y postgresql-common -y
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh (Press Enter when prompted.)
|
|
$ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh (Press Enter when prompted.)
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install -y postgresql
|
|
$ sudo apt install -y postgresql
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo systemctl restart postgresql
|
|
$ sudo systemctl restart postgresql
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo systemctl status postgresql
|
|
$ sudo systemctl status postgresql
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo -u postgres psql
|
|
$ sudo -u postgres psql
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD '<password>';
|
|
postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD '<password>';
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
postgres=# CREATE USER db_manager ENCRYPTED PASSWORD '<password>';
|
|
postgres=# CREATE USER db_manager ENCRYPTED PASSWORD '<password>';
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
postgres=# \q
|
|
postgres=# \q
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo sed -i '/^local/s/peer/scram-sha-256/' /etc/postgresql/17/main/pg_hba.conf
|
|
$ sudo sed -i '/^local/s/peer/scram-sha-256/' /etc/postgresql/17/main/pg_hba.conf
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo systemctl restart postgresql
|
|
$ sudo systemctl restart postgresql
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### PgAdmin4:
|
|
#### PgAdmin4:
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install pgadmin4-desktop
|
|
$ sudo apt install pgadmin4-desktop
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### DB Setup:
|
|
#### DB Setup:
|
|
|
|
|
|
|
- Open PgAdmin4
|
|
- Open PgAdmin4
|
|
|
- Create a new database and add the user (//Example: Database: “regAppDev” and the Owner: “regapp-dev”)
|
|
- 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)
|
|
- 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:
|
|
#### Inject the existing “regApp” DB to the Postgresql:
|
|
|
|
|
|
|
- Download the `regapp_dev.sql` file from [bws&s](https://bwsyncandshare.kit.edu/apps/files/files/4223252485?dir=/regApp_setup)
|
|
- Download the `regapp_dev.sql` file from [bws&s](https://bwsyncandshare.kit.edu/apps/files/files/4223252485?dir=/regApp_setup)
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ psql --username=<db_user_name> databasename < data_base_dump.sql
|
|
$ 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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:
|
|
### Apache Web Server:
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo apt install apache2
|
|
$ sudo apt install apache2
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo a2ensite default-ssl
|
|
$ sudo a2ensite default-ssl
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo a2enmod ssl
|
|
$ sudo a2enmod ssl
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo a2enmod proxy_ajp
|
|
$ sudo a2enmod proxy_ajp
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ systemctl restart apache2
|
|
$ systemctl restart apache2
|
|
|
```
|
|
```
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo vim /etc/apache2/sites-enabled/default-ssl.conf
|
|
$ 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
|
|
Add the line `ProxyPass/ajp://127.0.0.1:8010/` to the `default-ssl.conf` file
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ sudo vim /etc/hosts
|
|
$ sudo vim /etc/hosts
|
|
|
```
|
|
```
|
|
|
|
|
|
|
Add the line `127.0.0.1 bwidm-test.scc.kit.edu` to the `/etc/hosts` file
|
|
Add the line `127.0.0.1 bwidm-test.scc.kit.edu` to the `/etc/hosts` file
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
$ systemctl restart apache2
|
|
$ systemctl restart apache2
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
### IDE:
|
|
### 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))
|
|
- 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))
|
|
|
|
* Install Lombok in Eclipse (https://projectlombok.org/setup/eclipse): `Help` → `Install New Software...` and use Updatesite https://projectlombok.org/p2. Restart Eclipse completly afterwards. The offered "Restart" is not enough. Quit eclipse, wait until all java processes have ended.
|
|
|
|
|
|
|
|
### Wildfly on Eclipse:
|
|
### Wildfly on Eclipse:
|
|
|
|
|
|
|
- Download the `wildfly-29.0.1.Final.tar.gz` file from [bws&s](https://bwsyncandshare.kit.edu/apps/files/files/4223252485?dir=/regApp_setup)
|
|
- Download the `wildfly-29.0.1.Final.tar.gz` file from [bws&s](https://bwsyncandshare.kit.edu/apps/files/files/4223252485?dir=/regApp_setup)
|
|
|
- Open Eclipse
|
|
- Open Eclipse
|
|
|
- `Help` → `Eclipse Marketplace` → `JBoss Tools` → `Install` → Follow the steps → `Restart Eclipse`
|
|
- `Help` → `Eclipse Marketplace` → `JBoss Tools` → `Install` → Follow the steps → `Restart Eclipse`
|
| ... | @@ -138,9 +162,9 @@ The first “Start” will fail as the DB info need to be changed in the `standa |
... | @@ -138,9 +162,9 @@ The first “Start” will fail as the DB info need to be changed in the `standa |
|
|
### Source Code
|
|
### Source Code
|
|
|
|
|
|
|
|
- Download the `regApp` source code from [GitLab](https://gitlab.kit.edu)
|
|
- Download the `regApp` source code from [GitLab](https://gitlab.kit.edu)
|
|
|
|
|
|
|
```
|
|
```
|
|
|
- $ git clone https://gitlab.kit.edu/kit/reg-app/regapp
|
|
- $ 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` |
|
- From Eclipse: `File` → `Import` → `Maven (Existing Maven Projects)` → Specify the path to the `regApp` directory → `Finish` |
|
|
|
\ No newline at end of file |
|
|
|
|
|