Page tree

Versions Compared


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


The default hostname is “”, so name the machine this and enter it into /etc/hosts

Code Block
%# hostname
%# cat /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4


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

Download the solr tarball and unpack it to /usr/local/solr/



Code Block
tar xvf solr-4.2.0.tgz
mv solr-4.2.0 /usr/local/solr
cd /usr/local/solr/dist/
cp solr-4.2.0.war /usr/local/tomcat/webapps/solr.war
mv solr-4.2.0.war /usr/local/solr/solr.war


Code Block
<?xml version="1.0" encoding="UTF-8" ?>
  <solr persistent="true">
    <cores defaultCoreName="avalon" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="8983" hostContext="solr">
    <core instanceDir="avalon/" name="avalon"/>
Create necessary directories and


download Avalon specific Solr files from github
Code Block
mkdir /usr/local/solr/lib
mv /usr/local/solr/dist/* /usr/local/solr/lib/
mv /usr/local/solr/contrib /usr/local/solr/lib/
unzip master
mv puppet-solr-master/files/avalon /usr/local/solr
chown -R tomcat7:tomcat /usr/local/solr/
chown -R tomcat7:tomcat /usr/local/tomcat
service tomcat restart


Code Block
yum install httpd
service httpd start

Add avalon user and create avalon directory


Create a user for Matterhorn and then install Matterhorn.

Code Block
useradd matterhorn
tar xvf 1.4.x
mv avalon-felix-1.4.x /usr/local/matterhorn

mv /etc/init.d/matterhorn

chmod +x /etc/init.d/matterhorn
chown -R matterhorn:matterhorn /usr/local/matterhorn

Create and configure streaming directories.

Code Block
mkdir -p /usr/local/red5/webapps/avalon/streams
mkdir /var/avalon
mkdir -p /var/www/avalon/public/streams

chown red5:avalon /usr/local/red5/webapps/avalon/streams
chmod 0775 /usr/local/red5/webapp/avalon/streams
ln -s /usr/local/red5/webapps/avalon/streams /var/avalon/rtmp_streams
mkdir /var/avalon/hls_streams
chown root:root /var/avalon/hls_streams/
ln -s /var/avalon/hls_streams/ /var/www/avalon/public/streams

chmod 0775 /var/avalon/hls_streams/
Configure Matterhorn

Download Matterhorn config and verify property values.

Code Block


Code Block
usermod -G avalon matterhorn


Apache Passenger and Ruby

Install sqlite-devel

Code Block
yum install sqlite-devel

Change current user to avalon then install RVM and ruby 1.9.3-p448.

Code Block
su - avalon
curl -L | bash -s stable --ruby=1.9.3

Source the RVM shell (as avalon user).

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

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

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
vi /etc/httpd/conf.d/passenger.conf


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

Apache security configuration

Code Block
wget -O /usr/local/sbin/avalon_auth
chmod +x /usr/local/sbin/avalon_auth
wget -P /etc/httpd/conf.d/

Create a virtual host for avalon in /etc/httpd/conf.d/avalon.conf

Code Block
wget -P /etc/httpd/conf.d/
vi /etc/httpd/conf.d/20-avalon.conf

Add this line to 20-avalon under the VirtualHost tag:

Code Block
RailsEnv development

Restart apache.  With apache running, check passenger-status:

Code Block
[root@localhost ~]# /etc/init.d/httpd restart
[root@localhost ~]# su - avalon
[avalon@localhost ~]$ which passenger-status


Grab Avalon code from github
Code Block
cd ~
git clone git://
cd avalon
git checkout master #make sure you are in the master branch (should be by default)
rm .rvmrc
mv public/* /var/www/avalon/public/
mv  * /var/www/avalon/
Configure Avalon 

Create /var/www/avalon/.ruby-version and add:


Code Block
cd /var/www/avalon/config
cp authentication.yml.example config/authentication.yml
vi database.yml
Configure database settings
Code Block
vim database.yml

Replace what's in database.yml for your development environment with:

Code Block
  adapter: mysql2
  host: localhost
  database: rails
  username: rails
  password: rails
  pool: 5
  timeout: 5000

Install the mysql2 adapter we referenced above

Code Block
yum install mysql-devel
su - avalon
gem install activerecord-mysql2-adapter
gem install mysql2
su - root
vi /var/www/avalon/Gemfile


Code Block
gem 'mysql2', '~>0.3.11'
Run the bundle install
Code Block
su - avalon
cd /var/www/avalon
gem update debugger-ruby_core_source
bundle install
Finish configuring Avalon

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