Installing Mediagoblin on Webfaction

in Tools & Tips

Mediagoblin image courtesy of mediagoblin.org

This is a repost of my answer on the Webfaction Community forum about installing Mediagoblin on their servers. For those of you unfamiliar with Mediagoblin – they’re building an open source, “decentralized” version of Flickr/deviantART.

The main guide to follow is the official one for Deploying Mediagoblin.

The first thing you’ll notice is that Mediagoblin no longer requires MongoDB, so only one Custom app (listening on port) is necessary. Do link it to a website though, since you’ll need that later.

Next we need to install the required dependencies. Follow timg‘s instructions above:

cd ~/webapps/mediagoblin

Where mediagoblin is whatever you’ve named the new application. Then:

easy_install-2.7 lxml  
easy_install-2.7 virtualenv  
easy_install-2.7 flup

Then copy mediagoblin over:

git clone git://gitorious.org/mediagoblin/mediagoblin.git ./

Set up the virtual environment:

cd mediagoblin
(virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py develop

Then copy over the config files:

cp paste.ini paste_local.ini
cp mediagoblin.ini mediagoblin_local.ini

Edit paste.local.ini:

[server:main]
port = <YOUR MEDIAGOBLIN PORT>

Now a mediagoblin instance should load up at the URL of the website that you’ve linked the application to when you run:

CELERY_ALWAYS_EAGER=true ./bin/paster serve paste_local.ini --reload

But you’ll realize that you can’t test it without creating a user account, and you can’t verify an account with proper SMTP functionality.

At this point, we’ve moved into Configuring Mediagoblin. In addition to switching on email there, we also need to make some Webfaction-specific SMTP settings in mediagoblin.local.ini:

[mediagoblin]
email_smtp_use_ssl = true
email_sender_address = 'youremail@yourdomain.com'
email_smtp_host = 'smtp.webfaction.com'
email_smtp_port = 465
email_smtp_user = 'webfaction_mailbox_name'
email_smtp_pass = 'password_for_that_mailbox'

And lastly, to keep the process running in the background even after disconnecting from SSH, I use screen. So the launch command becomes:

CELERY_ALWAYS_EAGER=true screen ./bin/paster serve paste_local.ini --reload

To stop the process, find the processes that use screen (screen -ls) and find the number of the mediagoblin process. Then use to kill:

screen -X -S processnumber kill

That’s it!

Notes on my setup so far:

  • Although Webfaction has PostgreSQL support but I haven’t figured out how to connect it since the Mediagoblin recommended install (i.e. the one with instructions) requires setting up a separate SSH account and all sorts of stuff I don’t have root access on.
  • Mediagoblin recommends nginx, but as far as I can tell Webfaction already has that running behind the scenes already (see this answer.) If you want to know how to set up your own nginx, try here.

By Jason Li

Share this post on

comments powered by Disqus