[mod_python] Compiling and installing mod_python-2.7.3

Brendan Paull paullb at bigfoot.com
Thu May 31 21:23:50 EST 2001

	I am having a little trouble getting my mod_python to work.

This is the error I get:
[root at BCMP mod_python-2.7.3]# httpd
Syntax error on line 208 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/mod_python.so into server: undefined symbol: 
[root at BCMP mod_python-2.7.3]#

These are the lines that I added to /etc/httpd/conf/httpd.conf:
208->  LoadModule python_module      /usr/lib/apache/mod_python.so #first 
one in the list
272->AddModule mod_python.c

<Directory /var/www/html/python>
   AddHandler python-program .py
   PythonHandler mptest
   PythonDebug On

I have included a transcipt of everything that happens as I try to install 
at the end of the message, my system is a RedHat 7.0 and I have apache 1.3 
installed and python 2.1 which works from command line.

I would really appreciate any advice or tips at all.

[root at BCMP mod_python-2.7.3]# ./configure
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for ranlib... (cached) ranlib
checking for ar... (cached) ar
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether make sets ${MAKE}... (cached) no
checking for main in -lm... (cached) yes
checking for working const... (cached) yes
checking your blood pressure... a bit high, but we can proceed
checking whether apxs is available
checking for --with-apxs... no
checking for apxs in /usr/local/apache/sbin... no
checking for apxs in your PATH... checking for apxs... (cached) /usr/sbin/apxs
found /usr/sbin/apxs, we'll use this. Use --with-apxs to specify another.
checking for Apache libexec directory... /usr/lib/apache
checking for Apache include directory... -I/usr/include/apache
checking for --with-apache... no
configure: warning: **** No apache sources specified, static compilation 
will not be available.
configure: warning: **** You can use --with-apache to specify where your 
Apache sources are.
checking for --with-python... no
checking for python... (cached) /usr/bin/python
checking Python version... 2.1
checking whether Python is compiled with thread support... yes

   ****** WARNING ******
   Python is compiled with thread support. Apache 1.3 does not use threads.
   On some systems this will cause problems during compilation, on others
   it may result in unpredictable behaviour of your Apache server. Yet on
   others it will work just fine. The recommended approach is to compile
   Python without thread support in a separate location and specify it with
   --with-python option to this ./configure script.

checking Python install prefix... /usr
checking what libraries Python was linked with... 
checking linker flags used to link Python...
checking where Python include files are... -I/usr/include/python2.1
checking for mkdep... (cached) /usr/X11R6/bin/makedepend
creating ./config.status
creating Makefile
creating src/Makefile
creating src/libpython.module
creating Doc/Makefile
analyzing dependencies
[root at BCMP mod_python-2.7.3]# make
make[1]: Entering directory `/root/mod_python-2.7.3/src'
make[1]: Leaving directory `/root/mod_python-2.7.3/src'
[root at BCMP mod_python-2.7.3]# make install
make[1]: Entering directory `/root/mod_python-2.7.3'
make[2]: Entering directory `/root/mod_python-2.7.3/src'
make[2]: Leaving directory `/root/mod_python-2.7.3/src'

Performing DSO installation.

/usr/bin/install -c src/mod_python.so /usr/lib/apache
make[2]: Entering directory `/root/mod_python-2.7.3'
/usr/bin/install -c -d /usr/lib/python2.1/site-packages/mod_python
python /usr/lib/python2.1/compileall.py 
Listing /usr/lib/python2.1/site-packages/mod_python ...
Compiling /usr/lib/python2.1/site-packages/mod_python/__init__.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/apache.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/cgihandler.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/httpdapi.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/publisher.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/util.py ...
Compiling /usr/lib/python2.1/site-packages/mod_python/zhandler.py ...
make[2]: Leaving directory `/root/mod_python-2.7.3'

Now don't forget to edit your main config and add
     LoadModule python_module /usr/lib/apache/mod_python.so
and if your configuration uses ClearModuleList, then also
     AddModule mod_python.c

make[1]: Leaving directory `/root/mod_python-2.7.3'

More information about the Mod_python mailing list