I've compiled python 2.7.8 with:
mkdir -p /usr/local/python2p7/lib
./configure --prefix=/usr/local/python2p7 --with-threads --enable-shared LDFLAGS="-Wl,-rpath /usr/local/python2p7/lib"
make
make install altinstall
I'm using the LDFLAGS so this install doesn't conflict with CentOS 7 built in python 2.7.5.
I compile modwsgi 4.2.6:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/python2p7/bin/python LDFLAGS="-L/usr/local/python2p7/lib"
make
make install
If I run:
ldd /usr/local/apache/modules/mod_wsgi.so
I get
...
libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f648d9a0000)
...
How do I get mod wsgi to use /usr/local/python2p7/lib/libpython2.7.so.1.0?
*******Solution*******
With the help of Graham Dumpleton:
To compile modwsgi:
export LD_RUN_PATH=/usr/local/python2p7/lib
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/python2p7/bin/python
make
make install
unset LD_RUN_PATH
In apache config set
WSGIPythonHome /usr/local/python2p7
I initial set it to "/usr/local/python2p7/bin" and got the "ImportError: No module named site" error.