From Fedora Project Wiki

This is only my notes, not an official and complete guide to run koji. There is no guarantee that you can get any support and further QA from here or me. If you encounter any problems while you are doing this, please research and fix them by yourself first. Certainly, sharing your solutions and ideas will be appreciated.

Based on Red Hat Enterprise Linux 6, Fedora 23 workstation.

Dependencies and environment

# Install all dependency packages

sudo yum install python-cheetah python-setuptools python-krbV PyGreSQL postgresql-server
sudo easy_install virtualenv


virtualenv --system-package-sites $VIRTENV_ROOT/koji
$VIRTENV_ROOT/koji/bin/pip install mod_wsgi

Get the code

git clone ​ $HOME/projects/koji

Run kojihub and kojiweb


. $HOME/virtualenvs/koji/bin/activate

cp $KOJI_DIR/hub/hub.conf $DEVEL_CONF_DIR
cp $KOJI_DIR/www/kojiweb/conf/web.conf $DEVEL_CONF_DIR

Run kojihub

mod_wsgi-express start-server hub/ --host --port 8000 \
    --debug-mode \
    --working-directory $KOJI_DIR/hub/ \
    --python-path $KOJI_DIR \
    --setenv koji.hub.ConfigFile $DEVEL_CONF_DIR/hub.conf

When I came back and tried to run koji again with above original command (without assiging PYTHONPATH), it failed to import koji.server. It looks like --python-path does not work suddenly. So, I added PYTHONPATH and assigned same value to it. Fortunately, it works, and I don't know why --python-path does not work as the description of mod_wsgi-express start-server.

Before running kojiweb, apply this diff

diff --git a/www/lib/kojiweb/ b/www/lib/kojiweb/
index ae00757..e19ab92 100644
--- a/www/lib/kojiweb/
+++ b/www/lib/kojiweb/
@@ -113,7 +113,8 @@ class XHTMLFilter(DecodeUTF8):
 def _genHTML(environ, fileName):
-    reqdir = os.path.dirname(environ['SCRIPT_FILENAME'])
+    reqdir = os.path.dirname(environ.get('koji.web.TemplateDirectory',
+                                         environ['SCRIPT_FILENAME']))
     if os.getcwd() != reqdir:

Run kojiweb

cd $KOJI_DIR/www/kojiweb
mod_wsgi-express start-server --host --port 7000 \
    --debug-mode \
    --working-directory $KOJI_DIR/www/kojiweb/ \
    --python-path $KOJI_DIR \
    --python-path $KOJI_DIR/www/kojiweb \
    --python-path $KOJI_DIR/www/lib/ \
    --url-alias /koji-static $KOJI_DIR/www/static/ \
    --setenv koji.web.ConfigFile $DEVEL_CONF_DIR/web.conf \
    --setenv koji.web.TemplateDirectory $KOJI_DIR/www/kojiweb/