Difference between revisions of "Local development environment tutorial"
(beginnings of local environment tutorial) |
(Translation work) |
||
Line 15: | Line 15: | ||
'''What to do:''' | '''What to do:''' | ||
* Create a working copy of the codebase via TortoiseSVN (see https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-quick-start.html) | |||
* Start MariaDB in Windows Services | |||
* Create a new connection in Navicat with the following parameters: host: localhost, port:3306, username:root. Connection name doesn't matter. | |||
* Create three new databases in Navicat; tsbase, tslive, and tstest. Configuration should be left as default. | |||
* Start Apache Tomcat in Windows Services. | |||
* Put TempusServa.war in Tomcat 8.5/webapps. A folder with the name TempusServa should be generated automatically after a couple of seconds. | |||
* In TempusServa/sql are some sql files which have to be run on each of the tree databases in navicat in the following order: | |||
# ts_base_restore -> appbase | |||
# ts_live_create -> applive | |||
# ts_test_create -> apptest | |||
Lav en working copy af kodebasen via TortoiseSVN. | Lav en working copy af kodebasen via TortoiseSVN. | ||
Line 126: | Line 138: | ||
<!-- A "Connector" using the shared thread pool--> | <!-- A "Connector" using the shared thread pool--> | ||
<!-- | |||
<Connector executor="tomcatThreadPool" | <Connector executor="tomcatThreadPool" | ||
Line 140: | Line 152: | ||
/> | /> | ||
Hvis man vil åbne Tomcat serveren skal starte den i services og gå til <nowiki>http://localhost:8081/TempusServa</nowiki> | Hvis man vil åbne Tomcat serveren skal starte den i services og gå til <nowiki>http://localhost:8081/TempusServa</nowiki>--> |
Revision as of 15:27, 13 July 2023
This tutorial's goal is to explain how to set up the TS-nocode platform and database on a Windows PC.
You will need:
- TortoiseSVN
- Apache Tomcat 8.5
- Netbeans 8.2 running JDK 1.8
- MariaDB 11
- Navicat for MariaDB
- TempusServa.war
- mariadb-java-client-3.1.4
What to do:
- Create a working copy of the codebase via TortoiseSVN (see https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-quick-start.html)
- Start MariaDB in Windows Services
- Create a new connection in Navicat with the following parameters: host: localhost, port:3306, username:root. Connection name doesn't matter.
- Create three new databases in Navicat; tsbase, tslive, and tstest. Configuration should be left as default.
- Start Apache Tomcat in Windows Services.
- Put TempusServa.war in Tomcat 8.5/webapps. A folder with the name TempusServa should be generated automatically after a couple of seconds.
- In TempusServa/sql are some sql files which have to be run on each of the tree databases in navicat in the following order:
- ts_base_restore -> appbase
- ts_live_create -> applive
- ts_test_create -> apptest
Lav en working copy af kodebasen via TortoiseSVN.
Start mariadb i Windows Services.
Opret en ny connection i navicat til mariadb med host: localhost, port:3306, username:root. Navn på connection er ligegyldig.
Opret tre nye databaser i navicat; appbase, applive, apptest. Efterlad konfigureringen som default.
Start Apache Tomcat i Windows Services.
Indsæt TempusServa.war i Tomcat 8.5/webapps. En folder ved navn TempusServa burde blive genereret af sig selv efter et par sekunder.
I TempusServa/sql ligger der nogle sql filer som skal køres på de tre databaser i nacivat i følgende rækkefølge:
ts_base_restore -> appbase
ts_live_create -> applive
ts_test_create -> apptest
Muligvis skal følgende tilføjes til my.ini i MariaDB 11.0/Data, hvis sql filerne fejler at køre ordentligt:
max_allowed_packet = 1G
innodb-default-row-format = dynamic
innodb-lock-wait-timeout = 1200
innodb_log_file_size = 2G
innodb_log_buffer_size = 1G
innodb_strict_mode = 0
(genstart mariadb i windows services for at aktivere de nye indstillinger)
Opret ny fil TempusServa.xml i Tomcat 8.5\conf\Catalina\localhost
Både context.xml i sfwServlets\web\META-INF og TempusServa.xml skal se sådan ud:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="">
<Resource name="jdbc/TempusServaLive" auth="Container" type="javax.sql.DataSource"
maxActive="80" maxIdle="30" maxWait="2000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
validationQuery="SELECT 1" validationInterval="30000" testOnBorrow="true"
username="tsroot" password="TempusServaFTW!" driverClassName="org.mariadb.jdbc.Driver"
url="jdbc:mariadb://localhost:3306/applive?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8"
/>
<Resource name="jdbc/TempusServaTest" auth="Container" type="javax.sql.DataSource"
maxActive="5" maxIdle="3" maxWait="10000"
logAbandoned="true"
validationQuery="SELECT 1" validationInterval="30000" testOnBorrow="true"
username="tsroot" password="TempusServaFTW!" driverClassName="org.mariadb.jdbc.Driver"
url="jdbc:mariadb://localhost:3306/apptest?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8"
/>
</Context>
Indsæt mariadb-java-client-3.1.4 i Tomcat 8.5\lib
I Netbeans åben følgende projekter og build dem til sidst: p2eShared, p2eSolution, p2eTemplate, sfwServlets
I Netbeans Projects view kør debug file på sfwServlets\Source Packages\dk.p2e.blanket\live.java
login/password er admin/TempusServa1234
Efter login får man en blank side. Gå til http://localhost:8080/TempusServa/Welcome.do for at starte.
visse applive tables mangler. applive referencen til appbase er i øjeblikket tsbase og skal ændres til at hedde appbase. Den findes i systempolicy tabellen i applive. I den tabel skal securotyssllogin og -pages sættes til false, ellers bliver man re-directed til en https side, som ikke loader.
I ts backenden gå til Modules -> Admin services -> Cache control -> Reload policies.
Derefter Rebuild artifacts -> Rebuild views.
views burde blive oprettet i applive databasen.
lav _file tables ved at skrive command=sync i url i front-end
Hvis man starter serveren i netbeans, kan man debugge koden, men man har ikke adgang til back-enden. Hvis man derimod starter via Tomcat i services, kan man ikke se koden, men man har adgang til backenden. En god ide er at starte begge servere i to forskellige porte, så man har det bedste fra begge verdener. Man ændrer tomcat port i Apache Software Foundation\Tomcat 8.5\conf\Server.xml
Jeg sætter den til 8081 i modsætning til i Netbeans, hvor den er 8080. Jeg ved ikke hvad forskellen er mellem de to porte.
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxParameterCount="1000"
/>