Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note

This documentation is for Release 7.0 and above. For documentation on previous releases, please select from the options below.

  • Release 1.x version of this page: v.81
  • Release 2.x version of this page: v.87.
  • Release 3.0-3.1 version of this page: v.111.
  • Release 3.2 version of this page: v.116.
  • Release 4.0 version of this page: v.143.
  • Release 5.x version of this page: v.163.
  • Release 6.0 version of this page: v.177
  • Release 6.3-6.5 version of this page: v.201

...

Code Block
JAVA_OPTS="${JAVA_OPTS} -Dfcrepo.modeshape.configuration=classpath:/config/file-simple/repository.json -Dfcrepo.home=/var/avalon/fedora/"

Restart Tomcat

Code Block
servicesystemctl restart tomcat restart

Download and run the fcrepo installer

Code Block
mkdir -p /var/avalon/fedora
chown tomcat:tomcat /var/avalon/fedora
wget https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-4.7.35/fcrepo-webapp-4.7.35.war -O /usr/share/tomcat/webapps/fedora4.war

...

Code Block
wget http://archive.apache.org/dist/lucene/solr/6.6.4.2/solr-6.6.4.2.tgz
tar xzf solr-6.6.4.2.tgz solr-6.6.4.2/bin/install_solr_service.sh --strip-components=2
bash ./install_solr_service.sh solr-6.6.4.2.tgz

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.

...

Install MySQL server 

Code Block
yum install mysqlmariadb-server
servicesystemctl mysqldstart startmariadb

Create databases and users

...

See documentation for your version of MySQL Server for detailed syntax (http://dev.mysql.com/doc/refman/5.1/en/create-database.html )

Media Streaming Server

Warning

Nginx replaces Red5 as the default streaming server since Avalon 6.3. With the upgrade to MediaElementjs 4, we now rely completely on HLS.

...

Info

listen should use a public open port.

alias should point to where the actual stream files are.

proxy_pass needs changing if installing Nginx on a different server.

Add /lib/etcsystemd/init.dsystem/nginx. For RHEL7 use this script.service

Code Block
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig:   - 85 15
# description:  NGINX is an HTTP(S) server, HTTP(S) reverse \
#               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /etc/nginx/nginx.conf
# config:      /etc/sysconfig/nginx
# pidfile:     /var/run/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/etc/nginx/nginx.conf"

[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

lockfile=/var/lock/subsys/nginx

make_dirs() {
   # make required directories
   user=`$nginx -V 2>&1 | grep "configure arguments:.*--user=" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
   if [ -n "$user" ]; then
      if [ -z "`grep $user /etc/passwd`" ]; then
         useradd -M -s /bin/nologin $user
      fi
      options=`$nginx -V 2>&1 | grep 'configure arguments:'`
      for opt in $options; do
          if [ `echo $opt | grep '.*-temp-path'` ]; then
              value=`echo $opt | cut -d "=" -f 2`
              if [ ! -d "$value" ]; then
                  # echo "creating" $value
                  mkdir -p $value && chown -R $user $value
              fi
          fi
       done
    fi
}

start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    make_dirs
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    configtest || return $?
    stop
    sleep 1
    start
}

reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}

force_reload() {
    restart
}

configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac

Add nginx user and let it own nginx stuff

Code Block
useradd -M -s /bin/nologin nginx
chown -R nginx:nginx /etc/nginx /var/log/nginx 

Start nginx

Code Block
chmod +x /etc/init.d/nginx
service nginx start

Avalon config should be updated to be compatible with Nginx:

Code Block
streaming:
  server: :nginx
  http_base: 'http://localhost:8980/avalon'
  content_path: '/var/avalon/derivatives'
Warning

If you enable SSL on Avalon server, you should also enable SSL on the streaming server to avoid Mixed content warning.

FFmpeg

Info
titleDownload prebuilt ffmpeg

You can choose to download prebuilt binaries instead of building it yourself.

Installation prerequisites

Install prerequisite packages using yum and the Avalon repository (note: mediainfo is pinned to 0.7.61-1 because of a bug with time fragment formatting in most recent version 0.7.87-1 in epel):

Code Block
yum install SDL-devel a52dec-devel bzip2-devel faad2-devel freetype-devel frei0r-plugins-devel \
	gsm-devel imlib2-devel lame-devel libdc1394-devel libraw1394-devel librtmp-devel libtheora-devel \
	libva-devel libfaac-devel libvdpau-devel libstdc++-devel libvorbis-devel libvpx-devel \
	mediainfo-0.7.61-1 opencore-amr-devel opencv-devel openjpeg-devel openssl-devel schroedinger-devel \
	speex-devel texi2html vo-aacenc-devel x264-devel xvidcore-devel yasm zlib-devel

Install rpmdev-setuptree

Code Block
yum install rpmdevtools

Install ffmpeg srpm

The following commands need to run under a user other than root. Change to another user to continue.

Code Block
su - someuser

Run the ffmpeg installer

Code Block
rpmdev-setuptree
rpm -ivh https://github.com/avalonmediasystem/avalon-installer/blob/master/files/ffmpeg/ffmpeg-2.4.2-1.el6.src.rpm?raw=true

# Retrieving https://github.com/avalonmediasystem/avalon-installer/blob/master/files/ffmpeg/ffmpeg-2.4.2-1.el6.src.rpm
#   1:ffmpeg                 warning: user makerpm does not exist - using root
# warning: group makerpm does not exist - using root
########################################### [100%]
# warning: user makerpm does not exist - using root
# warning: group makerpm does not exist - using root
# Build ffmpeg binary as non-root and install as root

rpmbuild -bb rpmbuild/SPECS/ffmpeg24.spec

Log back in as root and finish the install.

Code Block
su - root
rpm -ivh /home/someuser/rpmbuild/RPMS/x86_64/ffmpeg-*.rpm

You can also build a more modern ffmpeg from source, but not all versions work. Version 3.1 is known to work - check out the release/3.1 branch and build from there. If your modern ffmpeg uses fdk_aac instead of libfaac, adjust Avalon config/ffmpeg_presets.xml accordingly.

HTTPD

Install and start the httpd service.

Code Block
yum install httpd
service httpd start

With newer httpd you may need to in /etc/httpd/conf.d/10-mod_rewrite.conf, replace RewriteLock line with Mutex sem

Apache Passenger and Ruby

Change current user to avalon then install RVM and ruby 2.4.1

Code Block
su - root
yum install sqlite-devel
su - avalon
curl -L https://get.rvm.io | bash -s stable --ruby=2.4.1

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

Code Block
source /home/avalon/.rvm/scripts/rvm
rvm use 2.4.1

Install Passenger via Gem (as avalon user)

Code Block
gem install passenger

Check to make sure passenger installed in the expected location (as avalon user)

Code Block
$ passenger-config --root
/home/avalon/.rvm/gems/ruby-2.4.1/gems/passenger-5.0.17

Install Passenger apache module requirements (as root)

Code Block
su - root
yum install curl-devel httpd httpd-devel apr-devel apr-util-devel

Build passenger for your version of Apache and Ruby (as avalon user)

Code Block
su - avalon
passenger-install-apache2-module #copy the suggested Apache configuration file settings for later

Create an apache configuration file (as root)

Code Block
su - root
vim /etc/httpd/conf.d/passenger.conf

Example contents of /etc/httpd/conf.d/passenger.conf, which may need to be changed based off of the current version of ruby and passenger:

Code Block
LoadModule passenger_module /home/avalon/.rvm/gems/ruby-2.4.1/gems/passenger-5.0.17/buildout/apache2/mod_passenger.so
<IfModule passenger_module>
  PassengerRoot /home/avalon/.rvm/gems/ruby-2.4.1/gems/passenger-5.0.17
  PassengerDefaultRuby /home/avalon/.rvm/wrappers/ruby-2.4.1/ruby
  PassengerMaxPoolSize 30
  PassengerPoolIdleTime 300
  PassengerMaxInstancesPerApp 0
  PassengerMinInstances 3
  PassengerSpawnMethod smart-lv2
</IfModule>

Apache security configuration

Code Block
wget --no-check-certificate https://raw.github.com/avalonmediasystem/config-files/master/sbin/avalon_auth -O /usr/local/sbin/avalon_auth
chmod +x /usr/local/sbin/avalon_auth
wget --no-check-certificate https://raw.github.com/avalonmediasystem/config-files/master/apache/10-mod_rewrite.conf -P /etc/httpd/conf.d/

...

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Add nginx user and let it own nginx stuff

Code Block
useradd -M -s /bin/nologin nginx
chown -R nginx:nginx /etc/nginx /var/log/nginx 

Make 8980 bindable and start nginx

Code Block
semanage port -a -t http_port_t  -p tcp 8980
systemctl start nginx

Avalon config should be updated to be compatible with Nginx:

Code Block
streaming:
  server: :nginx
  http_base: 'http://localhost:8980/avalon'
  content_path: '/var/avalon/derivatives'


Warning

If you enable SSL on Avalon server, you should also enable SSL on the streaming server to avoid Mixed content warning.

FFmpeg

Info
titleDownload prebuilt ffmpeg

You can choose to download prebuilt binaries instead of building it yourself. Extract and copy ffmpeg to /usr/bin/

Installation prerequisites

Install prerequisite packages using yum and the Avalon repository (note: mediainfo is pinned to 0.7.61-1 because of a bug with time fragment formatting in most recent version 0.7.87-1 in epel):

Code Block
yum install SDL-devel a52dec-devel bzip2-devel faad2-devel freetype-devel frei0r-plugins-devel \
	gsm-devel imlib2-devel lame-devel libdc1394-devel libraw1394-devel librtmp-devel libtheora-devel \
	libva-devel libfaac-devel libvdpau-devel libstdc++-devel libvorbis-devel libvpx-devel \
	mediainfo-0.7.61-1 opencore-amr-devel opencv-devel openjpeg-devel openssl-devel schroedinger-devel \
	speex-devel texi2html vo-aacenc-devel x264-devel xvidcore-devel yasm zlib-devel

Install rpmdev-setuptree

Code Block
yum install rpmdevtools

Install ffmpeg srpm

The following commands need to run under a user other than root. Change to another user to continue.

Code Block
su - someuser

Run the ffmpeg installer

Code Block
rpmdev-setuptree
rpm -ivh https://github.com/avalonmediasystem/avalon-installer/blob/master/files/ffmpeg/ffmpeg-2.4.2-1.el6.src.rpm?raw=true

# Retrieving https://github.com/avalonmediasystem/avalon-installer/blob/master/files/ffmpeg/ffmpeg-2.4.2-1.el6.src.rpm
#   1:ffmpeg                 warning: user makerpm does not exist - using root
# warning: group makerpm does not exist - using root
########################################### [100%]
# warning: user makerpm does not exist - using root
# warning: group makerpm does not exist - using root
# Build ffmpeg binary as non-root and install as root

rpmbuild -bb rpmbuild/SPECS/ffmpeg24.spec

Log back in as root and finish the install.

Code Block
su - root
rpm -ivh /home/someuser/rpmbuild/RPMS/x86_64/ffmpeg-*.rpm

You can also build a more modern ffmpeg from source, but not all versions work. Version 3.1 is known to work - check out the release/3.1 branch and build from there. If your modern ffmpeg uses fdk_aac instead of libfaac, adjust Avalon config/ffmpeg_presets.xml accordingly.

HTTPD

Install and start the httpd service.

Code Block
yum install httpd
systemctl start httpd

Apache Passenger and Ruby

Change current user to avalon then install RVM and ruby 2.4.1

Code Block
useradd avalon
su - avalon
curl -L https://get.rvm.io | bash -s stable --ruby=2.5.7

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

Code Block
source /home/avalon/.rvm/scripts/rvm
rvm use 2.5.7

Install Passenger via Gem (as avalon user)

Code Block
gem install passenger

Check to make sure passenger installed in the expected location (as avalon user)

Code Block
$ passenger-config --root
/home/avalon/.rvm/gems/ruby-2.5.7/gems/passenger-6.0.4

Install Passenger apache module requirements (as root)

Code Block
su - root
yum install -y pygpgme curl
yum install -y mod_passenger || yum-config-manager --enable cr && yum install -y mod_passenger

Create a virtual host for avalon

Code Block
wget --no-check-certificate https://raw.github.com/avalonmediasystem/config-files/master/apache/20-avalon.conf -P /etc/httpd/conf.d/
vim /etc/httpd/conf.d/20-avalon.conf

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

Code Block
RailsEnv developmentproduction

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

...

Restart apache.  With apache running, check passenger-status

Code Block
servicesystemctl start httpd restart
su - avalon
which passenger-status
#> ~/.rvm/gems/ruby-2.4.1/bin/passenger-status

Avalon

Grab Avalon code from github

Code Block
cdsu - ~root
git clone githttps://github.com/avalonmediasystem/avalon.git
cd avalon
git checkout master #make sure you are in the master branch (should be by default)
su - root
chown avalon:avalon /var/www/avalon/public/
suchown - avalon:avalon mv public/* /var/www/avalon/public/
rmdir public
mv  * /var/www/avalon/

Configure Avalon 

As of 6.3, Avalon is using the flexible and increasingly popular Config gem. Default settings for Avalon now live at config/settings.yml, which should not be altered. Any custom config should be placed in config/settings/<environment>.local.yml which will selectively override the default values.

...