Commit 2e8ba43c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '980-rpm-package' into 'master'

Resolve "rpm package"

Closes #980

See merge request minerva/core!954
parents 4d41b225 da419034
......@@ -15,14 +15,15 @@ The main steps are
* Install `PostgreSQL <>`_ and set up a
* Install and configure `Apache Tomcat <>`_.
* Install and configure `Apache Tomcat 8.5 or higher <>`_.
* Install the MINERVA RPM.
* Data migration from version 13.2.x and lower.
Install PostgreSQL and initialise it with
Install PostgreSQL and initialize it with
.. code:: shell
......@@ -58,17 +59,72 @@ Create the MINERVA database user and the database
Apache Tomcat
Install Apache Tomcat with
Create a new tomcat group and tomcat user
.. code:: shell
yum install -y tomcat
sudo groupadd tomcat
sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
In ``/etc/sysconfig/tomcat``, adjust the memory settings, e.g.
Download Tomcat Binary
.. code::
.. code:: shell
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
Update Permissions
.. code:: shell
cd /opt/tomcat
sudo chgrp -R tomcat /opt/tomcat
sudo chmod -R g+r conf
sudo chmod g+x conf
sudo chown -R tomcat webapps/ work/ temp/ logs/
Install Systemd Unit File. Create a file `/etc/systemd/system/tomcat.service` (you might want to change memory settings specified in CATALINA_OPTS):
# Systemd unit file for tomcat
Description=Apache Tomcat Web Application Container
JAVA_OPTS="-Xms2048M -Xmx4096M"
Environment='CATALINA_OPTS=-Xms2048M -Xmx4096M -server -XX:+UseParallelGC'
ExecStop=/bin/kill -15 $MAINPID
Reload Systemd to load the Tomcat unit file
.. code:: shell
sudo systemctl daemon-reload
Enable and start Tomcat
.. code:: shell
sudo systemctl enable tomcat
sudo systemctl start tomcat
Make sure to open the port (by default port 8080) to allow incoming
connections, e.g. using ``firewalld`` this can be accomplished with
......@@ -83,14 +139,6 @@ connections, e.g. using ``firewalld`` this can be accomplished with
hardcoded, therefore make sure the MINERVA cannot be accessed from
distrusted hosts until the password was changed.
Enable and start Tomcat
.. code:: shell
systemctl enable tomcat
systemctl start tomcat
......@@ -118,3 +166,20 @@ e.g. on a local network this could be
Login with the username ``admin`` and the password ``admin``. Click on
the ``INFO`` tab in the left panel, and click on ``MANUAL`` to get
more information about administrating and using MINERVA.
Migration from MINERVA 13.2 and lower
MINERVA 13.2 and earlier versions used tomcat7 that was in most cases installed
from rpm. Starting from MINERVA 14.0.0 tomcat8 or higher is required. Before
you install new version of minerva you would need to remove old tomcat:
.. code::
sudo yum remove tomcat
And install new tomcat manually as described in the section above. Tomcat7
stored data in different place than manually installed tomcat8. Move the data
to tomcat8 folder:
.. code::
sudo mv /var/lib/tomcat/webapps/map_images /opt/tomcat/webapps/
sudo mv /var/lib/tomcat/webapps/minerva-big /opt/tomcat/webapps/
......@@ -36,7 +36,7 @@ if [[ "$RPMBUILD_TEMP" =~ ' ' ]]; then
# current date (for automatic changelog)
CURDATE=$(date +"%a %b %d %Y")
CURDATE=$(LC_ALL=C date +"%a %b %d %Y")
# clean build directories
......@@ -7,7 +7,7 @@ License: AGPLv3
Requires: tomcat, postgresql
Conflicts: tomcat < 8.0
BuildArch: noarch
......@@ -18,7 +18,10 @@ used and managed via a webbrowser.
%preun -p /bin/bash
if [ $1 == 1 ]; then
# remove old unpacked ("exploded") directory of war file
# version 13.2 and below
rm -rf %{_sharedstatedir}/tomcat/webapps/%{name}
# version 14.0 and upper
rm -rf /opt/tomcat/webapps/%{name}
......@@ -27,15 +30,15 @@ mkdir -p %{buildroot}/%{_datadir}/%{name}
install -m 0644 %{name}.war %{buildroot}/%{_datadir}/%{name}/%{name}.war
mkdir -p %{buildroot}/%{_sysconfdir}/logrotate.d
install -m 0644 logrotate_minerva %{buildroot}/%{_sysconfdir}/logrotate.d/minerva
mkdir -p %{buildroot}/%{_sharedstatedir}/tomcat/webapps
ln -s %{_datadir}/%{name}/%{name}.war %{buildroot}/%{_sharedstatedir}/tomcat/webapps/
mkdir -p %{buildroot}/opt/tomcat/webapps
ln -s %{_datadir}/%{name}/%{name}.war %{buildroot}/opt/tomcat/webapps/
%config(noreplace) %{_sysconfdir}/logrotate.d/minerva
%attr(-,tomcat,tomcat) %{_sharedstatedir}/tomcat/webapps/%{name}.war
%attr(-,tomcat,tomcat) /opt/tomcat/webapps/%{name}.war
* __DATE__ - %{version}-%{release}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment