Monday, June 11, 2012

Upgrading Cobbler from 2.0 to 2.2 -- and overcoming WSGI woes

If you've used Cobbler for a while, you'll want to upgrade it.  Naturally!

There's a problem with the upgrade, though:  the 2.0 version seems to use mod_python, and the new one uses mod_wsgi.  No problem, right?  So you install mod_wsgi as part of the process:


# service httpd start
Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/cobbler.conf:
Invalid command 'WSGIScriptAliasMatch', perhaps misspelled or defined by a
module not included in the server configuration
                                                           [FAILED]
So your server won't start.  Yay!

What's really going on is

  1. mod_python and mod_wsgi don't play well together
  2. mod_wsgi is impotent on install and needs activation
  3. mod_python is still the go-to for rendering the configs, which now use syntax it can't handle
The remedy is simple:
  1. remove mod_python.  It can't be used, so let's get it out to avoid dep- and other issues.

    rpm -e mod_python
  2. create a mod_wsgi config

    cat > /etc/httpd/conf.d/05-load-wsgi.conf
    LoadModule wsgi_module modules/mod_wsgi.so
    
    
    
  3. restart httpd

    service httpd restart
And that's it:

Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]

And you're back up and running.

Is it disappointing that it doesn't Just Work?  For sure.  Could you figure it out if you were a mod_python user or an expert, and knew the hell WSGi was?  Maybe.  But I'm not, and I think that as an app user it's not really on me to be an expert.  You may argue how proficient one needs to be to use any device, but I'm thinking it's not ready for prime-time yet.  Boo!

Labels: , , , , , , ,