| | 1 | = HowTo Compile mod_wsgi for LAMP servers |
| | 2 | |
| | 3 | Tags: [[UoL Lamp Server]] [[HowTo]] [[Python]] |
| | 4 | |
| | 5 | == Why it didn't work how it should |
| | 6 | |
| | 7 | - `mod_wsgi` is not in the repositories for SUSE linux, because the hate us. Therefore, you have to compile it yourself. |
| | 8 | - `pip` doesn't work on the LAMP servers, so you can't use the easy way. |
| | 9 | - 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. |
| | 10 | - 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. |
| | 11 | - 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. |
| | 12 | |
| | 13 | == Resources |
| | 14 | |
| | 15 | - [[https://github.com/GrahamDumpleton/mod_wsgi]] |
| | 16 | - [[https://code.google.com/p/modwsgi/wiki/InstallationIssues#Missing_Include_Files_On_SUSE]] |
| | 17 | |
| | 18 | == Procedure |
| | 19 | |
| | 20 | 1. Get the latest version of `mod_wsgi` from [[https://github.com/GrahamDumpleton/mod_wsgi/releases]] and unzip it |
| | 21 | 2. Set up the configuration: |
| | 22 | |
| | 23 | {{{ |
| | 24 | ./configure --with-apxs=/usr/sbin/apxs2-prefork --with-python=/usr/bin/python |
| | 25 | }}} |
| | 26 | |
| | 27 | ''Here we have to tell it where to find python and the Apache libraries.'' |
| | 28 | |
| | 29 | 3. Compile it: |
| | 30 | |
| | 31 | {{{ |
| | 32 | make |
| | 33 | }}} |
| | 34 | |
| | 35 | 4. Copy the compiled file to somewhere where it can be used by Apache: |
| | 36 | |
| | 37 | {{{ |
| | 38 | cp {mod_wsgi directory}/src/server/.libs/mod_wsgi.so /local/apache2/etc/ |
| | 39 | }}} |
| | 40 | |
| | 41 | [[BackLinks]] |