These instructions have only been tested on a server that started with the following components already installed:

  • CentOS 5.3
  • MySQL 5.0.77
  • Apache 2.0.63

It installs it into the Apache htdocs root, and sets very liberal permissions which can be tweaked if you know what you're doing.

Install Mono

Get mono core distribution and unpackage:

mkdir /opt/tmp
cd /opt/tmp
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.tar.bz2
tar xjf mono-2.4.tar.bz2
cd /opt/tmp/mono-2.4

Install dependencies:

yum install gcc bison pkgconfig glib2-devel gettext make

Build mono (make will take a long time):

./configure
make
make install

Get XSP and mod_mono distributions and unpackage:

cd /opt/tmp
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.4.tar.bz2
tar xjf xsp-2.4.tar.bz2
tar xjf mod_mono-2.4.tar.bz2

Export path to pkgconfig:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Build XSP:

cd /opt/tmp/xsp-2.4./configure
make
make install

Build mod_mono

cd /opt/tmp/mod_mono-2.4
./configure
make
make install

Configure Apache

Configure Apache to use mono:

vim /usr/local/apache/conf/includes/pre_main_2.conf

Add the following to this file:

Include /usr/local/apache/conf/mod_mono.conf
MonoServerPath "/usr/local/bin/mod-mono-server2"
MonoAutoApplication enabled

Edit mod mono configuration to force all types to be handled by ASP.NET:

vim /usr/local/apache/conf/mod_mono.conf

Add this line to the bottom of the file:

ForceType application/x-asp-net

This line forces Mono to handle all requests.

Install Java

Initial Setup

Create/edit ~/.rpmmacros. The file should look like this (where <username> is the user you're logged in with):

%_topdir /home/<username>/rpmbuild
%_tmppath %{_topdir}/tmp

Create necessary directories:

$ mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}

Get necessary packages:

# yum install -y rpm-build gcc gcc-c++ redhat-rpm-config

Install JPackage Utils:

# yum install jpackage-utils

Get Java:

cd ~/rpmbuild/SOURCES
curl -L -O 'http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u11-linux-i586.bin?BundledLineItemUUID=7StIBe.mbCgAAAEhDzgH52QC&OrderID=PhJIBe.mp9YAAAEh_TcH52QC&ProductID=abtIBe.ovJUAAAEdeDBGb7Et&FileName=/jdk-6u11-linux-i586.bin'

Get the proper nosrc.rpm file:

cd ~/rpmbuild/
curl -L -O http://mirrors.dotsrc.org/jpackage/1.7/generic/SRPMS.non-free/java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm

Rebuild the packages:

rpmbuild --rebuild java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm

Install:

yum --nogpgcheck localinstall ~/rpmbuild/RPMS/i586/java-1.6.0-sun-1.6.0.11-1jpp.i586.rpm

Configure the alternatives to select the proper java version:

alternatives --config java
There is 1 program that provides 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-sun/bin/java
Enter to keep the current selection[+], or type selection number:

Then try to execute Java:

java -version

You should get:

java version "1.6.0_11" Java(TM) SE Runtime Environment (build 1.6.0_11-b03) Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, shag)

Install Red5

Download Red5:

wget http://epresence.tv/release/webcasting/server/red5-1.0.25.zip

Unzip it:

unzip red5-1.0.25.zip

Move it to its install location (the following instructions assume you are installing to /opt/red5):

mkdir /opt/red5
mv red5 /opt/red5

Create a directory for streaming files to be stored and set its permissions to be writable by the web server. Note, in the following instructions, for simplicity, we are setting permissions to 777, meaning writable/executable/readable by everyone. This may not be secure. Permissions should be set according to your requirements. The web server and Red5 need to be able to write into this directory.

mkdir /opt/streaming
chmod -R 777 /opt/streaming

Edit the streaming directory configuration file of Red5 to point to the correct Linux directory:

vim /opt/red5/webapps/vod/StreamsDirectories.txt

The file should look something like this:

### ePresence Streaming Directories
## Enter streaming directories in here, one per line
# Comments begin with a '#' 

################################################
#### Windows Platform Streaming Directories ####
################################################

# example allowed directories:
# c:\
# C:\Program Files\MyStreams
# C:\streaming

################################################
####  Linux Platform Streaming Directories  ####
################################################

#example of allowed directories
#/tmp
#/usr/streams
/opt/streaming

Copy the red5 service script into the correct location:

cp /opt/red5/red5 /etc/init.d
chmod +x /etc/init.d/red5

You can now test launching Red5:

/etc/init.d/red5 start

Add Red5 as a service:

chkconfig --add red5
chkconfig --level 345 red5

Setup MySQL

Connect to MySQL:

mysql

Create the ePresence database:

create database epresence;

Grant permissions to a user on epresence database:

GRANT USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON epresence.* TO 'username'@'localhost' WITH GRANT OPTION;

Exit MySQL:

exit

Install ePresence Server

Download ePresence Server, and unpackage it:

cd /opt/tmp
wget http://epresence.tv/release/webcasting/server/Server_5.0.21.zip
unzip Server_5.0.21.zip

Move it to your apache htdocs root:

cp -r Server /usr/local/apache/htdocs

Edit the configuration file to configure the database:

vim <htdocs root>/Web.config

Comment out the session-factory section for the JET database. This area should look like this:

<!-- <session-factory>
            <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
            <property name="connection.driver_class">NHibernate.JetDriver.JetDriver, NHibernate.JetDriver</property>
            <property name="connection.connection_string">Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Development\Repositories\ePresence Private\Server\4.3\Server\epresence.mdb</property>
            <property name="show_sql">true</property>
            <property name="dialect">NHibernate.JetDriver.JetDialect, NHibernate.JetDriver</property>
        </session-factory> -->

Uncomment the session-factory section for MySQL. This area should look like this (ie: remove the <!-- from the start and the --> from the end):

    <session-factory>
      <property name="dialect">NHibernate.Dialect.MySQLDialect</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
      <property name="connection.connection_string">Server=localhost;Database=epresence;UserID=username;Password=password</property>
    </session-factory>

Change the UserID=username and Password=password to a valid username and password for your MySQL database.

Find the httpModules section. In this section, find the "add" tag with name="routing". Change this tag to look like this:

<add name="routing" type="Core.HttpHandlers.MonoRoutingModuleEx, App_Code" />

Set the permissions on the Server directory. Note, Red5 and the Web server need to be able to write into this directory.

chmod -R 755 <htdocs root>

Restart Apache or reboot the machine.

Visit  http://<host>, where <host> is your IP or host name. On the configuration page, enter the Administrator password. Leave the publishing points and streaming URLs as they are (we will configure them manually later). Press save.

On the next page, select "Begin Install". This should take a minute at most. If it takes longer, there is likely a problem with directory permissions or MySQL permissions. The <htdocs root>/Logs/epresence.txt file may give more information if an error occurs. Once it's done, clicking on the link should bring you to your ePresence portal page.

Configure your publishing points. Edit the file <htdocs root>/bin/pointers/1.xml:

vim /usr/local/apache/htdocs/bin/pointers/1.xml

Assuming that Red5 is configured on port 1935, and your streaming storage location, you should change the file to look like this (change x.x.x.x to your server IP or host name).

<?xml version="1.0"?>
<publishingPoints>
	<pp type="FL" download="No" url="x.x.x.x/vod/">/opt/streaming</pp>
	<live title="Profile#1_FL" mediaFormat="FL" method="Push" url="rtmp://x.x.x.x/live" address="rtmp://x.x.x.x/live" streamingPort="" pushPort="" ppname="" desktopStreamName="" username="" password="" />
</publishingPoints>