Page tree

Versions Compared

Key

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

 

Recipe instructions for building your own Avalon setup from scratch on CentOS or Red Hat Enterprise Linux

...

Red5 is an open source alternative to Adobe Flash Media Server.

Code Block
useradd red5


wget http://red5.org/downloads/red5/1_0_1/red5-1.0.1.tar.gz
tar xvf red5-1.0.1.tar.gz
mv red5-server-1.0 /usr/local/red5

wget https://raw.github.com/avalonmediasystem/avalon-installer/master/modules/red5/templates/red5_init_script.erb -O red5_init_script.sh
mv red5_init_script.sh /etc/rc.d/init.d/red5


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

...

Code Block
yum install httpd

Add avalon user

Code Block
useradd avalon
mkdir /var/www/avalon
chown -R avalon:avalon /var/www/avalon

Install Matterhorn

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/

...

Code Block
wget https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/config.properties
vim config.properties 
Change the server url port from 18080 to 8080 on line 19:
org.opencastproject.server.url=http://localhost:8080

Then move the config to the appropriate spot.

Code Block
mv config.properties /usr/local/matterhorn/etc/

 

Matterhorn for streaming files

[security.pp ~line 37]

...

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

...

chown red5:avalon 

chmod 0775 /usr/local/red5/webapp/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/

 

add matterhorn user into the avalon group

 

org.opencastproject.streaming.directory=/var/avalon/rtmp_streamsDownload Matterhorn config and verify property values.

Code Block
wget https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/config.properties
vim config.properties 
Change the server url port from 18080 to 8080 on line 19:
org.opencastproject.

...

server.

...

url=http://localhost:8080

And verify these values:

org.opencastproject.streaming.directory=/var/avalon/rtmp_streams
org.opencastproject.hls.directory=/var/avalon/hls_streams

 

Install sqlite-devel
Code Block
yum install sqlite-devel
Create avalon user and then log in as avalon
Code Block
useradd avalon
mkdir /var/www/avalon
chown -R avalon:avalon /var/www/avalon
su - avalon

 

As Avalon user, Install Then move the config to the appropriate spot.

Code Block
mv config.properties /usr/local/matterhorn/etc/

Add matterhorn user to the avalon group.

Code Block
usermod -G avalon matterhorn

 

Install sqlite-devel
Code Block
yum install sqlite-devel

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

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

 

As Avalon user, Source the RVM shell# source  (as avalon user).

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

As Avalon user, Install Passenger via Gem (as avalon user).

Code Block
gem install passenger

As Avalon user, 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

 

As Avalon user, build passenger for Build passenger for your version of Apache and Ruby .[avalon@localhost ~]$ (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.

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

Example contents of /etc/httpd/conf.d/passenger.conf:

Code Block
LoadModule passenger_module /home/avalon/.rvm/gems/ruby-1.9.3-p429p448/gems/passenger-34.0.1910/extbuildout/apache2/mod_passenger.so
<IfModule passenger_module>
   PassengerRoot /home/avalon/.rvm/gems/ruby-1.9.3-p429p448/gems/passenger-34.0.1910
   PassengerRubyPassengerDefaultRuby /home/avalon/.rvm/wrappers/ruby-1.9.3-p429p448/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.confRetrieve

Code Block
wget https://raw.github.com/avalonmediasystem/config-files/master/apache/20-avalon.conf

...

 -P /etc/httpd/conf.d/

...

  RailsEnv Development

...


vi /etc/httpd/conf.d/20-avalon.conf

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

As Root

mkdir /var/www/avalon

chown avalon:avalon /var/www/avalon

As avalon user:

cd /var/www/avalon

...

Grab Avalon code from github

Code Block
cd ~
git clone git://github.com/avalonmediasystem/avalon.git

...


cd avalon
git checkout

...

rm  /var/www/avalon/.rvmrc

 

...

 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/

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

Code Block
1.9.3-p448

Create /var/www/avalon/config/setup_load_paths.rb and add:

Code Block
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')

...


  

...

 begin

...


   

...

 

...

 gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')

...


   

...

 

...

 ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"

...


   

...

 

...

 require 'rvm'

...


   

...

 

...

 RVM.use_from_path! File.dirname(File.dirname(__FILE__))

...


  

...

 rescue LoadError

...


   

...

 

...

 raise "RVM gem is currently unavailable."

...


  

...

 end

...


 end

...


 # If you're not using Bundler at all, remove lines bellow

...


 ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))

...


 require 'bundler/setup'

...

Code Block
cd /var/www/avalon/

...

config
cp authentication.yml.example config/authentication.yml

...


vi database.yml
Replace what's in database.yml with:
Code Block
development:

...


  adapter: mysql2

...


  host: localhost
  database: rails

...


  username: rails

...


  password: rails

...


  pool: 5

...


  timeout: 5000
Code Block
yum install mysql-devel

...


su - avalon
gem install activerecord-mysql2-adapter

...


gem install

...

 

...

 mysql2
su - root
vi /var/www/avalon/Gemfile
Add to the Gemfile:
Code Block
gem 'mysql2', '~>0.3.11'

Run the bundle install

edit solr.yml

  development:
    url: http://localhost:8983/solr/

edit fedora.yml

...

Code Block
su - avalon
cd /var/www/avalon
gem update debugger-ruby_core_source
bundle install

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

Code Block
  development:
    url: http://

...

localhost:8983/solr/

...

 

...

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

Code Block
  development:

...


    

...

user: 

...

fedoraAdmin
    password: FedoraPassword
    url: http://127.0.0.1:8983/fedora

Create  /var/www/avalon/config/matterhorn.yml

Code Block
development:
  url: http://matterhorn_system_account:CHANGE_ME@localhost:8080/

create Create  /var/www/avalon/config/avalon.yml

Code Block
development:

...


  dropbox:

...


   

...

 path: '/var/avalon/dropbox/'

...


   

...

 upload_uri: 'sftp://localhost/var/avalon/dropbox'

...


   

...

 username: 'test'

...


   

...

 password: 'test'

...


   

...

 notification_email_address: ''

 

...

Create the database using rake

Code Block
su - avalon
cd /var/www/avalon
rake db:create

This command creates the database.

rake db:migrate

This command runs the database migrations.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

Code Block
rake db:migrate

set rails environment to development

...