Overview

Archivematica is open-source software for long-term preservation of digital data.

https://www.archivematica.org/en/

I had the opportunity to set up Archivematica on Amazon EC2, so this is a memo.

Installation

The installation instructions are described on the following page.

https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/installation/installation/

There are several options, but this time I tried “CentOS 7 64-bit, Installing Archivematica on CentOS/Red Hat.”

https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/installation/install-centos/#install-pkg-centos

EC2 Instance

Since CentOS 7 was specified, I selected the following Amazon Machine Image (AMI).

The hardware requirements are described below. I selected “t2.medium” with 4GB of memory, which is the “Recommended minimum production requirements,” and 200GB of storage.

https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/installation/installation/#hardware

Installation

After launching the EC2 instance, execute all the commands described on the above site. You can install by copying and pasting the following.

sudo yum -y update

# Allow Nginx to use ports 81 and 8001
sudo semanage port -m -t http_port_t -p tcp 81
sudo semanage port -a -t http_port_t -p tcp 8001
# Allow Nginx to connect the MySQL server and Gunicorn backends
sudo setsebool -P httpd_can_network_connect_db=1
sudo setsebool -P httpd_can_network_connect=1
# Allow Nginx to change system limits
sudo setsebool -P httpd_setrlimit 1

sudo yum install -y epel-release

sudo -u root rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
sudo -u root bash -c 'cat << EOF > /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF'

sudo -u root bash -c 'cat << EOF > /etc/yum.repos.d/archivematica.repo
[archivematica]
name=archivematica
baseurl=https://packages.archivematica.org/1.13.x/centos
gpgcheck=1
gpgkey=https://packages.archivematica.org/1.13.x/key.asc
enabled=1
EOF'

sudo -u root bash -c 'cat << EOF > /etc/yum.repos.d/archivematica-extras.repo
[archivematica-extras]
name=archivematica-extras
baseurl=https://packages.archivematica.org/1.13.x/centos-extras
gpgcheck=1
gpgkey=https://packages.archivematica.org/1.13.x/key.asc
enabled=1
EOF'

sudo -u root yum install -y java-1.8.0-openjdk-headless elasticsearch mariadb-server gearmand
sudo -u root systemctl enable elasticsearch
sudo -u root systemctl start elasticsearch
sudo -u root systemctl enable mariadb
sudo -u root systemctl start mariadb
sudo -u root systemctl enable gearmand
sudo -u root systemctl start gearmand

sudo -H -u root mysql -hlocalhost -uroot -e "DROP DATABASE IF EXISTS MCP; CREATE DATABASE MCP CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
sudo -H -u root mysql -hlocalhost -uroot -e "DROP DATABASE IF EXISTS SS; CREATE DATABASE SS CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
sudo -H -u root mysql -hlocalhost -uroot -e "CREATE USER 'archivematica'@'localhost' IDENTIFIED BY 'demo';"
sudo -H -u root mysql -hlocalhost -uroot -e "GRANT ALL ON MCP.* TO 'archivematica'@'localhost';"
sudo -H -u root mysql -hlocalhost -uroot -e "GRANT ALL ON SS.* TO 'archivematica'@'localhost';"

sudo -u root yum install -y python-pip archivematica-storage-service

sudo -u archivematica bash -c " \
set -a -e -x
source /etc/sysconfig/archivematica-storage-service
cd /usr/lib/archivematica/storage-service
/usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/python manage.py migrate";

sudo -u root systemctl enable archivematica-storage-service
sudo -u root systemctl start archivematica-storage-service
sudo -u root systemctl enable nginx
sudo -u root systemctl start nginx
sudo -u root systemctl enable rngd
sudo -u root systemctl start rngd

sudo -u root yum install -y archivematica-common archivematica-mcp-server archivematica-dashboard

sudo -u archivematica bash -c " \
set -a -e -x
source /etc/sysconfig/archivematica-dashboard
cd /usr/share/archivematica/dashboard
/usr/share/archivematica/virtualenvs/archivematica/bin/python manage.py migrate
";

sudo -u root systemctl enable archivematica-mcp-server
sudo -u root systemctl start archivematica-mcp-server
sudo -u root systemctl enable archivematica-dashboard
sudo -u root systemctl start archivematica-dashboard

sudo -u root systemctl restart nginx

sudo -u root yum install -y archivematica-mcp-client

sudo -u root sed -i 's/^#TCPSocket/TCPSocket/g' /etc/clamd.d/scan.conf
sudo -u root sed -i 's/^Example//g' /etc/clamd.d/scan.conf

sudo -u root systemctl enable archivematica-mcp-client
sudo -u root systemctl start archivematica-mcp-client
sudo -u root systemctl enable fits-nailgun
sudo -u root systemctl start fits-nailgun
sudo -u root systemctl enable clamd@scan
sudo -u root systemctl start clamd@scan
sudo -u root systemctl restart archivematica-dashboard
sudo -u root systemctl restart archivematica-mcp-server

sudo -u archivematica bash -c " \
    set -a -e -x
    source /etc/default/archivematica-storage-service || \
        source /etc/sysconfig/archivematica-storage-service \
            || (echo 'Environment file not found'; exit 1)
    cd /usr/lib/archivematica/storage-service
    /usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/python manage.py createsuperuser
  ";

The last command creates a user for archivematica-storage-service. You specify a username and password.

After that, perform the initial setup referring to the following “Post-install configuration.”

https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/installation/install-centos/#post-install-configuration

EC2 Security Settings

Since Archivematica uses ports 81 and 8001, I allowed access to these ports in the inbound rules.

As a result, Archivematica was successfully set up as follows.

Summary

I was able to set up Archivematica on Amazon EC2. I would like to deepen my understanding of Archivematica going forward.

For information on how to use Archivematica, detailed summaries are also available at the “Irisawa Dojo,” so please refer to that as well.

http://irisawadojo.blogspot.com/