| 1 | |
|---|
| 2 | MediaProxy installation procedure |
|---|
| 3 | --------------------------------- |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 2008 AG Projects |
|---|
| 6 | http://ag-projects.com |
|---|
| 7 | |
|---|
| 8 | Authors: Ruud Klaver, Dan Pascu |
|---|
| 9 | |
|---|
| 10 | Home page: http://www.ag-projects.com/MediaProxy.html |
|---|
| 11 | |
|---|
| 12 | For the list of changes between revisions please consult debian/changelog |
|---|
| 13 | |
|---|
| 14 | For information about the MediaProxy architecture, configuring and running |
|---|
| 15 | the dispatcher and the relay, as well as details about the supported |
|---|
| 16 | features and how to use them, please consult the README file. |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | Prerequisites |
|---|
| 20 | ------------- |
|---|
| 21 | |
|---|
| 22 | In order to build and install, MediaProxy has the following requirements: |
|---|
| 23 | |
|---|
| 24 | - Linux (at least 2.6.18) with the following features compiled in: |
|---|
| 25 | - netfilter support |
|---|
| 26 | - connection tracking support |
|---|
| 27 | - connection tracking netlink interface |
|---|
| 28 | - connection tracking event notification API |
|---|
| 29 | - netfilter "NOTRACK" target support |
|---|
| 30 | - netfilter "CONNMARK" target support |
|---|
| 31 | - netfilter "connmark" match support |
|---|
| 32 | - IPv4 connection tracking support |
|---|
| 33 | - IP tables support |
|---|
| 34 | - IP tables Full NAT support |
|---|
| 35 | Distribution provided kernel images should normally provide of all these |
|---|
| 36 | features as modules. The Debian kernel images have all these features |
|---|
| 37 | available and can be used out of the box. |
|---|
| 38 | - libnetfilter-conntrack (at least version 0.0.89) |
|---|
| 39 | Most of the Linux distributions separate a library package into runtime |
|---|
| 40 | and development packages. To build MediaProxy, the development version |
|---|
| 41 | is needed (it usually has a -dev suffix in the package name). |
|---|
| 42 | - Python (at least 2.4) |
|---|
| 43 | http://python.org |
|---|
| 44 | - Twisted framework (at least 2.5.0 with epollreactor support) |
|---|
| 45 | http://twistedmatrix.com |
|---|
| 46 | - python-zopeinterface (this is also a requirement for twisted) |
|---|
| 47 | http://zope.org/Products/ZopeInterface |
|---|
| 48 | - python-application (at least 1.0.9) |
|---|
| 49 | http://pypi.python.org/pypi/python-application |
|---|
| 50 | - GNU-TLS |
|---|
| 51 | http://www.gnu.org/software/gnutls |
|---|
| 52 | - python-gnutls |
|---|
| 53 | http://pypi.python.org/pypi/python-gnutls |
|---|
| 54 | - python-cjson |
|---|
| 55 | http://pypi.python.org/pypi/python-cjson |
|---|
| 56 | |
|---|
| 57 | For the database accounting module: |
|---|
| 58 | |
|---|
| 59 | - SQLObject |
|---|
| 60 | http://sqlobject.org |
|---|
| 61 | |
|---|
| 62 | For the RADIUS accounting module: |
|---|
| 63 | |
|---|
| 64 | - pyrad (at least 1.1) |
|---|
| 65 | http://www.wiggy.net/code/pyrad/ |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | Installation |
|---|
| 69 | ------------ |
|---|
| 70 | |
|---|
| 71 | For people running Debian testing or unstable on an i386 architecture there is |
|---|
| 72 | an official public repository provided by AG Projects. To use it, add these |
|---|
| 73 | lines in /etc/apt/sources.list (use unstable/testing as appropriate): |
|---|
| 74 | |
|---|
| 75 | # AG Projects software |
|---|
| 76 | deb http://ag-projects.com/debian unstable main |
|---|
| 77 | deb-src http://ag-projects.com/debian unstable main |
|---|
| 78 | |
|---|
| 79 | Install the AG Projects debian software signing key: |
|---|
| 80 | |
|---|
| 81 | wget http://download.ag-projects.com/agp-debian-gpg.key |
|---|
| 82 | apt-key add agp-debian-gpg.key |
|---|
| 83 | |
|---|
| 84 | After that, run: |
|---|
| 85 | |
|---|
| 86 | apt-get update |
|---|
| 87 | apt-get install mediaproxy-dispatcher mediaproxy-relay mediaproxy-web-sessions |
|---|
| 88 | |
|---|
| 89 | to install all the packages, or you can install only the packages you actually |
|---|
| 90 | need on that specific system. |
|---|
| 91 | |
|---|
| 92 | In case you want to build your own, please look below to Packaging section. |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | Installing from source |
|---|
| 96 | ---------------------- |
|---|
| 97 | |
|---|
| 98 | When installing from source, first make sure the above mentioned prerequisites |
|---|
| 99 | are installed. If the distribution you are running has them already packaged, |
|---|
| 100 | you should install the distribution provided packages, else you'll have to |
|---|
| 101 | install them from source. If you install them as packages, make sure that you |
|---|
| 102 | also install the development versions for python and libnetfilter-conntrack in |
|---|
| 103 | order to be able to build MediaProxy. If you have to install something from |
|---|
| 104 | source, please consult the installation instructions for that specific package |
|---|
| 105 | in order to find out how to install it. For python packages there is a simple |
|---|
| 106 | method to install them by running easy_install (make sure to run them as root): |
|---|
| 107 | |
|---|
| 108 | easy_install twisted |
|---|
| 109 | easy_install zope.interface |
|---|
| 110 | easy_install python-application |
|---|
| 111 | easy_install python-cjson |
|---|
| 112 | easy_install python-gnutls # this needs libgnutls-dev >= 2.4.1 installed |
|---|
| 113 | easy_install sqlobject |
|---|
| 114 | easy_install pyrad |
|---|
| 115 | |
|---|
| 116 | All of the above should work out of the box, except python-gnutls which needs |
|---|
| 117 | libgnutls-dev at least version 2.4.1 to be installed to succeed. |
|---|
| 118 | |
|---|
| 119 | An alternative method to install the python packages is to download, unpack |
|---|
| 120 | and run (as root): |
|---|
| 121 | |
|---|
| 122 | ./setup.py build; ./setup.py install |
|---|
| 123 | |
|---|
| 124 | for each of them in the directories where they were unpacked. |
|---|
| 125 | |
|---|
| 126 | It should be noted that this only needs to be done for the packages that are |
|---|
| 127 | not provided already by your distribution, otherwise it is recommended to use |
|---|
| 128 | the distribution provided packages unless they do not meet the minimum version |
|---|
| 129 | requirements mentioned above or if they exhibit problems at runtime. |
|---|
| 130 | |
|---|
| 131 | After all the prerequisites are installed, MediaProxy can be installed either |
|---|
| 132 | as a system wide package or in a standalone directory. |
|---|
| 133 | |
|---|
| 134 | 1. To install it as a system wide package, run (as root): |
|---|
| 135 | |
|---|
| 136 | ./setup.py build |
|---|
| 137 | ./setup.py install |
|---|
| 138 | |
|---|
| 139 | in the directory where you unpacked MediaProxy. |
|---|
| 140 | |
|---|
| 141 | 2. To install in a standalone directory, unpack MediaProxy to the directory |
|---|
| 142 | where you want it placed. Then change to that directory and run: |
|---|
| 143 | |
|---|
| 144 | ./build_inplace |
|---|
| 145 | |
|---|
| 146 | After this MediaProxy components can be run from that directory. |
|---|
| 147 | |
|---|
| 148 | In both cases, you can use the Debian startup scripts in the Debian |
|---|
| 149 | subdirectory, mediaproxy-dispatcher.init and mediaproxy-relay.init as |
|---|
| 150 | examples to create your own startup scripts for your distribution. |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | Packaging |
|---|
| 154 | --------- |
|---|
| 155 | |
|---|
| 156 | The MediaProxy source already includes the necessary files to build Debian |
|---|
| 157 | packages. They should probably also work without changes for Ubuntu, though |
|---|
| 158 | they have not been tested with it. |
|---|
| 159 | |
|---|
| 160 | To build Debian/Ubuntu packages, you can do the following (this is known to |
|---|
| 161 | work with Debian testing and unstable and should work without changes in |
|---|
| 162 | Ubuntu 8.04 Hardy as well, though they were not tested there): |
|---|
| 163 | |
|---|
| 164 | apt-get update |
|---|
| 165 | apt-get install devscripts cdbs debhelper python-all-dev python-support \ |
|---|
| 166 | libnetfilter-conntrack-dev python-application python-cjson \ |
|---|
| 167 | python-gnutls python-twisted-core python-twisted-names \ |
|---|
| 168 | python-zopeinterface python-pyrad python-sqlobject |
|---|
| 169 | |
|---|
| 170 | then unpack MediaProxy and in the directory where it was unpacked run: |
|---|
| 171 | |
|---|
| 172 | debuild |
|---|
| 173 | |
|---|
| 174 | You can safely ignore the pgp signing error at the end of the build process, |
|---|
| 175 | that is only because you do not have the pgp key for the person who is listed |
|---|
| 176 | as maintainer for the package. The packages are build fine even if they are |
|---|
| 177 | not signed. |
|---|
| 178 | |
|---|
| 179 | After building them, you can find the .deb packages in the parent directory, |
|---|
| 180 | from where you can install them using dpkg: |
|---|
| 181 | |
|---|
| 182 | cd ../ |
|---|
| 183 | dpkg -i mediaproxy-*.deb |
|---|
| 184 | |
|---|
| 185 | or you can install just the ones you need on that particular system. |
|---|
| 186 | Please note that mediaproxy-dispatcher and mediaproxy-relay both depend on |
|---|
| 187 | mediaproxy-common so you have to install it too along with either of them. |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | Configuration file |
|---|
| 191 | ------------------ |
|---|
| 192 | |
|---|
| 193 | The configuration file is named config.ini and a config.ini.sample file is |
|---|
| 194 | provided in the source. You can copy config.ini.sample to config.ini and |
|---|
| 195 | modify it to suit your needs. The sample configuration file is commented and |
|---|
| 196 | self-explanatory. Both the dispatcher and the relay read their configuration |
|---|
| 197 | from the same file but from different sections. If either of them is not |
|---|
| 198 | installed on a given system, its specific sections are ignored, so you only |
|---|
| 199 | need to configure the sections for the installed component(s). |
|---|
| 200 | |
|---|
| 201 | MediaProxy will look for both a local configuration file, which is placed in |
|---|
| 202 | the same directory as the media-relay and media-dispather scripts, and a |
|---|
| 203 | system configuration file which is placed in /etc/mediaproxy/ |
|---|
| 204 | |
|---|
| 205 | Even though a local configuration file can be used in any case, it only makes |
|---|
| 206 | sense to be used in the standalone installation case, where MediaProxy lives |
|---|
| 207 | in its own directory and there is a reason to contain all the MediaProxy |
|---|
| 208 | related files to a single directory. |
|---|
| 209 | |
|---|
| 210 | For system wide installations, where the media-relay and media-dispatcher |
|---|
| 211 | scripts reside in /usr/bin or /usr/local/bin, it makes little sense to |
|---|
| 212 | place a local configuration file there, so in this case using the system |
|---|
| 213 | configuration file in /etc/mediaproxy/config.ini is recommended. |
|---|
| 214 | |
|---|
| 215 | When both configuration files are present, both will be read and the settings |
|---|
| 216 | in the local configuration will override the ones in the system configuration. |
|---|