Hi, with the help of the guide written by the user ecorona, I writed this little script to install cmdb 3.2.1 on CentOS 8. I hope to help anyone that is going crazy installing it as I was.
Just edit it with your parameter before running it as root.
Code:
#CentOS Stream 8, Postgres 10.14, Tomcat 9.0.37, CMDBuild 3.2.1
#Modify YOUR-CONNECTION YOUR-STATIC-IP YOUR-GATEWAY YOUR-FAVOURITE-DNS1 YOUR-FAVOURITE-DNS2 YOUR-PASSWORD
#Run this script as root! - sudo sh cmdb3.2.1-manual-install.sh
sudo yum update -y && sudo yum upgrade -y
sudo systemctl enable --now cockpit.socket
sudo hostnamectl set-hostname cmdbuild
sudo systemctl start NetworkManager
sudo nmcli device
sudo ifdown YOUR-CONNECTION
sudo nmcli connection add type ethernet ifname YOUR-CONNECTION con-name cmdb
#assign static ip, gateway and DNS
sudo nmcli connection modify cmdb ipv4.addresses YOUR-STATIC-IP ipv4.gateway YOUR-GATEWAY ipv4.dns "YOUR-FAVOURITE-DNS1,YOUR-FAVOURITE-DNS2"
sudo nmcli connection modify cmdb ipv4.method manual ipv6.method ignore autoconnect yes
sudo nmcli connection
sudo nmcli connection down cmdb
sudo nmcli connection up cmdb
#Postgres 10.14
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql10-server
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
#unquote line 59
sudo sed -i 's/#listen_addresses/listen_addresses/g' /var/lib/pgsql/10/data/postgresql.conf
#unquote line 63
sudo sed -i 's/#port = /port = /g' /var/lib/pgsql/10/data/postgresql.conf
#Set the local host to password and your host to trust
sudo sed -i 's/ident/trust/g' /var/lib/pgsql/10/data/pg_hba.conf
#Reset postgres user and create user shark
sudo su postgres -c psql postgres
ALTER USER postgres WITH PASSWORD 'YOUR-PASSWORD';
CREATE USER shark;
\q
#Tomcat 9.0.37
yum search java
sudo yum install -y java-11-openjdk.x86_64
sudo groupadd --system tomcat
sudo useradd -d /usr/share/tomcat -r -s /bin/false -g tomcat tomcat
sudo yum -y install wget
export VER=9.0.37
wget https://archive.apache.org/dist/tomcat/tomcat-9/v${VER}/bin/apache-tomcat-${VER}.tar.gz
sudo tar xvf apache-tomcat-${VER}.tar.gz -C /usr/share/
sudo ln -s /usr/share/apache-tomcat-$VER/ /usr/share/tomcat
sudo chown -R tomcat:tomcat /usr/share/tomcat
sudo chown -R tomcat:tomcat /usr/share/apache-tomcat-$VER/
sudo su
sudo cat <<'EOF'>> /etc/systemd/system/tomcat.service
[Unit]
Description=Tomcat Server
After=syslog.target network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=JAVA_HOME=\$(dirname \$(dirname \$(readlink \$(readlink \$(which javac)))))
Environment='JAVA_OPTS=-Djava.awt.headless=true'
Environment=CATALINA_HOME= /usr/share/apache-tomcat-9.0.37/
Environment=CATALINA_BASE= /usr/share/apache-tomcat-9.0.37/
Environment=CATALINA_PID= /usr/share/apache-tomcat-9.0.37/temp/tomcat.pid
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M'
ExecStart= /usr/share/apache-tomcat-9.0.37/bin/catalina.sh start
ExecStop= /usr/share/apache-tomcat-9.0.37/bin/catalina.sh stop
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl enable tomcat
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload
#CMDBuild 3.2.1
systemctl stop tomcat
cd /tmp/
wget https://master.dl.sourceforge.net/project/cmdbuild/3.2.1/cmdbuild-3.2.1-resources.tar.gz?viasf=1
wget https://iweb.dl.sourceforge.net/project/cmdbuild/3.2.1/cmdbuild-3.2.1.war
sudo tar xvf cmdbuild-3.2.1-resources.tar.gz?viasf=1
sudo cp /tmp/tomcat-libs/* /usr/share/tomcat/lib/
sudo cp /tmp/cmdbuild-3.2.1.war /usr/share/tomcat/webapps/cmdbuild.war
sudo chown tomcat:tomcat /usr/share/tomcat/lib/postgresql-42.2.5.jar
sudo chown tomcat:tomcat /usr/share/tomcat/lib/postgresql-1.12.3.jar
sudo chown tomcat:tomcat /usr/share/tomcat/webapps/cmdbuild.war
sudo mkdir /usr/share/tomcat/conf/cmdbuild
sudo chown -R tomcat:tomcat /usr/share/tomcat/conf/cmdbuild
sudo systemctl restart postgresql-10.service
sudo systemctl start tomcat
#Test cmdb page
#http://localhost:8080/cmdbuild
#if you cant access http://localhost:8080 check with 'sudo systemctl status tomcat.service' if apache is running, and if you are using a VM be sure to enable port forwarding on 8080:8080
#Database
#Type: Empty Name:cmdb_database
#Host: localhost Port:5432
#Username:postgres Password:YOUR-PASSWORD
#Admin username & password: Leave blank
#
#Apply patch
#
#Login with default database credentials
#Username:admin
#Password admin