Page tree

Versions Compared

Key

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

...

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

Warning

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

...

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

* 

If you run into connection issues along the line you can disable the iptables, completely dropping your firewall, by running "service iptables stop" and when you're done troubleshooting, . This will completely drop your firewall. When finished troubleshooting run "service iptables start".

...

Code Block
curl http://yumrepo-public.library.northwestern.edu/RPM-GPG-KEY-nul -o /etc/pki/rpm-gpg/RPM-GPG-KEY-nul

Install Development Libraries development libraries and packages for building Ruby

...

on line 70, change the Tomcat connector port from 8080 to 8983:

Code Block
<Connector port="8983" protocol="HTTP/1.1"

Add Tomcat manager user

By default, no user has access to the Tomcat Manager App. 

Code Block
vim /usr/local/tomcat/conf/tomcat-users.xml

Define a role and a user in tomcat-users.xml with a access to the manager-gui role. Below is a very basic example. Use more secure log in credentials than the example please.

Code Block
<tomcat-users>
  <role rolename="manager-gui"/>
  <user username="admin" password="tomcat" roles="manager-gui"/>
</tomcat-users>

...

See if you can log in to the manager app at http://<server host name>:8983/manager/html

...

Download the solr tarball and unpack it

(Download 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

Add XML configurations

Place into Edit /usr/local/tomcat/conf/Catalina/localhost/solr.xml: and add

Code Block
<Context docBase="/usr/local/solr/solr.war" debug="0" crossContext="true">
 <Environment name="solr/home" type="java.lang.String" value="/usr/local/solr" override="true"/>
</Context>

Place into Edit /usr/local/solr/solr.xml: and insert

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>

...

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

If you can't access the dashboard, check the tomcat logs in in /usr/local/tomcat/logs/. Catalina.out and localhost.<date>.log have been the most helpfulusually provide the best information.

 

MySQL

Avalon uses MySQL for storing search queries, user data and roles, and as a back end for asynchronously sending requests to Matterhorn.

...

Create databases and users

Enter the mysql monitor:

Code Block
#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
...etc...
mysql>

Create a database for the Fedora Commons Repository software and add a user to it.  it 

Code Block
create database fedora3;
create user 'fcrepo'@'localhost' identified by 'fcrepo';
grant all privileges on fedora3.* to 'fcrepo'@'localhost';
flush privileges; 

Create a database for the Avalon web application and add a user to it.

Code Block
create database rails;
create user 'rails'@'localhost' identified by 'rails';
grant all privileges on rails.* to 'rails'@'localhost';
flush privileges;

...

Code Block
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| fedora3            |
| mysql              |
| rails              |
| test               |
+--------------------+
5 rows in set (0.00 sec)
mysql> select user, host from mysql.user;
+--------+--------------+
| user   | host         |
+--------+--------------+
| root   | 127.0.0.1    |
|        | 129.79.32.87 |
| root   | 129.79.32.87 |
|        | localhost    |
| fcrepo | localhost    |
| rails  | localhost    |
| root   | localhost    |
+--------+--------------+
7 rows in set (0.00 sec)
 
mysql> exit;
Bye

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

...

Code Block
wget http://sourceforge.net/projects/fedora-commons/files/fedora/3.6.2/fcrepo-installer-3.6.2.jar/download
java -jar fcrepo-installer-3.6.2.jar

Enter values:Use the following values in place of defaults

SettingValue
Installation type
custom
Fedora home directory
/usr/local/fedora
Fedora administrator password
fedoraPassword 
Fedora server host
localhost
Fedora application server context
fedora
Authentication requirement for API-A
false
SSL availability
true
SSL required for API-A
false
SSL required for API-M
true
Servlet engine
existingTomcat
Tomcat home directory
/usr/local/tomcat
Tomcat HTTP port
8983
Tomcat shutdown port
8005
Tomcat Secure HTTP port
8443
Keystore file
default
Keystore password
changeit
Keystore type
JKS
Database
mysql
MySQL JDBC driver
included
Database username
fcrepo
Database password
fcrepo

accept Accept remaining defaults then add permissions for Tomcat and restart Tomcat

...

Red5 is an open source alternative to Adobe Flash Media Server. If using the Adobe Media Server you can skip to the next step.

Create a red5 user.

Code Block
useradd red5

...

Code Block
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

Give red5 Red5 permissions to the Red5 red5 directory and the init script.

...

Install prerequisite packages using yum and the NUL-public repository:

Code Block
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  
opencore-amr-devel 
opencv-devel 
openjpeg-devel 
openssl-devel 
schroedinger-devel 
speex-devel 
texi2html
vo-aacenc-devel 
x264-devel 
xvidcore-devel 
yasm  
zlib-devel 

for the lazy:

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 opencore-amr-devel opencv-devel openjpeg-devel openssl-devel schroedinger-devel \
	speex-devel texi2html vo-aacenc-devel x264-devel xvidcore-devel yasm zlib-devel

...

Code Block
yum install rpmdevtools

Install ffmpeg srpm

Log in as the user red5, because the The following commands need to run under a user other than root. Change to the red5 user to continue.

Code Block
su - red5

Run the ffmpeg install.installer

Code Block
#rpmdev-setuptree
#rpm -ivh https://github.com/avalonmediasystem/avalon-installer/raw/master/files/ffmpeg/ffmpeg-1.2-59a.el6.src.rpm
Retrieving https://github.com/avalonmediasystem/avalon-installer/raw/master/files/ffmpeg/ffmpeg-1.2-59a.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/ffmpeg12.spec

...

Change the server url port from 18080 to 8080 on line 19:
Code Block
org.opencastproject.server.url=http://localhost:8080

And verify these values:the configuration of the streaming directories

Code Block
org.opencastproject.streaming.directory=/var/avalon/rtmp_streams

...


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

Then move Move the config to the appropriate spot.

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

...

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

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

...

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/
vim /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

...

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
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
vim database.yml

Replace what's in database.yml with the correct values 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 aboveadapter 

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

Add this line to the Gemfile:

Code Block
gem 'mysql2', '~>0.3.11'

...

Finish configuring Avalon

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

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

Edit /var/www/avalon/config/fedora.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  /var/www/avalon/config/avalon.yml and base it off of /var/www/avalon/config/avalon.yml.example. Here's a snippet:Consult the documentation to customize this file for your installation. 

Code Block
development:
  dropbox:
    path: '/var/avalon/dropbox/'
    upload_uri: 'sftp://localhost/var/avalon/dropbox'
    username: 'test'
    password: 'test'
    notification_email_address: ''

...

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

...

Set rails environment to development (it is by default), if it has not defaulted to this. On the first line of /var/www/avalon/config/environment.rb make sure it says 'development' like so:

Code Block
ENV['RAILS_ENV'] ||= 'development'

...

You should be able to visit the webpage with just the hostname . ex: (ie http://localhost (if you want to test from your local machine)

Click on "Sign in" in the upper right corner of the website main page.

Skip the sign-in fields and click the Create identity button using these values:

 Set up a default identity with the following properties.

 

Code Block
archivist1@example.com

...


password/password

 

This is a known identity with administrative privileges.

Start delayed_job

As avalon user:run

Code Block
cd /var/www/avalon/
bundle exec rake delayed_job:start

...

Code Block
cd /usr/local/red5/webapps
wget https://github.com/avalonmediasystem/config-files/raw/master/red5/red5-avalon.tar.gz
tar xvzf red5-avalon.tar.gz
chown -R red5:red5 avalon/

Edit /usr/local/red5/webapps/avalon/WEB-INF/red5-web.properties:

Code Block
avalon.serverUrl=http://localhost/

Restart red5Red5

Code Block
service red5 restart

If Red5 is installed and running you should be able to access this page:  http://avalon.dev:5080/

Dropbox

Code Block
groupadd -r dropbox
useradd -r avalondrop
usermod -G dropbox avalon
mkdir -p /var/avalon/dropbox
chown avalondrop:dropbox /var/avalon/dropbox
chmod 2775 /var/avalon/dropbox

Add this to Edit /etc/ssh/sshd_config:

Code Block
# override default of no subsystems
Subsystem sftp internal-sftp
 
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
Match Group dropbox
ChrootDirectory /var/avalon
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

...