[mod_python] mod_python on FreeBSD 6.1 gives Syntax error - mod_python.so: unsupported file layout

Jeff Hinrichs - DM&T jeffh at dundeemt.com
Sun Jul 1 09:18:06 EDT 2007


On 6/30/07, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
> Usually these problems are caused through using the mod_python.so with
> a version of Apache which is different to the version of Apache that
> mod_python was compiled against. This can especially occur where you
> have a standard OS installation of Apache but you try and use an
> alternate version under /usr/local/ or elsewhere.
>
> What options did you use with 'configure' when you ran it? Did the
> compile line correctly pick up includes and libraries from the version
> under /usr/local?
>
> Graham
>
> On 01/07/07, Anthony Raj <anthony_raj at persistent.co.in> wrote:
> > Hi Folks,
> >
> > Have come to the community with a new issue with regard to installing mod_python on FreeBSD.
> >
> > Eariler had installed apache/mod_python on
> > Suse 10 / 64 Arch.
> > - Apache 2.2.4
> > - mod_python 3.3.1
> > - apr 1.2.8
> > - apr-util 1.2.8
> >
> > problems -
> > The issue with mod_python being installed in to locations.
> > Managed to get it working on this setup sucessfully.
> > ---
> >
> > Now I've installed the same configuration on
> > Free BSD 6.1 32 Arch.
> > >>>>
> > FreeBSD perputo3.inetu.net 6.1-RELEASE-p3 FreeBSD 6.1-RELEASE-p3 #107: Mon Nov  6 20:31:10 EST 2006     root at turnip.inetu.org:/usr/obj/usr/src/sys/INU6  i386
> > >>>>
> >
> > Installation was completed successfully for all the above modules.
> >
> > But after adding the required configuration line -
> > >>>
> > LoadModule python_module modules/mod_python.so
> > >>>
> >
> > And restarting apache , it throws the following error
> > >>>>
> > /usr/local/apache-ast>./bin/apachectl start
> > httpd: Syntax error on line 54 of /usr/local/apache-ast/conf/httpd.conf: Cannot load /usr/local/apache-ast/modules/mod_python.so into server: /usr/local/apache-ast/modules/mod_python.so: unsupported file layout
> >
> > >>>>
> >
> > The required mod_python.so appears to be installed in
> > /usr/local/apache-ast/modules directory.
> >
> > >>>>
> > /usr/local/apache-ast>ls -l modules/
> > total 1738
> > -rw-r--r--  1 root  wheel     8951 Jun 29 10:19 httpd.exp
> > -rwxr-xr-x  1 root  wheel  1739997 Jun 29 10:50 mod_python.so
> >
> > >>>>
> >
> > Have also added the following lines in the config file -
> > >>>>
> > <Directory "/usr/local/apache-ast/htdocs">
> >       AddHandler mod_python .py
> >       PythonHandler mod_python.publisher
> >       PythonDebug On
> > </Directory>
> >
> > >>>>
> >
> > Any one knows if there is any bug with mod_python installation on FreeBSD 6.1. Please let me know in case you there is anything that is missing in the install steps.
> >

Have you installed apache, python and mod_python ALL from ports?  If
not, make uninstall the lot and then install it via ports.  I've got
mod_python installed on FreeBSD 5.x -> 6.2 all with out issue and
without any fiddling.  Just install apache2 and python from ports,
then build mod_python from ports.  If you installed apache2 from a
tar-ball then that is most likely the source of your problems.

-Jeff


More information about the Mod_python mailing list