- Domain
- JavaComm is accessible via this domain on the Internet.
- Tomcat
- The web server accepts all user requests.
- MariaDB
- The SQL database handles the management of global data and stores the system state.
- JavaVM
- The Java 11 or higher virtual machine runs the web server.
You can find the domain administration at your domain provider, which is usually also your web hosting provider. Within the domain management you can assign an IP address to your domain.
Alternatively, there is the possibility of attaching a domain to the Internet via a third-party provider. An IP address can be assigned to a domain via FreeDNS. To do this, you enter only the name servers of FreeDNS at your domain web host. Afterwards, the name servers perform a DNS comparison. After a few hours, the domain will be accessible worldwide again.
Tomcat is a pure web server and requires EE 10 extensions. The extensions are unpacked in the Tomcat directory.
${CATALINA_HOME}/lib
The database driver must also be located in this directory. After a restart of Tomcat all extensions are active.
Data encryption to and from Tomcat requires a domain validation certificate. There are many certification bodies that issue a DV certificate. My recommendation is Let's Encrypt. If the domain validation is successful, you get your certificate digitally signed back. The next step is to transfer the certificate into a certificate store. The two programs openssl and keytool are required. With openssl the store is created - with keytool the store is adjusted.
The call openssl pkcs12 -export -in bundle.crt -inkey private.key -out keystore.p12 creates keystore.p12.
- bundle.crt contains a chain of root certificate, intermediate certificate and the public key of the submitted certificate.
- private.key is the associated private key of the submitted certificate.
- keystore.p12 is the generated certificate store.
After the import by openssl the certificate got a numeric alias, which keytool should change into a speaking alias name. Via the alias name Tomcat knows later which key to select if there are multiple keys in the certificate store.
keytool -changealias -alias 1 -destalias blaubeere -keystore keystore.p12 -storepass geheim
The alias has been changed from 1 to blaubeere and keystore.p12 has been given the password geheim. Next, keystore.p12 is copied into the location
${CATALINA_HOME}/conf/keystore.p12
The last step is to add keystore.p12 to the file
${CATALINA_HOME}/conf/server.xml
and configure port 443 for https. Tomcat can start the server app. The encryption is active.
Logging can become a real problem if too much is logged. Web services are based on HTTP and requests to a server are logged automatically. Tomcat is no exception. Excessive logging or requests with a userid can be prevented by a log filter. The class net.javacomm.server.LogFilter was written for this purpose. A URL pattern is defined in the class, which suppresses logging for certain resources. The pattern should be customized according to your own needs. All URLs for screen sharing are suppressed by default, otherwise there would be huge log files. Tomcat is notified of the net.javacomm.server.LogFilter class via web.xml of javacommserver.war. If net.javacomm.server.LogFilter recognizes one of the patterns from <filter-mapping>, the AccessLogValve class from server.xml is notified.
AccessLogValve must be extended in server.xml with the conditionUnless attribute.The value block comes from class net.javacomm.server.LogFilter.
The server tables for admin activities can be administered via SQL scripts and an admin GUI. The admin GUI is integrated in the JavaComm client and is enabled if the logged-in user is a program administrator. Program administrator is who has been entered as administrator in the table TB_USER. No program administrators can be created via the GUI. Only a database administrator can create and delete a program administrator via SQL commands.
There is a general sript for setting up the database and the tables, which is executed by MariaDB in batch mode. We recommend HeidiSQL for managing MariaDB.
- olymp_user_10_1_26.sql legt den Webserver als Datenbankbenutzer an.
- olymp_tables_10_1_26.sql legt alle Tabellen an.
- olymp_filter.sql ist ein Raumfilter für Verbotsnamen.
- olymp_filelist.sql ist eine 'Schwarze Liste' für nicht übertragbare Dateitypen.
- olymp_domain.sql konfiguriert die Domäne und den Mailversand.
Before the master script runolymp is called, the entries in the individual scripts should be checked and, if necessary, adapted for your own needs. The master script can be executed several times in succession. Created data sets or tables are not deleted or overwritten.
If you don't want to use MariaDB, there are three things to keep in mind.
- Ein geeigneter JDBC-Datenbanktreiber muss nachträglich in das Tomcat-Verzeichnis ${CATALINA_HOME}/lib kopiert werden.
- Einige Datentypen aus der 'olymp_tables_10_1_26.sql' müssen durch Äquivalente ersetzt werden.
- Einige SQL-Kommandos müssen möglicherweise angepasst werden. Die SQL-Kommandos sind mit einem eindeutigen Schlüssel in der Datei 'sqlmapper.xml' hinterlegt. Die Datei liegt im Source-Code-Archiv unter ${basedir}/src/main/resources/net/javacomm/database/sqlmapper
Tipp. Alle Datenbankbefehle werden mit ihrem Schlüssel vor der Ausführung in der Datei
${CATALINA_HOME}/logs/javacommserver/database.log
aufgezeichnet. Falls ein Befehl nicht ausgeführt werden konnte, ist die Stelle in der Logdatei mit der Fehlerursache vermerkt.
In the MariaDB section we had the script olymp_user_10_1_26.sql which contained the database user. The same database user must also be entered in the context.xml with his password, so that Tomcat can establish a database connection. If you did not change the user and password in the olymp_user_10_1_26.sql, you can follow the instructions in the Source Code section and create the server.
When changes are made, the
javacommserver/src/main/webapp/META-INF/context.xml
file must take over the entries from the olymp_user_10_1_26.sql file. Follow the instructions in the Source Code section.
For a program administrator, the Administrator menu is displayed at the very top right of the menu bar in the client. Before this happens, however, a user must be granted ISADMIN permission by a database administrator. The database administrator have to issue the following command:
update TB_USER set ISADMIN=1 where UID='xxxyyyzzz';

The program administrator sets the registration process and defines filters for nicknames and rooms. Furthermore, he determines the grace period for break rooms before they are converted into a forum. He can initiate the update process of all clients by specifying outdated program version numbers.

POM files are stored in the archives. To run the POMs, Maven 3.9.9 and Java 21.0.7+6 or higher must be installed.
Invocation | Remark |
---|---|
mvn | The call generates all base libraries. Afterwards the profiles can be called. |
mvn -Pwinrunner | Change to ./chat. The call compiles, creates and starts the client on Windows. |
mvn -Plinrunner | Change to ./chat. The call compiles, creates and starts the client on Linux. |
mvn -Pwinportable | Change to nach ./chat. The call creates portable-win64-250801-PRE4.zip. |
mvn -Plinportable | Change to nach ./chat. The call creates portable-linux-250801-PRE4.zip. |
mvn -Prelease | Change to ./chat. The call creates the archive javacomm-source-250801-PRE4.zip. |
mvn | Change to ./javacommserver. The call deletes, compiles and builds javacommserver.war. Install javacommserver.war on Tomcat. |