Skip to content

Commit 6fcb9a4

Browse files
authored
Merge pull request #127 from ubtue/develop
Überarbeitung NeG
2 parents 8a567ea + 2567e6d commit 6fcb9a4

File tree

444 files changed

+35339
-15993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+35339
-15993
lines changed

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# NeG - Nomen et Gens
22

3+
You can also have a look at the installation example in the docker subdirectory.
4+
35
Prerequisites:
46
- System
57
- Tomcat 9 / Ubuntu (for automated build process). WAR-file should work with Tomcat >= 7.
68
- find /etc/tomcat<n> (might also be /usr/share/tomcat)
79
- conf/web.xml
810
- Find this servlet <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
911
- Add parameter `<init-param><param-name>strictQuoteEscaping</param-name><param-value>false</param-value></init-param>`
10-
- Catalina/localhost/neg.xml (needs to be created)
12+
- Catalina/localhost/neg.xml (needs to be created with correct user credentials)
1113
```
1214
<Context>
1315
<!-- Mandatory -->
@@ -18,23 +20,56 @@ Prerequisites:
1820
<!-- Optional -->
1921
<Environment name="matomoURL" value="" type="java.lang.String"/>
2022
<Environment name="matomoSiteId" value="" type="java.lang.String"/>
23+
24+
<!-- Mail -->
25+
<Environment name="smtpHost" value="smtpserv.uni-tuebingen.de" type="java.lang.String"/>
26+
<Environment name="smtpPort" value="587" type="java.lang.String"/>
27+
<Environment name="smtpUser" value="exampleUser" type="java.lang.String"/>
28+
<Environment name="smtpPassword" value="examplePassword" type="java.lang.String"/>
2129
</Context>
2230
```
2331
- Java >= 1.8.0_77
2432
- MySQL >= 5.7
25-
- collation-server=utf8_unicode_ci
26-
- character-set-server=utf8
33+
- collation-server = utf8_unicode_ci
34+
- character-set-server = utf8mb4
2735
- group_concat_max_len = 100000000
36+
- log_bin_trust_function_creators = 1
2837
- sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
2938
- (please note that NO_AUTO_CREATE_USER has been deprecated & can be omitted in newer SQL Versions)
3039
- If you use MariaDB, also use the following settings to avoid performance problems, especially in search queries (this works for MyISAM but should be tested again when migrating to InnoDB):
3140
- optimizer_switch="derived_merge=off,derived_with_keys=off"
3241
- see also: https://stackoverflow.com/questions/35889706/mariadb-running-a-left-join-query-100-times-slower-than-mysql
3342

43+
For servers (ZDV):
44+
- MySQL
45+
- Make sure you change the db user passwords to something safe.
46+
- if you want to install neg-dmp on a separate machine and access the mysql db in this instance,
47+
you also have to change the host for the user and prevent it to be bound to localhost (e.g. disable bind-address and mysqlx-bind-address in mysqld.cnf).
48+
- [client]
49+
default-character-set = utf8mb4
50+
[mysqld]
51+
character-set-server = utf8mb4
52+
collation-server = utf8mb4_unicode_ci
53+
[mysql]
54+
default-character-set = utf8mb4
55+
- Tomcat
56+
- if tomcat installation fails, contact ZDV admin (workaround for default group 100).
57+
- change tomcat ports to 80+443
58+
- instead of Catalina/localhost/neg.xml:
59+
- move settings to server.xml Host section to avoid access via /neg in url.
60+
- Also add these attributes to <Context path="" docBase="neg" debug="0" reloadable="true"></Context>
61+
- don't forget the SSL certificate
62+
- make sure you use the correct matomoSiteId
63+
- Firewall
64+
- adjust firewall scripts, see /zdv-system/scripts/ipt
65+
- Backup
66+
- for backups, make sure bacula is installed correctly and there is also a mysqldump cronjob
67+
3468
Build:
3569
- Use build-function in netbeans (.war file see target/ dir)
3670
- Deploy 1st time using http://localhost:8080/manager/html
3771
- Update copying neg.war to /var/lib/tomcat/webapps/ and removing the old unpacked neg/ subdirectory
72+
- Make sure the file /var/lib/tomcat9/conf/Catalina/localhost/neg.xml exists
3873

3974
Production:
4075
- https://wiki.owasp.org/index.php/Securing_tomcat

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN apt-get --yes install mysql-server openjdk-11-jre tomcat9
1414
RUN echo "collation-server = utf8_unicode_ci" >> /etc/mysql/mysql.conf.d/mysqld.cnf
1515
RUN echo "character-set-server = utf8" >> /etc/mysql/mysql.conf.d/mysqld.cnf
1616
RUN echo "group_concat_max_len = 100000000" >> /etc/mysql/mysql.conf.d/mysqld.cnf
17+
RUN echo "log_bin_trust_function_creators = 1" >> /etc/mysql/mysql.conf.d/mysqld.cnf
1718
RUN echo "sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" >> /etc/mysql/mysql.conf.d/mysqld.cnf
1819

1920
# MySQL DB + user

pom.xml

Lines changed: 63 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<dependency>
1919
<groupId>mysql</groupId>
2020
<artifactId>mysql-connector-java</artifactId>
21-
<version>5.1.49</version>
21+
<version>8.0.30</version>
2222
</dependency>
2323
<dependency>
2424
<groupId>commons-fileupload</groupId>
2525
<artifactId>commons-fileupload</artifactId>
26-
<version>1.2.2</version>
26+
<version>1.4</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>com.lowagie</groupId>
@@ -38,7 +38,27 @@
3838
<dependency>
3939
<groupId>org.hibernate</groupId>
4040
<artifactId>hibernate-core</artifactId>
41-
<version>5.4.25.Final</version>
41+
<version>5.6.11.Final</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.hibernate</groupId>
45+
<artifactId>hibernate-c3p0</artifactId>
46+
<version>5.6.11.Final</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.commons</groupId>
50+
<artifactId>commons-text</artifactId>
51+
<version>1.10.0</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>javax.mail</groupId>
55+
<artifactId>javax.mail-api</artifactId>
56+
<version>1.6.2</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>com.sun.mail</groupId>
60+
<artifactId>javax.mail</artifactId>
61+
<version>1.6.2</version>
4262
</dependency>
4363
<dependency>
4464
<groupId>javax</groupId>
@@ -58,6 +78,11 @@
5878
<version>5.7.2</version>
5979
<scope>test</scope>
6080
</dependency>
81+
<dependency>
82+
<groupId>com.mchange</groupId>
83+
<artifactId>c3p0</artifactId>
84+
<version>0.9.5.5</version>
85+
</dependency>
6186
</dependencies>
6287

6388
<build>
@@ -72,26 +97,26 @@
7297
<artifactId>maven-processor-plugin</artifactId>
7398
<version>3.2.0</version>
7499
<executions>
75-
<execution>
76-
<id>process</id>
77-
<goals>
78-
<goal>process</goal>
79-
</goals>
80-
<phase>generate-sources</phase>
81-
<configuration>
82-
<processors>
83-
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
84-
</processors>
85-
<defaultOutputDirectory>${project.build.directory}/generated-sources/hibernate-jpamodelgen/</defaultOutputDirectory>
86-
</configuration>
87-
</execution>
100+
<execution>
101+
<id>process</id>
102+
<goals>
103+
<goal>process</goal>
104+
</goals>
105+
<phase>generate-sources</phase>
106+
<configuration>
107+
<processors>
108+
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
109+
</processors>
110+
<defaultOutputDirectory>${project.build.directory}/generated-sources/hibernate-jpamodelgen/</defaultOutputDirectory>
111+
</configuration>
112+
</execution>
88113
</executions>
89114
<dependencies>
90-
<dependency>
91-
<groupId>org.hibernate</groupId>
92-
<artifactId>hibernate-jpamodelgen</artifactId>
93-
<version>5.4.25.Final</version>
94-
</dependency>
115+
<dependency>
116+
<groupId>org.hibernate</groupId>
117+
<artifactId>hibernate-jpamodelgen</artifactId>
118+
<version>5.6.11.Final</version>
119+
</dependency>
95120
</dependencies>
96121
</plugin>
97122
<plugin>
@@ -141,6 +166,23 @@
141166
</execution>
142167
</executions>
143168
</plugin>
169+
<plugin>
170+
<artifactId>exec-maven-plugin</artifactId>
171+
<version>1.1.1</version>
172+
<groupId>org.codehaus.mojo</groupId>
173+
<executions>
174+
<execution>
175+
<id>Restart Tomcat</id>
176+
<phase>generate-sources</phase>
177+
<goals>
178+
<goal>exec</goal>
179+
</goals>
180+
<configuration>
181+
<executable>${basedir}/restartTomcat9.sh</executable>
182+
</configuration>
183+
</execution>
184+
</executions>
185+
</plugin>
144186
<!-- Configure the maven-surefire-plugin and maven-failsafe-plugin to be at version 2.22.2 so that they can run JUnit5 -->
145187
<plugin>
146188
<artifactId>maven-surefire-plugin</artifactId>
@@ -152,5 +194,4 @@
152194
</plugin>
153195
</plugins>
154196
</build>
155-
156197
</project>

restartTomcat9.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
systemctl restart tomcat9
4+

0 commit comments

Comments
 (0)