<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mediagoblin.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciropom</id>
	<title>GNU MediaGoblin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mediagoblin.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciropom"/>
	<link rel="alternate" type="text/html" href="https://wiki.mediagoblin.org/Special:Contributions/Ciropom"/>
	<updated>2026-04-23T08:05:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.mediagoblin.org/index.php?title=Deployment&amp;diff=1317</id>
		<title>Deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.mediagoblin.org/index.php?title=Deployment&amp;diff=1317"/>
		<updated>2013-06-20T12:19:25Z</updated>

		<summary type="html">&lt;p&gt;Ciropom: /* Lighttpd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page could use a lot of work.  For now, a few smaller deployment tips!&lt;br /&gt;
&lt;br /&gt;
See also: http://docs.mediagoblin.org/deploying.html (some of which may belong here)&lt;br /&gt;
&lt;br /&gt;
= FCGI script =&lt;br /&gt;
&lt;br /&gt;
This works great with the apache FCGID config example in the next section :) in which case you should name it &amp;quot;mg.fcgi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Before use, make sure you replace &#039;/path/to/mediagoblin/bin/python&#039; with a real path on your server, e.g. &#039;/srv/www/myhomepage.com/mediagoblin/bin/python&#039;. Also replace &#039;/path/to/mediagoblin/paste.ini&#039;.&lt;br /&gt;
&lt;br /&gt;
If you encounter problems, try executing executing the script manually, e.g. &amp;lt;pre&amp;gt;./mg.fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/path/to/mediagoblin/bin/python&lt;br /&gt;
&lt;br /&gt;
# Written in 2011 by Christopher Allan Webber&lt;br /&gt;
#&lt;br /&gt;
# To the extent possible under law, the author(s) have dedicated all&lt;br /&gt;
# copyright and related and neighboring rights to this software to the&lt;br /&gt;
# public domain worldwide. This software is distributed without any&lt;br /&gt;
# warranty.&lt;br /&gt;
# &lt;br /&gt;
# You should have received a copy of the CC0 Public Domain Dedication along&lt;br /&gt;
# with this software. If not, see&lt;br /&gt;
# &amp;lt;http://creativecommons.org/publicdomain/zero/1.0/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
from paste.deploy import loadapp&lt;br /&gt;
from flup.server.fcgi import WSGIServer&lt;br /&gt;
&lt;br /&gt;
CONFIG_PATH = &#039;/path/to/mediagoblin/paste.ini&#039;&lt;br /&gt;
&lt;br /&gt;
## Uncomment this to run celery in &amp;quot;always eager&amp;quot; mode... ie, you don&#039;t have&lt;br /&gt;
## to run a separate process, but submissions wait till processing finishes&lt;br /&gt;
# import os&lt;br /&gt;
# os.environ[&#039;CELERY_ALWAYS_EAGER&#039;] = &#039;true&#039;&lt;br /&gt;
&lt;br /&gt;
def launch_fcgi():&lt;br /&gt;
    ccengine_wsgi_app = loadapp(&#039;config:&#039; + CONFIG_PATH)&lt;br /&gt;
    WSGIServer(ccengine_wsgi_app).run()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    launch_fcgi()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache 2 Config with fcgid =&lt;br /&gt;
&lt;br /&gt;
Note that the libapache2-mod-fcgi in Debian is in the main section. libapache2-mod-fcgid can be used, but requires a slightly different configuration.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
  &lt;br /&gt;
    # Accept up to 16MB requests&lt;br /&gt;
    FcgidMaxRequestLen 16777216&lt;br /&gt;
  &lt;br /&gt;
    ServerName mediagoblin.example.org&lt;br /&gt;
  &lt;br /&gt;
    Alias /mgoblin_static/ /path/to/mediagoblin/mediagoblin/static/&lt;br /&gt;
    Alias /mgoblin_media/ /path/to/mediagoblin/user_dev/media/public/&lt;br /&gt;
  &lt;br /&gt;
    ScriptAlias / /path/to/mediagoblin/mg.fcgi/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache Config Example =&lt;br /&gt;
This configuration example uses mod_fastcgi.&lt;br /&gt;
&lt;br /&gt;
To install and enable mod_fastcgi on a Debian/Ubuntu based system:&lt;br /&gt;
&amp;lt;pre&amp;gt;# apt-get install libapache2-mod-suexec libapache2-mod-fastcgi&lt;br /&gt;
# a2enmod suexec&lt;br /&gt;
# a2enmod fastcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
ServerName mediagoblin.yourdomain.tld&lt;br /&gt;
ServerAdmin webmaster@yourdoimain.tld&lt;br /&gt;
DocumentRoot /var/www/&lt;br /&gt;
# Custom log files&lt;br /&gt;
CustomLog /var/log/apache2/mediagobling_access.log combined&lt;br /&gt;
ErrorLog /var/log/apache2/mediagoblin_error.log&lt;br /&gt;
&lt;br /&gt;
# Serve static and media files via alias&lt;br /&gt;
Alias /mgoblin_static/ /path/to/mediagoblin/mediagoblin/static/&lt;br /&gt;
Alias /mgoblin_media/ /path/to/mediagoblin/user_dev/media/public/&lt;br /&gt;
&lt;br /&gt;
# Rewrite all URLs to fcgi, except for static and media urls&lt;br /&gt;
RewriteEngine On&lt;br /&gt;
RewriteRule ^(mgoblin_static|mgoblin_media)($|/) - [L]&lt;br /&gt;
RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;
RewriteRule ^/(.*)$ /mg.fcgi/$1 [QSA,L]&lt;br /&gt;
&lt;br /&gt;
# Allow access to static and media directories&lt;br /&gt;
&amp;lt;Directory /path/to/mediagoblin/mediagoblin/static&amp;gt;&lt;br /&gt;
  Order allow,deny&lt;br /&gt;
  Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;Directory /path/to/mediagoblin/mediagoblin/user_dev/media/public&amp;gt;&lt;br /&gt;
  Order allow,deny&lt;br /&gt;
  Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Connect to fcgi server&lt;br /&gt;
FastCGIExternalServer /var/www/mg.fcgi -host 127.0.0.1:26543&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, you need to make sure mediagoblin is running in fcgi mode:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/mediagoblin&lt;br /&gt;
./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: there may be several ways to improve this configuration&lt;br /&gt;
&lt;br /&gt;
If it is too slow and you use the deflate module, you could try to use the following option : SetOutputFilter INFLATE&lt;br /&gt;
&lt;br /&gt;
= Lighttpd =&lt;br /&gt;
&lt;br /&gt;
This configuration example uses mod_fastcgi.&lt;br /&gt;
Make a symbolic link from &amp;lt;pre&amp;gt;/etc/lighttpd/conf-available/10-fastcgi.conf&amp;lt;/pre&amp;gt; to &amp;lt;pre&amp;gt;/etc/lighttpd/conf-enabled/10-fastcgi.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then edit your /etc/lighttpd/conf-enabled/10-fastcgi.conf file modifying it as below to serve mediagoblin on the /tube/ path of your webserver.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## FastCGI programs have the same functionality as CGI programs,&lt;br /&gt;
## but are considerably faster through lower interpreter startup&lt;br /&gt;
## time and socketed communication&lt;br /&gt;
##&lt;br /&gt;
## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz&lt;br /&gt;
##                http://www.lighttpd.net/documentation/fastcgi.html&lt;br /&gt;
&lt;br /&gt;
server.modules   += ( &amp;quot;mod_fastcgi&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
## Start an FastCGI server for mediagoblin (lazyserver.sh or other deployments scripts should be up and running)&lt;br /&gt;
fastcgi.server = (&lt;br /&gt;
    # url at which the app should be accessible on the server&lt;br /&gt;
      &amp;quot;/tube&amp;quot; =&amp;gt;&lt;br /&gt;
      # mnemonical name of the backend&lt;br /&gt;
      ( &amp;quot;mg-local&amp;quot; =&amp;gt; (&lt;br /&gt;
                &amp;quot;host&amp;quot; =&amp;gt; &amp;quot;127.0.0.1&amp;quot;,&lt;br /&gt;
                &amp;quot;port&amp;quot; =&amp;gt; 6543,&lt;br /&gt;
                &amp;quot;docroot&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/mediagoblin&amp;quot;,&lt;br /&gt;
                &amp;quot;check-local&amp;quot; =&amp;gt; &amp;quot;disable&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open your /etc/lighttpd/lighttpd.conf and add the configuration to serve directly the static/public folders&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias.url += (&lt;br /&gt;
        &amp;quot;/mgoblin_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/mediagoblin/static/&amp;quot;,&lt;br /&gt;
        &amp;quot;/mgoblin_media/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/media/public/&amp;quot;,&lt;br /&gt;
        &amp;quot;/theme_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/theme_static/&amp;quot;,&lt;br /&gt;
        &amp;quot;/plugin_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/plugin_static/&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= OpenShift =&lt;br /&gt;
&lt;br /&gt;
Thers&#039;s a blogpost saying how to [http://www.sud0.com/gnu-media-goblin-on-openshift.html install mediagoblin on openshift].&lt;br /&gt;
&lt;br /&gt;
= Juju =&lt;br /&gt;
&lt;br /&gt;
There is a juju [https://juju.ubuntu.com/Charms charm] available for deploying mediagoblin into EC2 or on your local box.  [https://juju.ubuntu.com/ juju] is available in Ubuntu 11.10 and later, though it is recommended that you pull it from [https://launchpad.net/~juju/+archive/pkgs the juju PPA], which includes backported packages going back to Ubuntu 11.10. To use the juju charm, install juju and configure either the [https://juju.ubuntu.com/docs/provider-configuration-local.html local provider] or one of the cloud API providers, currently the [https://juju.ubuntu.com/docs/provider-configuration-ec2.html EC2 provider] is the best supported and works not only with Amazon Web Services but also OpenStack clouds. There is also a newer native OpenStack API provider which is known to support HP Cloud.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# if you have not bootstrapped&lt;br /&gt;
juju bootstrap&lt;br /&gt;
mkdir ~/charms&lt;br /&gt;
bzr init-repo ~/charms/precise&lt;br /&gt;
bzr branch lp:~clint-fewbar/charms/precise/mediagoblin/trunk ~/charms/precise/mediagoblin&lt;br /&gt;
juju deploy --repository ~/charms local:mediagoblin&lt;br /&gt;
juju expose mediagoblin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the charm is volatile, deploying from trunk, and deploys a single-server version of MediaGoblin only. It will eventually relate to the existing juju charms for other supported data stores to allow one to scale out their MediaGoblin instance.&lt;br /&gt;
&lt;br /&gt;
= Init scripts =&lt;br /&gt;
&lt;br /&gt;
== Debian init scripts ==&lt;br /&gt;
&lt;br /&gt;
Joar has some scripts for running celery and mediagoblin separately that are designed for Debian.&lt;br /&gt;
&lt;br /&gt;
https://github.com/joar/mediagoblin-init-scripts&lt;br /&gt;
&lt;br /&gt;
== Arch Linux init scripts ==&lt;br /&gt;
&lt;br /&gt;
[http://whird.jpope.org/2012/04/14/mediagoblin-archlinux-rcd-scripts Jeremy Pope has written a nice blogpost] on how to add init scripts to deploy MediaGoblin with both the python paste http server and the celery deployments separated.&lt;br /&gt;
&lt;br /&gt;
If you want a simpler setup and don&#039;t want to deploy celery separately, consider either turning CELERY_ALWAYS_EAGER to true in the paste init script described above, or check out [http://chimo.chromic.org/2012/03/01/mediagoblin-init-script-on-archlinux/ Chimo&#039;s guide].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Generic, simple init script ==&lt;br /&gt;
&lt;br /&gt;
This is a super stupidly simple init script that was used for mediagoblin.com... note that this has Celery running in always eager mode.&lt;br /&gt;
&lt;br /&gt;
You will need to adjust the paths appropriately.  This could probably be better written!&lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  &lt;br /&gt;
  ## Stupidly simple mediagoblin init script.&lt;br /&gt;
  # &lt;br /&gt;
  # Written in 2012 by Christopher Allan Webber&lt;br /&gt;
  #&lt;br /&gt;
  # To the extent possible under law, the author(s) have dedicated all&lt;br /&gt;
  # copyright and related and neighboring rights to this software to the&lt;br /&gt;
  # public domain worldwide. This software is distributed without any&lt;br /&gt;
  # warranty.&lt;br /&gt;
  # &lt;br /&gt;
  # You should have received a copy of the CC0 Public Domain Dedication along&lt;br /&gt;
  # with this software. If not, see&lt;br /&gt;
  # &amp;lt;http://creativecommons.org/publicdomain/zero/1.0/&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
  PASTER=/srv/mediagoblin.com/bin/paster&lt;br /&gt;
  PASTE_CONFIG=/srv/mediagoblin.com/paste.ini&lt;br /&gt;
  OPTIONS=&amp;quot;--pid-file=/tmp/mediagoblin.pid \&lt;br /&gt;
   --log-file=/srv/mediagoblin.com/paster.log \&lt;br /&gt;
   --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  CELERY_ALWAYS_EAGER=true su -pc &amp;quot;$PASTER serve $PASTE_CONFIG $1 $OPTIONS&amp;quot; webadmin&lt;br /&gt;
&lt;br /&gt;
= Running on Dreamhost.com =&lt;br /&gt;
&lt;br /&gt;
===Set up your python virtualenv===&lt;br /&gt;
&lt;br /&gt;
dreamhost.com servers come with python 2.4 and 2.5 installed which is too old for mediagoblin. This means you need to compile and install a newer python (don&#039;t worry this is really not difficult on dreamhost servers). In order to be able to install python packages for a local user without touching system files, we need to setup a python &#039;&#039;virtualenv&#039;&#039;. Fortunately, this is not too tricky either. If your server has python 2.6 or 2.7 installed already, you can skip the [[#Install a local python|python installation stuff]] and you&#039;ll only need to [[#Setup virtualenv to install local python packages|install virtualenv]].&lt;br /&gt;
&lt;br /&gt;
====Install a local python====&lt;br /&gt;
# Download the latest python: http://python.org/ftp/python/XXX/Python-XXX.tar.bz2&lt;br /&gt;
# Unpack with &amp;lt;pre&amp;gt;tar xvjf Python-XXX.tar.bz2&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &#039;&#039;cd&#039;&#039; into the directory and compile and install python locally:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;./configure --prefix=$HOME/local&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:This will install python (I used 2.7.3) into /home/&amp;lt;USERNAME&amp;gt;/local/bin/python. You might get warnings about some modules not being able to compile. :It was tcl/tk and bzip2 mainly, but things still worked out overall.&lt;br /&gt;
:&lt;br /&gt;
:You should now be able to invoke &amp;lt;tt&amp;gt;~/local/bin/python&amp;lt;/tt&amp;gt; and fall into a shell of your new python (exit with ctrl-d). Congrats, you have now a new python 2.7 that you can use. However, you will need to be able to install additional packages as a user and this is what virtualenv allows.&lt;br /&gt;
&lt;br /&gt;
====Setup virtualenv to install local python packages====&lt;br /&gt;
# Download the latest virtualenv: http://pypi.python.org/packages/source/v/virtualenv/XXX&lt;br /&gt;
# Install the virtualenv: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;~/local/bin/python ~/virtualenv-1.8/virtualenv.py  $HOME/local/virtenv&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:: You will now have: ~/local/virtenv/bin/python&lt;br /&gt;
# In  ~/.bash_profile add: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;PATH=~/local/virtenv/bin:~/local/bin:${PATH}&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:: so that your local python will be preferred.&lt;br /&gt;
:: Log out, log in again and test python&amp;quot; to see which version will be invoked. It should be the new python. Check &amp;quot;which easy_install&amp;quot; to see if the one in local/virtenv would be executed.&lt;br /&gt;
::  &lt;br /&gt;
:: You have now 1) a local &#039;&#039;python&#039;&#039; installation that you can use, and 2) &#039;&#039;easy_install&#039;&#039; will also work with your local user installation. From now on you can e.g. locally install the nose testing framework (&#039;&#039;easy_install nose&#039;&#039;) and use it (&#039;&#039;python -c &amp;quot;import nose&amp;quot;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
===Install mediagoblin as a site package===&lt;br /&gt;
&lt;br /&gt;
# Check out mediagoblin from git to e.g. ~/mediagoblin&lt;br /&gt;
# Install MediaGoblin and all dependencies for MediaGoblin with easy_install.&lt;br /&gt;
:* In the mediagoblin directory issue:&lt;br /&gt;
:&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;python setup.py&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:* You will also need to: easy_install lxml&lt;br /&gt;
:* Python-image was trickier to install: &amp;lt;pre&amp;gt;easy_install --find-links http://www.pythonware.com/products/pil/ Imaging&amp;lt;/pre&amp;gt;&lt;br /&gt;
::Test by leaving the mediagoblin directory and see if you can import it: &amp;lt;pre&amp;gt;python -c &amp;quot;import mediagoblin&amp;quot;&amp;lt;/pre&amp;gt; looking for error messages.&lt;br /&gt;
&lt;br /&gt;
===Set up an WSGI environment on Dreamhost===&lt;br /&gt;
&lt;br /&gt;
# Enable the mod_passenger setting for ruby/python in the domains web panel&lt;br /&gt;
# &#039;&#039;cd&#039;&#039; into the domain directory (e.g. ~/media.sspaeth.de for me)&lt;br /&gt;
# Copy mediagoblin.ini and paste.ini from the ~/mediagoblin directory here&lt;br /&gt;
# Create passenger_wsgi.py in your domain directory (e.g. ~/media.sspaeth.de for me):&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;import sys, os&lt;br /&gt;
INTERP = &amp;quot;/home/&amp;lt;username&amp;gt;/local/virtenv/bin/python&amp;quot;&lt;br /&gt;
#INTERP is present twice so that the new python interpreter knows the actual executable path&lt;br /&gt;
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)&lt;br /&gt;
&lt;br /&gt;
from paste.deploy import loadapp&lt;br /&gt;
application = loadapp(&#039;config:/home/mediagoblin/media.sspaeth.de/paste.ini&#039;)&lt;br /&gt;
&lt;br /&gt;
#If in case of errors, all you get are mysterious error 500, you can set debug=true in paste.ini to see stack traces&lt;br /&gt;
# Otherwise, add this:&lt;br /&gt;
#from paste.exceptions.errormiddleware import ErrorMiddleware&lt;br /&gt;
#application = ErrorMiddleware(application, debug=True)&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
# Set up the database by issueing: &amp;lt;pre&amp;gt;gmg dbupdate&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (optional but recommended) Serve the static files directly from the webserver.&lt;br /&gt;
:In paste.ini in this section: [composite:routing] comment out the static files:&lt;br /&gt;
   #/mgoblin_static/ = mediagoblin_static&lt;br /&gt;
   #/theme_static/ = theme_static&lt;br /&gt;
:and symlink the mediagobin/mediagoblin/static directoy to public/mgoblin_static&lt;br /&gt;
:           and mediagoblin/mediagoblin/themes to public/theme_static&lt;br /&gt;
:&lt;br /&gt;
:so it is displayed directly. This step might be different depending on your web server configuration. There is no reason that static&lt;br /&gt;
:files need to go through all the python indirection when they can be served directly by nginx/apache/...&lt;br /&gt;
:&lt;br /&gt;
:In case you want to delete your git checkout after the installation (you don&#039;t need it, since you installed the mediagoblin package to ~/local/virtenv/lib/python2.7/mediagoblin... you should do the symlinking from there.&lt;br /&gt;
===Open Issues===&lt;br /&gt;
Please fill in the blanks if you find them out:&lt;br /&gt;
* How to enable logging to a file or standard html logs? Console output just disappears.&lt;br /&gt;
* How to set up things not using sqlite. What&#039;s wrong with mySQL?&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
* First of all: invoke &amp;lt;pre&amp;gt;python passenger_wsgi.py&amp;lt;/pre&amp;gt; directly from the shell. This will tell you if there are import errors etc. If this command exits without any output on the console, you have already achieved a lot.&lt;br /&gt;
* In &#039;&#039;paste.ini&#039;&#039; set debug=true. This will show you python backtraces directly in the web page&lt;br /&gt;
* You will need to configure an smtp user/passwd/server in mediagoblin.ini, so you actually get the account creation token mailed out. Hint, the relevant settings are: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;email_debug_mode = false&lt;br /&gt;
email_sender_address = postmaster@sspaeth.de&lt;br /&gt;
email_smtp_host = SMTP.DOMAIN.TLD&lt;br /&gt;
email_smtp_user = USERNAME&lt;br /&gt;
email_smtp_pass = WEIRDPASSWORD&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* In case you can upload media, but it does not appear. You don&#039;t have the celery server running. Add &amp;lt;pre&amp;gt;CELERY_ALWAYS_EAGER = true&amp;lt;/pre&amp;gt; to the &#039;&#039;[celery]&#039;&#039; section in mediagoblin.ini&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous Hacks=&lt;br /&gt;
==Force translation==&lt;br /&gt;
There might some conditions under which you would prefer that MediaGoblin always return the same translation.  If you are deploying with nginx and fastcgi, you can force MediaGoblin to return a specific translation regardless of browser preferences by passing a specific HTTP_ACCEPT_LANGUAGE fastcgi parameter in your location block. Example last line in location block:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    fastcgi_param HTTP_ACCEPT_LANGUAGE es; #force spanish translation&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ciropom</name></author>
	</entry>
	<entry>
		<id>https://wiki.mediagoblin.org/index.php?title=Deployment&amp;diff=1316</id>
		<title>Deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.mediagoblin.org/index.php?title=Deployment&amp;diff=1316"/>
		<updated>2013-06-20T10:52:07Z</updated>

		<summary type="html">&lt;p&gt;Ciropom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page could use a lot of work.  For now, a few smaller deployment tips!&lt;br /&gt;
&lt;br /&gt;
See also: http://docs.mediagoblin.org/deploying.html (some of which may belong here)&lt;br /&gt;
&lt;br /&gt;
= FCGI script =&lt;br /&gt;
&lt;br /&gt;
This works great with the apache FCGID config example in the next section :) in which case you should name it &amp;quot;mg.fcgi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Before use, make sure you replace &#039;/path/to/mediagoblin/bin/python&#039; with a real path on your server, e.g. &#039;/srv/www/myhomepage.com/mediagoblin/bin/python&#039;. Also replace &#039;/path/to/mediagoblin/paste.ini&#039;.&lt;br /&gt;
&lt;br /&gt;
If you encounter problems, try executing executing the script manually, e.g. &amp;lt;pre&amp;gt;./mg.fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/path/to/mediagoblin/bin/python&lt;br /&gt;
&lt;br /&gt;
# Written in 2011 by Christopher Allan Webber&lt;br /&gt;
#&lt;br /&gt;
# To the extent possible under law, the author(s) have dedicated all&lt;br /&gt;
# copyright and related and neighboring rights to this software to the&lt;br /&gt;
# public domain worldwide. This software is distributed without any&lt;br /&gt;
# warranty.&lt;br /&gt;
# &lt;br /&gt;
# You should have received a copy of the CC0 Public Domain Dedication along&lt;br /&gt;
# with this software. If not, see&lt;br /&gt;
# &amp;lt;http://creativecommons.org/publicdomain/zero/1.0/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
from paste.deploy import loadapp&lt;br /&gt;
from flup.server.fcgi import WSGIServer&lt;br /&gt;
&lt;br /&gt;
CONFIG_PATH = &#039;/path/to/mediagoblin/paste.ini&#039;&lt;br /&gt;
&lt;br /&gt;
## Uncomment this to run celery in &amp;quot;always eager&amp;quot; mode... ie, you don&#039;t have&lt;br /&gt;
## to run a separate process, but submissions wait till processing finishes&lt;br /&gt;
# import os&lt;br /&gt;
# os.environ[&#039;CELERY_ALWAYS_EAGER&#039;] = &#039;true&#039;&lt;br /&gt;
&lt;br /&gt;
def launch_fcgi():&lt;br /&gt;
    ccengine_wsgi_app = loadapp(&#039;config:&#039; + CONFIG_PATH)&lt;br /&gt;
    WSGIServer(ccengine_wsgi_app).run()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    launch_fcgi()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache 2 Config with fcgid =&lt;br /&gt;
&lt;br /&gt;
Note that the libapache2-mod-fcgi in Debian is in the main section. libapache2-mod-fcgid can be used, but requires a slightly different configuration.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
  &lt;br /&gt;
    # Accept up to 16MB requests&lt;br /&gt;
    FcgidMaxRequestLen 16777216&lt;br /&gt;
  &lt;br /&gt;
    ServerName mediagoblin.example.org&lt;br /&gt;
  &lt;br /&gt;
    Alias /mgoblin_static/ /path/to/mediagoblin/mediagoblin/static/&lt;br /&gt;
    Alias /mgoblin_media/ /path/to/mediagoblin/user_dev/media/public/&lt;br /&gt;
  &lt;br /&gt;
    ScriptAlias / /path/to/mediagoblin/mg.fcgi/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache Config Example =&lt;br /&gt;
This configuration example uses mod_fastcgi.&lt;br /&gt;
&lt;br /&gt;
To install and enable mod_fastcgi on a Debian/Ubuntu based system:&lt;br /&gt;
&amp;lt;pre&amp;gt;# apt-get install libapache2-mod-suexec libapache2-mod-fastcgi&lt;br /&gt;
# a2enmod suexec&lt;br /&gt;
# a2enmod fastcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample configuration:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
ServerName mediagoblin.yourdomain.tld&lt;br /&gt;
ServerAdmin webmaster@yourdoimain.tld&lt;br /&gt;
DocumentRoot /var/www/&lt;br /&gt;
# Custom log files&lt;br /&gt;
CustomLog /var/log/apache2/mediagobling_access.log combined&lt;br /&gt;
ErrorLog /var/log/apache2/mediagoblin_error.log&lt;br /&gt;
&lt;br /&gt;
# Serve static and media files via alias&lt;br /&gt;
Alias /mgoblin_static/ /path/to/mediagoblin/mediagoblin/static/&lt;br /&gt;
Alias /mgoblin_media/ /path/to/mediagoblin/user_dev/media/public/&lt;br /&gt;
&lt;br /&gt;
# Rewrite all URLs to fcgi, except for static and media urls&lt;br /&gt;
RewriteEngine On&lt;br /&gt;
RewriteRule ^(mgoblin_static|mgoblin_media)($|/) - [L]&lt;br /&gt;
RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;
RewriteRule ^/(.*)$ /mg.fcgi/$1 [QSA,L]&lt;br /&gt;
&lt;br /&gt;
# Allow access to static and media directories&lt;br /&gt;
&amp;lt;Directory /path/to/mediagoblin/mediagoblin/static&amp;gt;&lt;br /&gt;
  Order allow,deny&lt;br /&gt;
  Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;Directory /path/to/mediagoblin/mediagoblin/user_dev/media/public&amp;gt;&lt;br /&gt;
  Order allow,deny&lt;br /&gt;
  Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Connect to fcgi server&lt;br /&gt;
FastCGIExternalServer /var/www/mg.fcgi -host 127.0.0.1:26543&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, you need to make sure mediagoblin is running in fcgi mode:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/mediagoblin&lt;br /&gt;
./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: there may be several ways to improve this configuration&lt;br /&gt;
&lt;br /&gt;
If it is too slow and you use the deflate module, you could try to use the following option : SetOutputFilter INFLATE&lt;br /&gt;
&lt;br /&gt;
= Lighttpd =&lt;br /&gt;
&lt;br /&gt;
This configuration example uses mod_fastcgi.&lt;br /&gt;
Make a symbolic link from &amp;lt;pre&amp;gt;/etc/lighttpd/conf-available/10-fastcgi.conf&amp;lt;/pre&amp;gt; to &amp;lt;pre&amp;gt;/etc/lighttpd/conf-enabled/10-fastcgi.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then edit your /etc/lighttpd/conf-enabled/10-fastcgi.conf file modifying it as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## FastCGI programs have the same functionality as CGI programs,&lt;br /&gt;
## but are considerably faster through lower interpreter startup&lt;br /&gt;
## time and socketed communication&lt;br /&gt;
##&lt;br /&gt;
## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz&lt;br /&gt;
##                http://www.lighttpd.net/documentation/fastcgi.html&lt;br /&gt;
&lt;br /&gt;
server.modules   += ( &amp;quot;mod_fastcgi&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
## Start an FastCGI server for mediagoblin (lazyserver.sh or other deployments scripts should be up and running)&lt;br /&gt;
fastcgi.server = (&lt;br /&gt;
&amp;quot;/tube&amp;quot; =&amp;gt;&lt;br /&gt;
      ( &amp;quot;mg-local&amp;quot; =&amp;gt; (&lt;br /&gt;
                &amp;quot;host&amp;quot; =&amp;gt; &amp;quot;127.0.0.1&amp;quot;,&lt;br /&gt;
                &amp;quot;port&amp;quot; =&amp;gt; 6543,&lt;br /&gt;
                &amp;quot;docroot&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/mediagoblin&amp;quot;,&lt;br /&gt;
                &amp;quot;check-local&amp;quot; =&amp;gt; &amp;quot;disable&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open your /etc/lighttpd/lighttpd.conf and add the configuration to serve directly the static/public folders&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias.url += (&lt;br /&gt;
        &amp;quot;/mgoblin_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/mediagoblin/static/&amp;quot;,&lt;br /&gt;
        &amp;quot;/mgoblin_media/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/media/public/&amp;quot;,&lt;br /&gt;
        &amp;quot;/theme_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/theme_static/&amp;quot;,&lt;br /&gt;
        &amp;quot;/plugin_static/&amp;quot; =&amp;gt; &amp;quot;/path/to/mediagoblin-git-folder/user_dev/plugin_static/&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= OpenShift =&lt;br /&gt;
&lt;br /&gt;
Thers&#039;s a blogpost saying how to [http://www.sud0.com/gnu-media-goblin-on-openshift.html install mediagoblin on openshift].&lt;br /&gt;
&lt;br /&gt;
= Juju =&lt;br /&gt;
&lt;br /&gt;
There is a juju [https://juju.ubuntu.com/Charms charm] available for deploying mediagoblin into EC2 or on your local box.  [https://juju.ubuntu.com/ juju] is available in Ubuntu 11.10 and later, though it is recommended that you pull it from [https://launchpad.net/~juju/+archive/pkgs the juju PPA], which includes backported packages going back to Ubuntu 11.10. To use the juju charm, install juju and configure either the [https://juju.ubuntu.com/docs/provider-configuration-local.html local provider] or one of the cloud API providers, currently the [https://juju.ubuntu.com/docs/provider-configuration-ec2.html EC2 provider] is the best supported and works not only with Amazon Web Services but also OpenStack clouds. There is also a newer native OpenStack API provider which is known to support HP Cloud.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# if you have not bootstrapped&lt;br /&gt;
juju bootstrap&lt;br /&gt;
mkdir ~/charms&lt;br /&gt;
bzr init-repo ~/charms/precise&lt;br /&gt;
bzr branch lp:~clint-fewbar/charms/precise/mediagoblin/trunk ~/charms/precise/mediagoblin&lt;br /&gt;
juju deploy --repository ~/charms local:mediagoblin&lt;br /&gt;
juju expose mediagoblin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the charm is volatile, deploying from trunk, and deploys a single-server version of MediaGoblin only. It will eventually relate to the existing juju charms for other supported data stores to allow one to scale out their MediaGoblin instance.&lt;br /&gt;
&lt;br /&gt;
= Init scripts =&lt;br /&gt;
&lt;br /&gt;
== Debian init scripts ==&lt;br /&gt;
&lt;br /&gt;
Joar has some scripts for running celery and mediagoblin separately that are designed for Debian.&lt;br /&gt;
&lt;br /&gt;
https://github.com/joar/mediagoblin-init-scripts&lt;br /&gt;
&lt;br /&gt;
== Arch Linux init scripts ==&lt;br /&gt;
&lt;br /&gt;
[http://whird.jpope.org/2012/04/14/mediagoblin-archlinux-rcd-scripts Jeremy Pope has written a nice blogpost] on how to add init scripts to deploy MediaGoblin with both the python paste http server and the celery deployments separated.&lt;br /&gt;
&lt;br /&gt;
If you want a simpler setup and don&#039;t want to deploy celery separately, consider either turning CELERY_ALWAYS_EAGER to true in the paste init script described above, or check out [http://chimo.chromic.org/2012/03/01/mediagoblin-init-script-on-archlinux/ Chimo&#039;s guide].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Generic, simple init script ==&lt;br /&gt;
&lt;br /&gt;
This is a super stupidly simple init script that was used for mediagoblin.com... note that this has Celery running in always eager mode.&lt;br /&gt;
&lt;br /&gt;
You will need to adjust the paths appropriately.  This could probably be better written!&lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  &lt;br /&gt;
  ## Stupidly simple mediagoblin init script.&lt;br /&gt;
  # &lt;br /&gt;
  # Written in 2012 by Christopher Allan Webber&lt;br /&gt;
  #&lt;br /&gt;
  # To the extent possible under law, the author(s) have dedicated all&lt;br /&gt;
  # copyright and related and neighboring rights to this software to the&lt;br /&gt;
  # public domain worldwide. This software is distributed without any&lt;br /&gt;
  # warranty.&lt;br /&gt;
  # &lt;br /&gt;
  # You should have received a copy of the CC0 Public Domain Dedication along&lt;br /&gt;
  # with this software. If not, see&lt;br /&gt;
  # &amp;lt;http://creativecommons.org/publicdomain/zero/1.0/&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
  PASTER=/srv/mediagoblin.com/bin/paster&lt;br /&gt;
  PASTE_CONFIG=/srv/mediagoblin.com/paste.ini&lt;br /&gt;
  OPTIONS=&amp;quot;--pid-file=/tmp/mediagoblin.pid \&lt;br /&gt;
   --log-file=/srv/mediagoblin.com/paster.log \&lt;br /&gt;
   --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  CELERY_ALWAYS_EAGER=true su -pc &amp;quot;$PASTER serve $PASTE_CONFIG $1 $OPTIONS&amp;quot; webadmin&lt;br /&gt;
&lt;br /&gt;
= Running on Dreamhost.com =&lt;br /&gt;
&lt;br /&gt;
===Set up your python virtualenv===&lt;br /&gt;
&lt;br /&gt;
dreamhost.com servers come with python 2.4 and 2.5 installed which is too old for mediagoblin. This means you need to compile and install a newer python (don&#039;t worry this is really not difficult on dreamhost servers). In order to be able to install python packages for a local user without touching system files, we need to setup a python &#039;&#039;virtualenv&#039;&#039;. Fortunately, this is not too tricky either. If your server has python 2.6 or 2.7 installed already, you can skip the [[#Install a local python|python installation stuff]] and you&#039;ll only need to [[#Setup virtualenv to install local python packages|install virtualenv]].&lt;br /&gt;
&lt;br /&gt;
====Install a local python====&lt;br /&gt;
# Download the latest python: http://python.org/ftp/python/XXX/Python-XXX.tar.bz2&lt;br /&gt;
# Unpack with &amp;lt;pre&amp;gt;tar xvjf Python-XXX.tar.bz2&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &#039;&#039;cd&#039;&#039; into the directory and compile and install python locally:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;./configure --prefix=$HOME/local&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:This will install python (I used 2.7.3) into /home/&amp;lt;USERNAME&amp;gt;/local/bin/python. You might get warnings about some modules not being able to compile. :It was tcl/tk and bzip2 mainly, but things still worked out overall.&lt;br /&gt;
:&lt;br /&gt;
:You should now be able to invoke &amp;lt;tt&amp;gt;~/local/bin/python&amp;lt;/tt&amp;gt; and fall into a shell of your new python (exit with ctrl-d). Congrats, you have now a new python 2.7 that you can use. However, you will need to be able to install additional packages as a user and this is what virtualenv allows.&lt;br /&gt;
&lt;br /&gt;
====Setup virtualenv to install local python packages====&lt;br /&gt;
# Download the latest virtualenv: http://pypi.python.org/packages/source/v/virtualenv/XXX&lt;br /&gt;
# Install the virtualenv: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;~/local/bin/python ~/virtualenv-1.8/virtualenv.py  $HOME/local/virtenv&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:: You will now have: ~/local/virtenv/bin/python&lt;br /&gt;
# In  ~/.bash_profile add: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;PATH=~/local/virtenv/bin:~/local/bin:${PATH}&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:: so that your local python will be preferred.&lt;br /&gt;
:: Log out, log in again and test python&amp;quot; to see which version will be invoked. It should be the new python. Check &amp;quot;which easy_install&amp;quot; to see if the one in local/virtenv would be executed.&lt;br /&gt;
::  &lt;br /&gt;
:: You have now 1) a local &#039;&#039;python&#039;&#039; installation that you can use, and 2) &#039;&#039;easy_install&#039;&#039; will also work with your local user installation. From now on you can e.g. locally install the nose testing framework (&#039;&#039;easy_install nose&#039;&#039;) and use it (&#039;&#039;python -c &amp;quot;import nose&amp;quot;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
===Install mediagoblin as a site package===&lt;br /&gt;
&lt;br /&gt;
# Check out mediagoblin from git to e.g. ~/mediagoblin&lt;br /&gt;
# Install MediaGoblin and all dependencies for MediaGoblin with easy_install.&lt;br /&gt;
:* In the mediagoblin directory issue:&lt;br /&gt;
:&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;python setup.py&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:* You will also need to: easy_install lxml&lt;br /&gt;
:* Python-image was trickier to install: &amp;lt;pre&amp;gt;easy_install --find-links http://www.pythonware.com/products/pil/ Imaging&amp;lt;/pre&amp;gt;&lt;br /&gt;
::Test by leaving the mediagoblin directory and see if you can import it: &amp;lt;pre&amp;gt;python -c &amp;quot;import mediagoblin&amp;quot;&amp;lt;/pre&amp;gt; looking for error messages.&lt;br /&gt;
&lt;br /&gt;
===Set up an WSGI environment on Dreamhost===&lt;br /&gt;
&lt;br /&gt;
# Enable the mod_passenger setting for ruby/python in the domains web panel&lt;br /&gt;
# &#039;&#039;cd&#039;&#039; into the domain directory (e.g. ~/media.sspaeth.de for me)&lt;br /&gt;
# Copy mediagoblin.ini and paste.ini from the ~/mediagoblin directory here&lt;br /&gt;
# Create passenger_wsgi.py in your domain directory (e.g. ~/media.sspaeth.de for me):&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;import sys, os&lt;br /&gt;
INTERP = &amp;quot;/home/&amp;lt;username&amp;gt;/local/virtenv/bin/python&amp;quot;&lt;br /&gt;
#INTERP is present twice so that the new python interpreter knows the actual executable path&lt;br /&gt;
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)&lt;br /&gt;
&lt;br /&gt;
from paste.deploy import loadapp&lt;br /&gt;
application = loadapp(&#039;config:/home/mediagoblin/media.sspaeth.de/paste.ini&#039;)&lt;br /&gt;
&lt;br /&gt;
#If in case of errors, all you get are mysterious error 500, you can set debug=true in paste.ini to see stack traces&lt;br /&gt;
# Otherwise, add this:&lt;br /&gt;
#from paste.exceptions.errormiddleware import ErrorMiddleware&lt;br /&gt;
#application = ErrorMiddleware(application, debug=True)&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
# Set up the database by issueing: &amp;lt;pre&amp;gt;gmg dbupdate&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (optional but recommended) Serve the static files directly from the webserver.&lt;br /&gt;
:In paste.ini in this section: [composite:routing] comment out the static files:&lt;br /&gt;
   #/mgoblin_static/ = mediagoblin_static&lt;br /&gt;
   #/theme_static/ = theme_static&lt;br /&gt;
:and symlink the mediagobin/mediagoblin/static directoy to public/mgoblin_static&lt;br /&gt;
:           and mediagoblin/mediagoblin/themes to public/theme_static&lt;br /&gt;
:&lt;br /&gt;
:so it is displayed directly. This step might be different depending on your web server configuration. There is no reason that static&lt;br /&gt;
:files need to go through all the python indirection when they can be served directly by nginx/apache/...&lt;br /&gt;
:&lt;br /&gt;
:In case you want to delete your git checkout after the installation (you don&#039;t need it, since you installed the mediagoblin package to ~/local/virtenv/lib/python2.7/mediagoblin... you should do the symlinking from there.&lt;br /&gt;
===Open Issues===&lt;br /&gt;
Please fill in the blanks if you find them out:&lt;br /&gt;
* How to enable logging to a file or standard html logs? Console output just disappears.&lt;br /&gt;
* How to set up things not using sqlite. What&#039;s wrong with mySQL?&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
* First of all: invoke &amp;lt;pre&amp;gt;python passenger_wsgi.py&amp;lt;/pre&amp;gt; directly from the shell. This will tell you if there are import errors etc. If this command exits without any output on the console, you have already achieved a lot.&lt;br /&gt;
* In &#039;&#039;paste.ini&#039;&#039; set debug=true. This will show you python backtraces directly in the web page&lt;br /&gt;
* You will need to configure an smtp user/passwd/server in mediagoblin.ini, so you actually get the account creation token mailed out. Hint, the relevant settings are: &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;email_debug_mode = false&lt;br /&gt;
email_sender_address = postmaster@sspaeth.de&lt;br /&gt;
email_smtp_host = SMTP.DOMAIN.TLD&lt;br /&gt;
email_smtp_user = USERNAME&lt;br /&gt;
email_smtp_pass = WEIRDPASSWORD&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* In case you can upload media, but it does not appear. You don&#039;t have the celery server running. Add &amp;lt;pre&amp;gt;CELERY_ALWAYS_EAGER = true&amp;lt;/pre&amp;gt; to the &#039;&#039;[celery]&#039;&#039; section in mediagoblin.ini&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous Hacks=&lt;br /&gt;
==Force translation==&lt;br /&gt;
There might some conditions under which you would prefer that MediaGoblin always return the same translation.  If you are deploying with nginx and fastcgi, you can force MediaGoblin to return a specific translation regardless of browser preferences by passing a specific HTTP_ACCEPT_LANGUAGE fastcgi parameter in your location block. Example last line in location block:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    fastcgi_param HTTP_ACCEPT_LANGUAGE es; #force spanish translation&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ciropom</name></author>
	</entry>
</feed>