BIMServer is build on Java. A Java runtime is necessary to run the build. We rely on the open source implementation of the Java, Standard Edition - OpenJDK.
First, check you java installation, and in case you have one, it might be required to just install the version 11. In that case, first delete the old version:
apt-get purge -y openjdk-\*
Next, install the version 11:
apt install -y openjdk-11-jre-headless tomcat9 tomcat9-user
Apache Tomcat 9 (10 is not backwards compatible and BIMServer still relies on an older implementation) is used to run the web server, which is stored as a .war
file.
After installation, check you /etc/passwd
if a new Tomcat user is created.
We create a new folder wherever we like. We'll stick to /var/www/
because we're hosting a website.
mkdir /var/www/ && chmod -R tomcat /var/wwwtomcat9-instance-create -p <port> -c <console> /var/www/<domain>
After creation of a new project for a specific domain, we'll add the app to the webapps folder inside the newly created project. It's self contained and all necessary settings should be tweaked inside the /var/www/<domain>
folder.
curl -s https://api.github.com/repos/opensourceBIM/BIMServer/releases/latest | grep "browser_download_url.*war" | cut -d : -f 2,3 | tr -d \" | wget -qi - -O /var/www/<domain>/webapps/bimserver.war
Next, we define a daemon so the service is started at runtime.
vim /etc/systemd/system/[email protected]
In this file, enter the following content:
[Unit]Description=Tomcat - instance %iAfter=syslog.target network.target[Service]Type=forkingUser=tomcatGroup=tomcatWorkingDirectory=/var/www/%iEnvironment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64/"Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"Environment="CATALINA_OPTS=-Xms512M -Xmx512M -server -XX:+UseParallelGC"ExecStart=/var/www/%i/bin/startup.shExecStop=/var/www/%i/bin/shutdown.sh#RestartSec=10#Restart=always[Install]WantedBy=multi-user.target
Watch out!
In my case I'm running the script on a Raspberry Pi, you might need to change the `JAVA_HOME` environment variable to `/usr/lib/jvm/java-openjdk-amd64` instead of `arm64`.
After configuring the service, load, enable and start it.
# Reload all deamonssystemctl daemon-reload# Enable and start the daemonsystemctl enable tomcat@<domain>systemctl start tomcat@<domain>
Check the status at:
systemctl status tomcat@<domain>
Navigate to the BIMServer using <domain>:<port>
in your webbrowser.
The following list contains an overview of all zettels that have been created with the same tags assigned.
listfrom #zettel