/
Manual Installation Instructions

Manual Installation Instructions

These instructions are no longer supported; see the Dockerfile and docker-compose.yml files for information on building the components of an Avalon installation. Production environments are typically implemented across multiple servers running the main components of the application: Avalon (rails), Background Worker (sidekiq), Database, Fedora, Solr, and Streaming server.

 

Ready the Installation Environment

The instructions below require being run as root unless specifically noted otherwise.

Storage requirement

Avalon and components need about 20GB of disk space to install.

Open ports requirement

The Avalon Media System requires several ports to be open to client browsers.

Here are the port settings that will need to be configured:

Port

Purpose

External?

Port

Purpose

External?

80

HTTP (Avalon)

Yes

8983

HTTP (Solr)

No

8984

HTTP (Fedora)

No

8980

HTTP (Nginx)

Yes

The preferred method is to create a shell script that will do the work for you. Here is an example script that you should look through and customize as needed: avalon-iptables-config.sh

If you're connected over ssh, it might kick you off.

Save your script to /etc/sysconfig/avalon-iptables-config.sh, make it executable and run it.

chmod +x /etc/sysconfig/avalon-iptables-config.sh /etc/sysconfig/avalon-iptables-config.sh

If you run into connection issues you can disable the iptables, by running "service iptables stop". This will completely drop your firewall. When finished troubleshooting run "service iptables start".

Disable SELinux

vim /etc/selinux/config #change the value of `SELINUX` from `enforcing` to `permissive`

You may have to disable SELinux completely if there's Passenger installation problem

Reboot to apply change

shutdown -r now

Install EPEL

This package has libyaml-devel which is required by ruby and not provided by Redhat.

Install development libraries and packages for building Ruby

Install Java 8

Main Components

Database

Avalon uses a database for storing search queries, user data and roles, and as a back end to the encoding dashboard. MariaDB can be substituted for MySQL or PostgreSQL.

Install MariaDB server 

Fedora Commons Repository

Tomcat

Fedora runs as a webapp in Tomcat

Install Apache Tomcat 

RHEL 7

Add Tomcat manager user

By default, no user has access to the Tomcat Manager App. Define a user in /etc/tomcat/tomcat-users.xml with access to the manager-gui role. Below is a very basic example.

Create Fedora user and database

Enter the mariadb client

Check your work and exit

Configure Tomcat for Fedora

Append the following to /etc/tomcat/tomcat.conf

Download and run the fcrepo installer

Restart Tomcat

See if you can access Fedora's REST interface at http://<server host name>:8984/fedora4/rest

Try it out on your local machine and on another machine. If you can't reach the app from another machine, your Manual Installation Instructions#iptables might need to be changed to allow access. If Fedora is not up, check the tomcat logs in /var/log/tomcat/. Catalina.out and localhost.<date>.log usually provide the best information.

Solr

Avalon makes use of Solr through the Blacklight gem for faceting and relevance-based searching.

Install prerequisites

Download the solr tarball and run the installation script

Download Solr from http://archive.apache.org/dist/lucene/solr/

By default, the script extracts the distribution archive into /opt, configures Solr to write files into /var/solr, and runs Solr as the solr user. Follow the linked guide if you wish to change these defaults.

Create Avalon core for Solr

If you have successfully installed Solr you should be able to access the dashboard page at http://<server host name>:8983/solr

Instructions on how to manually start/stop Solr: https://cwiki.apache.org/confluence/display/solr/Running+Solr

Media Streaming Server

An HLS-enabled server like Wowza, Adobe Media Server (commercial) or Nginx + the HLS module (open-source) can take an mp4 created by Avalon and stream it on the fly.

Nginx instructions

Install Nginx with vod module

Add /etc/nginx/nginx.conf

 

Add /lib/systemd/system/nginx.service

Add nginx user and let it own nginx stuff

Make 8980 bindable and start nginx

Later: Avalon config should be updated to be compatible with Nginx:

 

FFmpeg & Mediainfo

Download and install ffmpeg (for transcoding & thumbnails)

Install Mediainfo (for technical metadata)

HTTPD

Install and start the httpd service.

Apache Passenger and Ruby

Change current user to avalon then install RVM and ruby 2.4.1

Source the RVM shell (as avalon user) or close the terminal and open it back up.

Install Passenger apache module requirements (as root)

Create a virtual host for avalon

In 20-avalon.conf add this line inside the VirtualHost tag:

If using SSL, the following fix should be added to address BEAST, POODLE, RC4 issues (after the SSLEngine on)

Modify /etc/httpd/conf.d/passenger.conf

Validate passenger install and restart apache

Avalon

Grab Avalon code from github

Set rails environment to production, if it has not defaulted to this. On the first line of /var/www/avalon/config/environment.rb make sure it says 'production'

Configure database settings

Replace database.yml with the correct values for your production environment. Note that the pool setting should be equal or exceed the number of concurrent jobs in Sidekiq.

Install the mysql2 adapter 

Install gems

Run the bundle install

Finish configuring Avalon

Edit /var/www/avalon/config/solr.yml and /var/www/avalon/config/blacklight.yml

Edit /var/www/avalon/config/fedora.yml

Create streaming directory

 

Let Avalon know where your HLS streams are

config/settings/production.local.yml

Change the secrets.yml file:

grab the output of rake secret and add it to secrets.yml where instruSTDOUTSTDOUTSTDOUTcted.

More information: Configuration Files#config/secrets.yml

Create controlled_vocabulary.yml

If you get an error message saying that you can't connect to the database, take a look at this post and follow some of the troubleshooting steps.

http://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38

Run the database migrations

Install yarn and node modules

Precompile assets

Restart Apache

Install ImageMagick

Sidekiq

Avalon uses Sidekiq for background processing, which relies on Redis as its key-value store.

Install Redis

Install Sidekiq

Edit the following lines in sidekiq.service 

 

Sidekiq logs to STDOUT. 

Additional Configurations

Dropbox

Edit /etc/ssh/sshd_config

Restart SSH

Batch ingest

To manually start a batch ingest job, run as avalon user

To make batch ingest run automatically whenever a manifest is present, you need to add a cron job. This cron job can be created by the whenever gem from reading config/schedule.rb. To preview, run

this will translate content in schedule.rb to cron job syntax. Once verified, run the following to write job to crontab

You should get the cron job automatically if you were deploying from Capistrano.

Authentication Strategy

Avalon comes with Persona by default but it can be configured to work with other authentication strategies by using the appropriate omniauth gems. The following example is applicable to Indiana University CAS, it may need some adjustments in order to work with other CAS implementation.

Add to Gemfile

Install new gems

Add to config/initializers/my-ldap.rb

Add config/initializers/user_auth_cas.rb

Add to config/settings/production.local.yml

Using the System

You should be able to visit the webpage with just the hostname (ie http://localhost)

Create an admin account

You can  create an account from the command line in the root of your avalon install:

Additional information

You can find specific information about using the system in the Collection Manager's Guide.  /wiki/spaces/AVALON/pages/1957954522 is available for your convenience.  Upload new items individually or by batch directly via SFTP using the avalondrop account you created above.

Configure additional feataures

Known Issues - a list of bugs, workarounds, and cautions.

Restarting the Server

Before you restart your Avalon server, you'll want to make sure all of the services necessary to run Avalon will start automatically after the restart. Run these commands once and you should be set:

 

 

Related content

Upgrading Avalon 7.4 to Avalon 7.5
Upgrading Avalon 7.4 to Avalon 7.5
More like this
Installation and Configuration
Installation and Configuration
Read with this
Upgrading Avalon 7.3 to Avalon 7.4
Upgrading Avalon 7.3 to Avalon 7.4
More like this
Upgrading Avalon 7.7 to Avalon 7.8
Upgrading Avalon 7.7 to Avalon 7.8
Read with this
Upgrading Avalon 7.7 to Avalon 7.7.1 and 7.7.2
Upgrading Avalon 7.7 to Avalon 7.7.1 and 7.7.2
More like this
Configuration Files
Configuration Files
Read with this