Page tree

Versions Compared

Key

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

...

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

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

...

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/

...

(from http://www.apache.org/dyn/closer.cgi/lucene/solr/4.2.0)

Code Block
wget http://archive.apache.org/dist/lucene/solr/4.2.0/solr-4.2.0.tgz
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"/>
  </cores>
</solr>
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/
 
wget https://github.com/avalonmediasystem/puppet-solr/archive/master.zip
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
 
wget https://github.com/avalonmediasystem/avalon-felix/archive/1.4.x.tar.gz
tar xvf 1.4.x
mv avalon-felix-1.4.x /usr/local/matterhorn

wget https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/matterhorn_init.sh
mv matterhorn_init.sh /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
wget https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/config.properties
vim config.properties 

...

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 https://get.rvm.io | 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
/home/avalon/.rvm/gems/ruby-1.9.3-p429/gems/passenger-3.0.19

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/mod_passenger.so
<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
</IfModule>

Apache security configuration

Code Block
wget 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 https://raw.github.com/avalonmediasystem/config-files/master/apache/10-mod_rewrite.conf -P /etc/httpd/conf.d/

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

Code Block
wget https://raw.github.com/avalonmediasystem/config-files/master/apache/20-avalon.conf -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
~/.rvm/gems/ruby-1.9.3-p448/bin/passenger-status

Avalon

Grab Avalon code from github
Code Block
cd ~
git clone git://github.com/avalonmediasystem/avalon.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
development:
  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

...