English فارسی Suomi
Français Nederlands Translate

Plumi

Plumi: Installation

Installation

This is a guide for installing Plumi 3.0 on a Debian or Ubuntu Linux server using an Apache2 web server.

Note: A how-to guide has recently been written for installing Plumi on FreeBSD 7.3-PRERELEASE. This should also work on FreeBSD 8.x but has not yet been tested. This guide can be found in an email sent to the Plumi Discuss list.

Plumi is untested on other operating systems. You can find more information about installing Plone on different kinds of servers here, which should aid you in installing the Plumi buildout on other operating systems. Please contribute your installation notes on these or different OSs via the Plumi email list and/or by editing this manual chapter here on FLOSSmanuals.

Prior Knowledge

This guide requires that you already have intermediate knowledge of systems administration, Debian or Ubuntu Linux, the shell and Apache. A basic knowledge of Python is desirable for installation. Knowledge of Zope and Plone will aid in set up of your Plumi site.

Requirements

  • Debian or Ubuntu Linux server machine with these system requirements and Apache2 web server & domain set up in which to run your Plumi site (a tutorial on setting up an Ubuntu web server can be found here and one for a Debian web server is here).
  • Shell access to server and an account with permissions over domain's directory.
  • The server will need to have:
    • GCC development tools.
    • make.
    • Subversion version control system (svn).
  • Plumi 3 is built on Plone 3 which requires Python 2.4 to operate correctly. It will be installed as part of the installation detailed in this chapter.

Two Domains Required

Plumi 3 requires two domains to operate although they can point to the same server:

  • The Plumi Site (eg: example.org)
  • Plumi Transcode Daemon and transcoded files (videos.example.org)

Please ensure that these domains are set up in advance of your site installation and have had sufficient time to propagate through  the Internet (eg: 24-48 hours).

NOTE: 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).

Setting up Python & video codecs

The video codecs (ffmpeg & ffmpeg2theora) are not part of the standard Ubuntu repositories and you will need use the following command to add the Medibuntu repository to your system:

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

Once your system is configured to use the Medibuntu repository you can install Python and the codecs by running this command:

apt-get install python2.4-dev python2.4-setuptools build-essential libavcodec-unstripped-52 ffmpeg ffmpeg2theora

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 -p /usr/bin/python2.4 --no-site-packages src/pyvirt
. src/pyvirt/bin/activate
$ easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz

This will install the virtual env into src/pyvirt, activate it and then install the (required) Python Imaging Library into the virtual env.

Installing via Buildout

Here you will find information on how to install Plumi from buildout. A buildout puts together Zope, Plone, the third-party products and all customisations into one package. This makes it very easy for you to get everything up and running quickly. The buildout tutorial on Plone.org is available here.

Some links for background reading on buildout/setuptools/disutils/virtualenv :  http://us.pycon.org/2009/tutorials/schedule/1PM3/

If you want to install the buildout inside a chroot , see here: http://plumi.org/browser/plumi-buildout-plone3/trunk/DevelopingInAChroot.txt

NOTE: Plumi uses ports 8080 to run Zope, 8021 to run ftp and 8888 as the listen port for the transcode daemon. If you have other systems using these ports, please configure your buildout prior to running it (see the buildout configuration section for details).

Buildout Installation Process

This process assumes that you are creating a Plumi site called "plumi" at www.example.com. Before installing Plumi, you need to answer the following questions:

Where are you going to put your Plumi files on your web server?

  • We are using /opt/plumi but you could use /home/zope or something similar.
  • NOTE: Do not install the files into /var/www or any other publically accessible space on your server.

Which version of Plumi do you want to get?

  • The trunk version of Plumi contains the latest development code and may therefore be unstable. If you are contributing to the development of Plumi by coding or testing then this is the version you should install.
  • Tagged versions of Plumi are releases that have been packaged and may include Beta Releases, Release Candidates or full production versions.

Download Plumi from SVN

Plumi is available from the Plone SVN server. To download the latest Trunk version of Plumi, run the following command:

svn co https://svn.plone.org/svn/collective/plumi.buildout/trunk/ target_folder_name

To download the latest Tagged version of Plumi, run the following command:

svn co https://svn.plone.org/svn/collective/plumi.buildout/tags/Tag_Name  target_folder_name

NOTE: target_folder_name is where you want the code to go (eg: /opt/plumi/3.0 or /home/zope/plumi) and Tag_Name is tagged version you want to get (eg: 3.0-rc3, etc)

Download Plumi as a Packaged Release

Plumi can be downloaded as a fully packaged release in an archive using the tar format. Only tagged versions are available this way, not the current trunk. To download a packaged release, follow the instructions below:

mkdir /opt/plumi
wget http://plone.org/products/plumi/releases/Release_Name/Tar_File
tar -xzvf Tar_File
cd Created_Directory

NOTE: Release_Name is the name of the release package you're downloading (eg: 3.0-RC3), Tar_File is the name of the archive file (eg: plumirc3.tar.gz) and Created_Directory is the name of the directory created after the archive is extracted (eg: plumi3).

Set Site Configuration Information

Configure the specific information about this Plumi installation, including:

  • Change all references to hostname & email address
  • Check the ports and change them if the defaults are already in use
  • Set the effective user to the name of the user account that Zope is to be installed under (NOTE: This user should already be set up - the Plumi installation script will not create it)
  • Set the default Zope admin user & password if you want them to be different (recommended)
NOTE: It is best to use the default 127.0.0.1 URLs unless you are putting the transcoder on a separate machine

# site-specific settings for a Plumi based site

[site]
# start with offbeat password, and hint that it should be made unique in-site:
user = admin:admin               <-Default Zope admin user & password
effective-user = zope            <-User that Zope will be installed under
http-address = 127.0.0.1:8080    <-Internal address of the Zope server
ftp-address = 127.0.0.1:8021     <-Internal address of the Zope FTP server
transcode_host = 127.0.0.1       <-Internal address of the transcoder
transcode_port = 8888            <-Port the transcoder will listen on
videofolder = transcoded         <-Directory where videos will be placed

#squid configs
squid_address = 127.0.0.1:4128
squid_backend = ${site:http-address}
squid_hostname = example.org     <-Replace this with your domain name
squid_email = plumi@example.org  <-Replace this with a valid email address

#apache configs
apache_backends = example.org:${site:squid_address}
transcode_backends = videos.example.org:${site:transcode_host}:${site:transcode_port}
apache_zope2_vhm_map = example.org:/Plone   <-Replace this with your domain
                                              and Plumi site name

Run the buildout then setup & configure Plumi

  1. Prepare to run the buildout (bootstrap is a Python script that creates a number of directories and scripts based on the buildout configuration file, and downloads the latest version of the zc.buildout egg).
    $ python2.4 bootstrap.py 
  2. Run the buildout (in verbose mode). This will take between 5 to 10 minutes, possibly more depending on your server's configuration & load. Sit down, grab a coffee and wait till it finishes!
    $ ./bin/buildout -v 
  3. Now start Zope/Plone and the other applications in the background (NOTE: This assumes you are running Apache & Squid as supplied by the Plumi Buildout)
  4. ./bin/instance start
    ./bin/transcodedaemon start
    ./bin/squid-instance
    sudo ./bin/apachectl start
    
  5. If your server already has Apache & Squid set up on it (eg: for hosting other, non-Plumi sites), copy the files below into the list of available Apache sites and enable them (remember to replace example.org with your site's domain) and then restart Apache:
  6. cp ./parts/apacheconf/conf.d/virtual_example.org.conf /etc/apache2/sites-available
    cp ./parts/apachetranscodeconf/conf.d/virtual_video.example.org.conf /etc/apache2/sites-available
    /etc/init.d/apache2 restart
    
  7. Once the instance is running, go to the Zope Management Interface (ZMI).
    http://www.example.org:8080/manage
  8. If you've used a non-standard port for Zope, replace the 8080 in the URL above with the port you have specified when configuring the buildout.

  9. Log in to the ZMI using the admin login details you specified in site.cfg (eg: username: admin, password: admin). If you want to change the admin user's ZMI password once logged in, navigate to the acl_users folder in the left-hand sidebar.



    Click on users.



    Click password.



    Enter password and confirm by re-entering, then click Update Password.



  10. Add a Plone site or instance in the ZMI.

    Click “Root Folder” in the left-hand sidebar. Choose Plone site from the Select type to add... drop-down menu and click Add.



    Enter the ID, Name and Description, e.g. ID "plumi" and Name "Plumi Site". Click Add Plone Site.



  11. Visit your new plone site by entering this URL: http://www.example.org:8080/plumi
  12. If you've used a non-standard port for Zope, replace the 8080 in the URL above with the port you have specified when configuring the buildout.


  13. Click site setup in the top right corner.



  14. Follow the prompt to change your mail settings.



  15. Change/add your mail settings and click Save.



  16. Click Add/Remove Products from Site Setup sidebar.



  17. Tick the tick box next to Plumi application setup.



  18. Click Install.



  19. Wait a few minutes for your Plumi site to install. When it is done, the page will reload and you should see a freshly installed Plumi site :)



  20. Go to the Zope Management Interface (ZMI) and select portal_properties/plumi_properties then set addresses for transcodedaemon (eg: http://videos.example.org),  videoserver (eg: http://videos.example.com)  and plonesite (eg: http://example.org).
  21. Add a new user to your Plumi site for testing (the admin user may not have the correct folders created for them, as this user is created before the Plumi site is generated).

    Click log out.



    Register a new user by clicking register.



    Log in with new user account details by clicking log in.



  22. Try publishing a video in your new Plumi site (logged in as this new testing user).
  23. Check the video after it has uploaded to see if it has been created and transcoded correctly.

Installing PlumiFTP

An optional addition to Plumi is the PlumiFTP module. This provides an FTP service that monitors port 21 and intterfaces with the Zope FTP service. It is not essential for the operatoin of Plumi.

To install PlumiFTP, run the following command

sudo easy_install-2.4 plumiftp

Once installed, run the following commands to set up the configuration files

cp /usr/lib/python2.4/site-packages/plumiftp-0.4-py2.4.egg/plumiftp/plumiftp.cfg /etc
cp /usr/lib/python2.4/site-packages/plumiftp-0.4-py2.4.egg/plumiftp/plumiftp.initscript /etc/init.d/plumiftp
chmod +x /etc/init.d/plumiftp

Now you need to edit the /etc/plumiftp.cfg file to configure PlumiFTP as required. The values you can set are:

  •  TmpDir Temporary storage for files as they are being uploaded
  • ZopeFTPServerAddr The URL to the Zope FTP server (be st left as localhost if possible)
  • ZopeFTPServerPort The port your Zope FTP server is listening on
  • ZopePathString Change plumi-id to the ID of your plumi site
  • RealFTP values Set the URL, port, "hello" and "goodbye" messages that PlumiFTP will use when providing the FTP service

Once you have completed editing the configuration file, use the following command to start PlumiFTP:

/etc/init.d/plumiftp start

Now you can test that PlumiFTPis running by using telnet to connect to your site on the RealFTP URL & port. You should see the "hello" message you set up in /etc/plumiftp.cfg:

telnet example.org 21

For the current version of PlumiFTP, you should also see the following message:

220 pyftpdlib 0.5.2 ready

Future versions of PlumFTP will show a different version number.

Configuring Plumi to start automatically

To ensure that Plumi will start automatically whenever your server is turned on, add the following lines to your /etc/rc.local file:

./bin/instance start
./bin/squid-instance
su zope -c './bin/transcodedaemon start'
./bin/apachectl start  

NOTE: Replace the "zope" in "su zope -c" with the name of the user you installed Plumi under (the "effective-user" from site.cfg)


if you are running PlumiFTP on your site, you will also need to add the following line:

/etc/init.d/plumiftp start

Troubleshooting

If you are having trouble installing Plumi please join one of our email lists or IRC channels listed here or contact the Plumi maintainers here.

Running Multiple Plumi Buildouts

You may encounter difficulties if you are already running a Plumi site from another buildout on this webserver (note that you would usually add another Plone site within the one buildout rather than run multiple sites from different buildouts). If you must run multiple Plumi installations on the same server, you will need to set up Apache & Squid yourself & not use the default configurations included in the buildout process. You will also need to change the default ports in the installation's site.cfg file. If you are running more than one transcode daemon as well, you will need to change the name of the Transcode Daemon process ID file.

Development Map

The development map chapter describes the anatomy of the Plumi buildout, and explains the products and packages that are installed.


EDIT