Difference between revisions of "MediaGoblin"
| (46 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | This wiki page details the installation of [http://mediagoblin.org/ MediaGoblin] on an Ubuntu 12.04 server. | + | This wiki page details the installation of [http://mediagoblin.org/ MediaGoblin] on an [http://www.ubuntu.com Ubuntu] 12.04 server. |
| − | This basic installation method is suitable for small deployments. | + | This basic installation method is suitable for [http://mediagoblin.readthedocs.org/en/latest/siteadmin/production-deployments.html small deployments]. |
===Install an Ubuntu 12.04 Server=== | ===Install an Ubuntu 12.04 Server=== | ||
| − | Install a normal 12.04 LTS 64 bit server. During the installation when prompted select to install the OpenSSH server | + | Install a normal [http://ubuntu.sun.ac.za/wiki/index.php/Enterprise_Server_Management/12.04 Ubuntu 12.04 LTS 64 bit server]. During the installation when prompted select to install the OpenSSH server |
Make sure that you prepare enough disk space for all the media you will be hosting. | Make sure that you prepare enough disk space for all the media you will be hosting. | ||
| − | Also prepare for a hostname/domainname/URL to use | + | Also prepare for a hostname/domainname/URL to use. |
Also ensure the server has access to the [http://ubuntu.sun.ac.za/wiki/index.php/Internet/Pynetkey internet] in order to be able download software during the installation. | Also ensure the server has access to the [http://ubuntu.sun.ac.za/wiki/index.php/Internet/Pynetkey internet] in order to be able download software during the installation. | ||
| Line 16: | Line 16: | ||
===Step 1 - Pre-requisites=== | ===Step 1 - Pre-requisites=== | ||
*Build dependencies | *Build dependencies | ||
| − | apt-get install git-core python python-dev python-lxml python-imaging python-virtualenv | + | apt-get install mc git-core python python-dev python-lxml python-imaging python-virtualenv |
*Web server dependencies | *Web server dependencies | ||
apt-get install apache2-mpm-worker libapache2-mod-fastcgi apache2-suexec | apt-get install apache2-mpm-worker libapache2-mod-fastcgi apache2-suexec | ||
| − | a2enmod | + | *Enable web server modules |
| + | a2enmod fastcgi rewrite suexec | ||
*Mail server dependencies | *Mail server dependencies | ||
apt-get install postfix mailutils | apt-get install postfix mailutils | ||
| − | ''Setup postfix as a smarthost relay and use your institutional outgoing email server as the smarthost relay.'' | + | ''Setup postfix as a smarthost relay and use your institutional outgoing email server (mail.sun.ac.za) as the smarthost relay.'' |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
===Step 2 - Install MediaGoblin=== | ===Step 2 - Install MediaGoblin=== | ||
| Line 51: | Line 45: | ||
nano mediagoblin_local.ini | nano mediagoblin_local.ini | ||
Under '''<tt>[mediagoblin]</tt>''' | Under '''<tt>[mediagoblin]</tt>''' | ||
| − | |||
#''Set '''email_sender_address''' to the address you wish to be used as the sender for system-generated emails'' | #''Set '''email_sender_address''' to the address you wish to be used as the sender for system-generated emails'' | ||
#''Set '''email_debug_mode = false''' | #''Set '''email_debug_mode = false''' | ||
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
Save the file and exit. | Save the file and exit. | ||
| Line 68: | Line 57: | ||
<pre> | <pre> | ||
<VirtualHost *:80> | <VirtualHost *:80> | ||
| − | ServerName | + | ServerName xxxx.com |
| − | ServerAdmin | + | ServerAdmin xxxx@yyyy |
DocumentRoot /var/www/ | DocumentRoot /var/www/ | ||
| − | # Serve files via alias | + | # Serve static and media files via alias |
| − | Alias / | + | Alias /mgoblin_static/ /opt/mediagoblin/mediagoblin/static/ |
| − | Alias / | + | Alias /mgoblin_media/ /opt/mediagoblin/mediagoblin/user_dev/media/public/ |
| − | # Rewrite all URLs to fcgi, except for media | + | # Rewrite all URLs to fcgi, except for static and media urls |
RewriteEngine On | RewriteEngine On | ||
| − | RewriteRule ^( | + | RewriteRule ^(mgoblin_static|mgoblin_media)($|/) - [L] |
RewriteCond %{REQUEST_FILENAME} !-f | RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteRule ^/(.*)$ /mg.fcgi/$1 [QSA,L] | RewriteRule ^/(.*)$ /mg.fcgi/$1 [QSA,L] | ||
| − | # Allow access to media | + | # Allow access to static and media directories |
| − | <Directory / | + | <Directory /opt/mediagoblin/mediagoblin/static> |
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
</Directory> | </Directory> | ||
| − | + | <Directory /opt/mediagoblin/mediagoblin/user_dev/media/public> | |
| − | <Directory /opt/mediagoblin/ | ||
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
| Line 109: | Line 97: | ||
Type the following to test: | Type the following to test: | ||
cd /opt/mediagoblin/ | cd /opt/mediagoblin/ | ||
| − | ./ | + | ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 |
Press '''<tt>CTL+c</tt>''' to end the process. | Press '''<tt>CTL+c</tt>''' to end the process. | ||
If it works then add the following to the '''/etc/rc.local''' file using the "nano" editor: | If it works then add the following to the '''/etc/rc.local''' file using the "nano" editor: | ||
cd /opt/mediagoblin/ | cd /opt/mediagoblin/ | ||
| − | ./ | + | ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 |
See example below. | See example below. | ||
<pre> | <pre> | ||
| Line 132: | Line 120: | ||
cd /opt/mediagoblin | cd /opt/mediagoblin | ||
| − | ./ | + | ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 |
exit 0 | exit 0 | ||
| Line 138: | Line 126: | ||
===Last Step=== | ===Last Step=== | ||
| + | Setup for production by putting Celery into asynchronous mode. | ||
| + | http://mediagoblin.readthedocs.org/en/latest/siteadmin/production-deployments.html | ||
Reboot the server. | Reboot the server. | ||
reboot | reboot | ||
| − | + | ||
| − | |||
===Enable Media Types=== | ===Enable Media Types=== | ||
The default installation above only allows viewing of image files. | The default installation above only allows viewing of image files. | ||
| Line 152: | Line 141: | ||
<nowiki> | <nowiki> | ||
| − | + | [[mediagoblin.media_types.video]] | |
| − | + | [[mediagoblin.media_types.audio]] | |
| − | + | [[mediagoblin.media_types.pdf]] | |
| − | + | [[mediagoblin.media_types.raw_image]] | |
| − | + | [[mediagoblin.media_types.ascii]] | |
| − | + | [[mediagoblin.media_types.stl]]</nowiki> | |
Save the file. | Save the file. | ||
Install dependant open source software. | Install dependant open source software. | ||
| − | apt-get install poppler-utils unoconv python-pyexiv2 libsndfile1-dev python-gst0.10 python-numpy python-scipy | + | apt-get install poppler-utils unoconv python-pyexiv2 libsndfile1-dev libasound2-dev python-gst0.10 python-numpy python-scipy |
| − | apt-get install gstreamer0.10-plugins-{base,bad,good,ugly} gstreamer0.10-ffmpeg blender | + | apt-get install gstreamer0.10-plugins-{base,bad,good,ugly} gstreamer0.10-ffmpeg blender ubuntu-restricted-extras |
Install dependant python software. | Install dependant python software. | ||
cd /opt/mediagoblin | cd /opt/mediagoblin | ||
| Line 174: | Line 163: | ||
cd /opt/mediagoblin | cd /opt/mediagoblin | ||
./bin/gmg dbupdate | ./bin/gmg dbupdate | ||
| − | If there are no errors | + | Run tests. |
| + | cd /opt/mediagoblin | ||
| + | ./runtests.sh | ||
| + | |||
| + | If there are no errors then reboot. | ||
===References=== | ===References=== | ||
| Line 180: | Line 173: | ||
*http://mediagoblin.readthedocs.org/en/latest/siteadmin/deploying.html | *http://mediagoblin.readthedocs.org/en/latest/siteadmin/deploying.html | ||
*http://mediagoblin.readthedocs.org/en/latest/siteadmin/plugins.html | *http://mediagoblin.readthedocs.org/en/latest/siteadmin/plugins.html | ||
| + | *http://mediagoblin.readthedocs.org/en/latest/siteadmin/theming.html | ||
*https://wiki.mediagoblin.org/Available_Plugins | *https://wiki.mediagoblin.org/Available_Plugins | ||
*http://mediagoblin.readthedocs.org/en/latest/siteadmin/media-types.html | *http://mediagoblin.readthedocs.org/en/latest/siteadmin/media-types.html | ||
*https://gitorious.org/mediagoblin | *https://gitorious.org/mediagoblin | ||
Latest revision as of 12:05, 6 September 2014
This wiki page details the installation of MediaGoblin on an Ubuntu 12.04 server.
This basic installation method is suitable for small deployments.
Contents
Install an Ubuntu 12.04 Server
Install a normal Ubuntu 12.04 LTS 64 bit server. During the installation when prompted select to install the OpenSSH server
Make sure that you prepare enough disk space for all the media you will be hosting.
Also prepare for a hostname/domainname/URL to use.
Also ensure the server has access to the internet in order to be able download software during the installation.
After the Ubuntu server is installed, remotely login using SSH and become the root user, using the "sudo" method by typing sudo -i after logging in..
Step 1 - Pre-requisites
- Build dependencies
apt-get install mc git-core python python-dev python-lxml python-imaging python-virtualenv
- Web server dependencies
apt-get install apache2-mpm-worker libapache2-mod-fastcgi apache2-suexec
- Enable web server modules
a2enmod fastcgi rewrite suexec
- Mail server dependencies
apt-get install postfix mailutils
Setup postfix as a smarthost relay and use your institutional outgoing email server (mail.sun.ac.za) as the smarthost relay.
Step 2 - Install MediaGoblin
- Type the following:
cd /opt git clone git://gitorious.org/mediagoblin/mediagoblin.git cd mediagoblin git submodule init && git submodule update
- And set up the in-package virtualenv:
cd /opt/mediagoblin (virtualenv --python=python2 --system-site-packages . || virtualenv --python=python22 .) && ./bin/python setup.py develop
- Assuming you are going to deploy with FastCGI, you should also install flup:
cd /opt/mediagoblin ./bin/easy_install flup
Step 3 - Deploy MediaGoblin
- Create local config file:
cd /opt/mediagoblin cp mediagoblin.ini mediagoblin_local.ini
- Set mediagoblin operating parameters.
nano mediagoblin_local.ini
Under [mediagoblin]
- Set email_sender_address to the address you wish to be used as the sender for system-generated emails
- Set email_debug_mode = false
Save the file and exit.
- Setup web server default host:
cd /etc/apache2/sites-available rm default nano default
Copy and paste the following into the editor:
<VirtualHost *:80>
ServerName xxxx.com
ServerAdmin xxxx@yyyy
DocumentRoot /var/www/
# Serve static and media files via alias
Alias /mgoblin_static/ /opt/mediagoblin/mediagoblin/static/
Alias /mgoblin_media/ /opt/mediagoblin/mediagoblin/user_dev/media/public/
# Rewrite all URLs to fcgi, except for static and media urls
RewriteEngine On
RewriteRule ^(mgoblin_static|mgoblin_media)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /mg.fcgi/$1 [QSA,L]
# Allow access to static and media directories
<Directory /opt/mediagoblin/mediagoblin/static>
Order allow,deny
Allow from all
</Directory>
<Directory /opt/mediagoblin/mediagoblin/user_dev/media/public>
Order allow,deny
Allow from all
</Directory>
# Connect to fcgi server
FastCGIExternalServer /var/www/mg.fcgi -host 127.0.0.1:26543
</VirtualHost>
Save and exit the file.
- Populate the DB:
cd /opt/mediagoblin ./bin/gmg dbupdate
- Restart the web server.
service apache2 restart
Step 4 - Launch the media service
Type the following to test:
cd /opt/mediagoblin/ ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
Press CTL+c to end the process.
If it works then add the following to the /etc/rc.local file using the "nano" editor:
cd /opt/mediagoblin/ ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
See example below.
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. cd /opt/mediagoblin ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 exit 0
Last Step
Setup for production by putting Celery into asynchronous mode.
http://mediagoblin.readthedocs.org/en/latest/siteadmin/production-deployments.html
Reboot the server.
reboot
Enable Media Types
The default installation above only allows viewing of image files.
To enable an additional media type, add the the media type under the [plugins] section of your /opt/mediagoblin/mediagoblin_local.ini file.
Type the following as the root user.
nano /opt/mediagoblin/mediagoblin_local.ini
Copy and paste the following into the file underneath the [plugins] section.
[[mediagoblin.media_types.video]] [[mediagoblin.media_types.audio]] [[mediagoblin.media_types.pdf]] [[mediagoblin.media_types.raw_image]] [[mediagoblin.media_types.ascii]] [[mediagoblin.media_types.stl]]
Save the file.
Install dependant open source software.
apt-get install poppler-utils unoconv python-pyexiv2 libsndfile1-dev libasound2-dev python-gst0.10 python-numpy python-scipy
apt-get install gstreamer0.10-plugins-{base,bad,good,ugly} gstreamer0.10-ffmpeg blender ubuntu-restricted-extras
Install dependant python software.
cd /opt/mediagoblin ./bin/pip install scikits.audiolab ./bin/easy_install chardet
Install pdf.js dependencies
cd /opt/mediagoblin git submodule init git submodule update
Update the database.
cd /opt/mediagoblin ./bin/gmg dbupdate
Run tests.
cd /opt/mediagoblin ./runtests.sh
If there are no errors then reboot.
References
- http://mediagoblin.readthedocs.org/en/latest/index.html
- http://mediagoblin.readthedocs.org/en/latest/siteadmin/deploying.html
- http://mediagoblin.readthedocs.org/en/latest/siteadmin/plugins.html
- http://mediagoblin.readthedocs.org/en/latest/siteadmin/theming.html
- https://wiki.mediagoblin.org/Available_Plugins
- http://mediagoblin.readthedocs.org/en/latest/siteadmin/media-types.html
- https://gitorious.org/mediagoblin