[mod_python] mod_python install fails

Brian McCann Brian.McCann at viziant.net
Wed Apr 4 10:47:38 EDT 2007


Hi Jorey,
 
These are the versions\locations on our server
[root at sirius1 bin]# /opt/CollabNet_Subversion/bin/httpd -V
Server version: Apache/2.2.3
Server built:   Feb  5 2007 13:01:55
I cp this httpd file to httpd2 and put that file in /etc
this is what I get now whenI run configure, make, make install[root at sirius1 mod_python-3.3.1]# ./configure --with-python=/usr/bin/python2.3 --with-apxs=/usr/sbin/apxs2 --with-flex=/usr/bin/flex
 
and the try to restart apache I get this garbled error
[root at sirius1 bin]# apachectl restart
httpd: Syntax error on line 55 of /etc/opt/CollabNet_Subversion/conf/httpd.conf: API module structure `python_module' in file /usr/lib/apache2/mod_pyt
hon.so is garbled - perhaps this is not an Apache module DSO?
[root at sirius1 bin]#
 
CollabNet did not come with apxs2 so I installe dthe package apache2-devel
 
--Brian
 

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for main in -lm... yes
checking for an ANSI C-conforming const... yes
checking your blood pressure... a bit high, but we can proceed
configure: checking whether apxs is available...
checking for --with-apxs... /usr/sbin/apxs2 executable, good
checking Apache version... 2.2.3
checking for Apache libexec directory... /usr/lib/apache2
checking for Apache include directory... -I/usr/include/apache2
checking for --with-python... /usr/bin/python2.3
checking Python version... 2.3
checking Python install prefix... /usr
checking checking where python libraries are installed... /usr/lib/python2.3
checking for Py_NewInterpreter in -lpython2.3... yes
checking what libraries Python was linked with... -lpython2.3 -lpthread -ldl -lutil -lm
checking linker flags used to link Python...
checking where Python include files are... -I/usr/include/python2.3
checking for --with-python-src... no
checking for --with-mutex-dir... no
Using MUTEX_DIR /tmp
checking for --with-max-locks... no
Using 8 MAX_LOCKS.
checking for --with-flex... /usr/bin/flex
found /usr/bin/flex, we'll use this. Use --with-flex to specify another.
checking flex version... configure: WARNING: Flex version 2.5.4 found.
    Version 2.5.31 or greater is required.  You can generally ignore this
    warning unless you need to regenerate psp_parser.c from psp_parse.l.
    If you do need regenerate psp_parser.c, use --with-flex to specify the
    location of the correct flex version. See the README for more information.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating Doc/Makefile
config.status: creating src/include/mod_python.h
config.status: creating test/Makefile
config.status: creating test/testconf.py
config.status: creating dist/setup.py
config.status: creating dist/Makefile
[root at sirius1 mod_python-3.3.1]# make
make[1]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[1]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[1]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
make[2]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[2]: `psp_parser.c' is up to date.
make[2]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/src'
/usr/bin/python2.3 setup.py build
running build
running build_py
running build_ext
make[1]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
Now su and make install
  (or, if you only want to perform a partial install,
   you can use make install_dso and make install_py_lib)
[root at sirius1 mod_python-3.3.1]# make install
make[1]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1'
make[2]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[2]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[2]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
make[3]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[3]: `psp_parser.c' is up to date.
make[3]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/src'
/usr/bin/python2.3 setup.py build
running build
running build_py
running build_ext
make[2]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
Now su and make install
  (or, if you only want to perform a partial install,
   you can use make install_dso and make install_py_lib)

Performing DSO installation.
/usr/bin/install -c -d /usr/lib/apache2
/usr/bin/install -c src/mod_python.so /usr/lib/apache2
Now don't forget to edit your main config and add
    LoadModule python_module /usr/lib/apache2/mod_python.so
and if your configuration uses ClearModuleList, then also
    AddModule mod_python.c
make[1]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1'
make[1]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1'
cd dist && make install_py_lib
make[2]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
make[3]: Entering directory `/opt/software/TracWeb/mod_python-3.3.1/src'
make[3]: `psp_parser.c' is up to date.
make[3]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/src'
if test -z "" ; then \
        /usr/bin/python2.3 setup.py install --optimize 2 --force ; \
else \
        /usr/bin/python2.3 setup.py install --optimize 2 --force --root  ; \
fi
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-i686-2.3/mod_python/publisher.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/Session.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/_psp.so -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/python22.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/util.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/Cookie.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/__init__.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/apache.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/importer.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/testhandler.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/psp.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/cache.py -> /usr/lib/python2.3/site-packages/mod_python
copying build/lib.linux-i686-2.3/mod_python/cgihandler.py -> /usr/lib/python2.3/site-packages/mod_python
byte-compiling /usr/lib/python2.3/site-packages/mod_python/publisher.py to publisher.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/Session.py to Session.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/python22.py to python22.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/util.py to util.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/Cookie.py to Cookie.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/apache.py to apache.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/importer.py to importer.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/testhandler.py to testhandler.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/psp.py to psp.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/cache.py to cache.pyc
byte-compiling /usr/lib/python2.3/site-packages/mod_python/cgihandler.py to cgihandler.pyc
writing byte-compilation script '/tmp/tmpSyy3RN.py'
/usr/bin/python2.3 -OO /tmp/tmpSyy3RN.py
removing /tmp/tmpSyy3RN.py
make[2]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1/dist'
make[1]: Leaving directory `/opt/software/TracWeb/mod_python-3.3.1'
[root at sirius1 mod_python-3.3.1]#
 
 
Brian McCann
Release Engineer
Viziant Corporation
 
Phone:  (617) 692-2793
Cell:     (508) 212-9193 
 
 brian.mccann at viziant.net
 
 

________________________________

From: Jorey Bump [mailto:list at joreybump.com]
Sent: Wed 4/4/2007 9:28 AM
To: Brian McCann
Cc: mod_python at modpython.org
Subject: Re: [mod_python] mod_python install fails



Brian McCann wrote:
> httpd is located in /opt/CollabNet_Subversion/bin/httpd

Then it seems to be an alternative installation of Apache, and you must
use the full path.

> [root at sirius1 bin]# httpd -V
> Server version: Apache/2.2.3
> Server built:   Feb  5 2007 13:01:55

This is calling whichever httpd is in your path. Run this command instead:

  /opt/CollabNet_Subversion/bin/httpd -V

> [root at sirius1 bin]# apxs2 -q TARGET
> apxs:Error: /usr/sbin/httpd2 not found or not executable.

Once again, you must use the apxs installed by your target Apache
installation. It is probabably this:

  /opt/CollabNet_Subversion/bin/apxs

Confirm this and use:

  --with-apxs=/opt/CollabNet_Subversion/bin/apxs

>  > configure: checking whether apxs is available...
>  > checking for --with-apxs... /usr/sbin/apxs2 executable, good

That looks like the apxs installed by Red Hat.

>  > checking Apache version... apxs:Error: /usr/sbin/httpd2 not found or not
>  > executable.
>  > apxs:Error: /usr/sbin/httpd2 not found or not executable.

It's looking for Red Hat's httpd, not the CollabNet one.

You should also make sure you don't have Red Hat's mod_python installed.
While it's easy to install mod_python to work with any single Apache
installation, it's a bit more work to support multiple installations.

And if you're not going to use Red Hat's Apache, uninstall every bit of
it to get it out of your path (and add /opt/CollabNet_Subversion/bin/ to
your path if you want the convenience).




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070404/0c6a329f/attachment-0001.html


More information about the Mod_python mailing list