Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 227 lines (155 sloc) 8.736 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
Installation
============

This is the most up to date Plumi installation guide. A user/admin manual can be found at
**http://en.flossmanuals.net/Plumi/Introduction**

Environment
===========

We use and test Plumi mainly in Debian/Ubuntu, using Python 2.7

Quick installation
==================

This assumes you are on ubuntu/debian and have python 2.7

step 1: install the necessary packages::

    #apt-get install build-essential pkg-config git-core python-dev libjpeg62-dev zlib1g-dev libxslt1-dev groff-base

step 2: get plumi from github and ceate a virtualenv environment::

    $git clone https://github.com/plumi/plumi.app/
    $cd plumi.app
    ~/plumi.app$virtualenv .

step 3: edit site.cfg and change users, if necessary (ftp user, cache user, etc)::

    $vi site.cfg

step 4: run the buildout::

    ~/plumi.app$./bin/python bootstrap.py && ./bin/buildout -v

step 5: run the buildout for ffmpeg::

    ~/plumi.app$cd ffmpeg
    ~/plumi.app/ffmpeg$../bin/python bootstrap.py && ./bin/buildout -vN

step 6: start supervisord as root, this will start all services as users defined on site.cfg::

    #./bin/supervisord

Now check that services have started::

    root@userx:/home/user/plumi# ./bin/supervisorctl status
    cache RUNNING pid 22650, uptime 0:21:29
    nginx RUNNING pid 22651, uptime 0:21:29
    ploneftp RUNNING pid 22649, uptime 0:21:29
    transcodedaemon RUNNING pid 22612 uptime 0:21:29
    uwsgi RUNNING pid 22646, uptime 0:21:29
    worker RUNNING pid 22647, uptime 0:21:29
    zeo RUNNING pid 22645, uptime 0:21:29


If you start plumi as normal user, without changing the default ports, it will not be able to load nginx to port 80, and also start cacher, since default user for cacher is root.
Make sure you edit site.cfg and change the users if you have not root priviledges.

System dependencies
===================

 * install gcc/g++ dev tools
    e.g. sudo apt-get install build-essential pkg-config
 * install git
    e.g. sudo apt-get install git-core
 * install python and header files (tested with python 2.6 and 2.7)
    e.g. sudo apt-get install python-dev
 * install libjpeg, zlib, libpcre, libxslt header files
    e.g. sudo apt-get install libjpeg62-dev zlib1g-dev, libxslt1-dev
    or for Ubuntu 11.04 jpeg support: sudo apt-get install libjpeg8-dev
    for png support in Ubuntu 11.04 you may have to install zlib from source
 * install groff-base
    e.g. sudo apt-get install groff-base


Creating a Python Virtual Environment
=====================================

If you are running other applications and web sites on your server,
it may be worth while creating a python virtual environment for developing
in - this can avoid problems between python packages installed by your
operating system and those installed by easy_install.
You will need to have the virtualenv package installed first - in Debian and
Ubuntu systems you can apt-get install python-virtualenv, then::

    virtualenv --no-site-packages plumi.app


Initial configuration
======================

This step is optional for testing/development builds. However, even in those
cases you may wish to customize some of the options inside site.cfg, especially
if ports 8080, 8888, 8021, 8000, 8100 or 8890 are already used by other apps in
your system.

If you're deploying for production you should have 2 different hostnames
available, one for your Plumi site (e.g. new.plumi.org) and another for the
transcoder/videoserver (e.g.newvideos.plumi.org), both pointing to your public
ip address. You could also install the transcoding server in a different
machine or even have multiple transcoding servers with load balancing, but this
setup will not be covered in this guide. Please ensure that these hostnames are
set up in advance of your site installation and have had sufficient time to
propagate through the Internet (eg: 24-48 hours). If you server is not going to
be accessed from the Internet, you still need to set up the domains within your
private network (eg: internal DNS server, /etc/hosts files on all workstations,
etc).

Before running buildout, you should customize the options inside site.cfg.
At the very least you should change the following:

  * secret: a shared secret key for encrypted communication between Plumi and
      transcodedaemon. Just enter a random string of 4, 8, 16 or 32 characters.
  * www-server-name: the hostname of your Plumi site (e.g. www.engagemedia.org)
  * www-videoserver-name: the hostname of your transcoder & videoserver
      (e.g. videos.engagemedia.org)

If you decided not to change the default user for zope, zeo and transcode in
site.cfg make sure that it exists in your system. If not, add it::

    sudo useradd zope
   

Install Plumi 4.x
=================

Once you're ready with the initial configuration execute the following two
commands. Do it as your regular user for testing/dev builds but make sure you
are root for production builds::

    cd ffmpeg
    python bootstrap.py (or ../bin/python bootstrap.py if you use virtualenv)
    ./bin/buildout

After the ffmpeg buildout is finished you should run the plumi buildout::

    cd ..
    python bootstrap.py (or ./bin/python bootstrap.py if you use virtualenv)
    ./bin/buildout

That should take some time, so feel free to get some cofee or fresh air while
buildout is downloading, compiling and installing dependencies (Zope, Plone,
ffmpeg, etc). If all goes well your Plumi instance will be ready after that
point.


Running Plumi 4.x
==================

Supervisor will be managing the internal ZEO server, the transcodedaemon,
the async worker instance, the varnish cache server, the uwsgi WSGI web
server, as well as the externally facing ploneFTP server and the nginx web
server in production builds.

Start supervisor like this::

    ./bin/supervisord

Confirm that zeo, uwsgi and transcodedaemon are up and running::

    ./bin/supervisorctl status
  
If you ran buildout as a regular (non root) user and you did not change the
default ports for nginx and ploneftp in site.cfg (www-address & plumiftp-address
respectively) you'll see that both ploneftp and nginx failed to start because
you don't have permission to bind on to the priviledged ports 80 and 21.
Nothing to worry about if you're just evaluating Plumi, you can still use it
without nginx. Just go to port 8000 on localhost to access directly the uwsgi
web server.

Run the plumisite command to create a new Plumi site::

    ./bin/plumisite
  
Alternatively, if you can create the Plumi site through the web, using the ZMI.

After that step you're ready to roll! Your new Plumi site will be available
at http://localhost:8000/Plone or at http://{www-server-name} for production
builds.

If you want to do some development, you can use Paster instead of uwsgi
since the latter is more suited for production. Stop uwsgi and start paster
as shown below::

    ./bin/supervisorctl stop uwsgi

    ./bin/paster serve development.ini --reload

The --reload option will consume more resources but it's very handy for dev
since it will automatically reload any python modules that you edit.

If you have changed the default port, hostname, or the secret encryption key
for the transcode daemon in site.cfg, you should go to the transcode settings
panel (e.g. http://localhost:8000/Plone/@@transcode-controlpanel ) and enter
the same host, port and key there.

Add a new user to your Plumi site for testing and start publishing videos!


In order to shutdown all Plumi related services, use the following command::

    ./bin/supervisorctl shutdown

If you want to ensure that Plumi will start automatically whenever your server
is turned on, add the following lines to your /etc/rc.local file replacing
PATH_TO_PLUMI with the actual absolute path of your plumi setup::

    PATH_TO_PLUMI/bin/supervisord


Configuring Video statistics
=========================================

To record and show video views and downloads you'll need a working Piwik
installation. Add the tracking tag in Site-Setup->Site and fill the form in
Site-Setup-> Piwik Settings with the piwik url, the site id on piwik and the
api key (if you have anonymous access on piwik for your site you can leave
anonymous instead of the API key).


Configuring subtitles and downloads
==========================================

By default, subtitle support through Universal Subtitles is enabled. You can
disable it through Site Setup->Transcode Settings. You can also disable
downloads through embedded videos there.
Something went wrong with that request. Please try again.