wiki:HowTo Compile mod_wsgi for LAMP servers

Version 1 (modified by Richard Bramley, 9 years ago) ( diff )

--

HowTo Compile mod_wsgi for LAMP servers

Tags: UoL Lamp Server HowTo Python

Why it didn't work how it should

  • mod_wsgi is not in the repositories for SUSE linux, because the hate us. Therefore, you have to compile it yourself.
  • pip doesn't work on the LAMP servers, so you can't use the easy way.
  • Stuff isn't where setup.py expects, and it doesn't adequately allow you to change the places to look, so you can't do it that way either.
  • Also stuff isn't where the make file expects things to be either, so compiling doesn't work properly. But you can tell it where to look.
  • Finally, you aren't allowed to put the compiled file where is should go, so make install doesn't work. But it leaves it lying around, so you can copy it somewhere manually.

Resources

Procedure

  1. Get the latest version of mod_wsgi from https://github.com/GrahamDumpleton/mod_wsgi/releases and unzip it
  2. Set up the configuration:
./configure --with-apxs=/usr/sbin/apxs2-prefork --with-python=/usr/bin/python

Here we have to tell it where to find python and the Apache libraries.

  1. Compile it:
make
  1. Copy the compiled file to somewhere where it can be used by Apache:
cp {mod_wsgi directory}/src/server/.libs/mod_wsgi.so /local/apache2/etc/

Error: Macro BackLinks(None) failed
'Environment' object has no attribute 'get_db_cnx'

Note: See TracWiki for help on using the wiki.