CMDBuild Forum

openmaint 2.3-3.4.2 Installation notes for Debian 12 using installed tomcat

These notes took a while to get working and together, so someone could probably use them. Should be the latest openmaint with empty database and on Debian Linux. It is all command line commands, but it is not a shell script to just paste and run. # means comments on what is happening.

using debian 12 64bit using from debian.org specifically the debian-live-12.1.0-amd64-gnome.iso for this install Aug 08, 2023

all passwords here are password, change it to make secure

#regular debian 12 user account is named “user”

nano saving is Control and x to save the file

It is a pain but you can paste each line to see what its doing

login to desktop and add regular user to sudo

su -
usermod -aG sudo user
apt update
apt upgrade
sudo apt install openssh-server

#get ip address for ssh in
ip a

Then

reboot

ssh in as regular user “user” remotely with putty/Termius or in terminal on the desktop:

#disable sleep
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

#install java 17
sudo apt install openjdk-17-jdk -y

postgresql install presetup

sudo sh -c ‘echo “deb Index of /pub/repos/apt/ $(lsb_release -cs)-pgdg main” > /etc/apt/sources.list.d/pgdg.list’
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

more postgresql install

sudo apt-get update
sudo apt install postgresql-12 postgresql-client-12 -y
sudo apt-get install gnupg2 wget unzip git curl -y
sudo apt-get install postgis postgresql-12-postgis-3 libpostgis-java -y

set a password for postgres

sudo passwd postgres

login as postgres

su - postgres
psql -d template1 -c “ALTER USER postgres WITH PASSWORD ‘password’;”
#get back to user account
exit

#Install pgadmin if you want to get on the server and use the desktop - totally optional

curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c ‘echo “deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main” > /etc/apt/sources.list.d/pgadmin4.list && apt update’
sudo apt install pgadmin4-desktop -y

#install Tomcat 9
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.78/bin/apache-tomcat-9.0.78.tar.gz
sudo mkdir /opt/tomcat
sudo tar xzvf apache-tomcat-9tar.gz -C /opt/tomcat --strip-components=1
sudo chown -R tomcat: /opt/tomcat
sudo chgrp -R tomcat /opt/tomcat
sudo sh -c 'chmod +x /opt/tomcat/bin/
.sh’
cd /opt/tomcat
sudo chmod -R g+r conf
sudo chmod g+x conf
sudo chown -R tomcat webapps/ work/ temp/ logs/

#get your java location:
sudo update-java-alternatives -l

then make sure it matches the line: Environment=JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64

sudo nano /etc/systemd/system/tomcat.service

#And paste the following text:

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment=‘CATALINA_OPTS=-Xms10512M -Xmx121024M -server -XX:+UseParallelGC’
Environment=‘JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom’

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

#more tomcat configuring
sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl enable tomcat

sudo nano /opt/tomcat/conf/tomcat-users.xml

#paste in:

#before this text at the end :

#allow remote tomcat admin stuff

sudo nano /opt/tomcat/webapps/manager/META-INF/context.xml
sudo nano /opt/tomcat/webapps/host-manager/META-INF/context.xml

edit the files above to look like this :

****

more tomcat stuff

sudo systemctl restart tomcat

#stop tomcat download war and move it to tomcat webapps folder
cd ~
sudo systemctl stop tomcat
wget https://gigenet.dl.sourceforge.net/project/openmaint/2.3/Core%20updates/openmaint-2.3-3.4.2/openmaint-2.3-3.4.2.war
sudo cp openmaint-2.3-3.4.2.war /opt/tomcat/webapps/cmdbuild.war
sudo systemctl start tomcat
sleep 20
sudo systemctl stop tomcat

#download postgresql java blob and put in tomcat lib folder
wget https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
sudo cp postgresql-42.6.0.jar /opt/tomcat/lib
sudo systemctl restart tomcat

#Go to http://ipaddressofyourserve:8080/cmdbuild on the web and in the form put in this info. Change to Demo for demo data under Type.

#Type: Empty
#Name: openmaint
#Host: localhost
#Port:5432
#Username: openmaintdbuser
#Password: password
#Admin username: postgres
#Admin password: password

#Click configure.

Should go to Loading…

#Then username: admin
#password: admin