Thanks to Graham and Jeff Trawick

Below are the two solution that I have tested and both work fine.
Apache starts fine now and is able to load mod_wsgi.

There is still a problem in start of Django app but I will chase it as
a separate thread.

Solution 1 (Thanks to Graham Dumpleton)
===============================

Don't change anything in Apache Code.

Go into mod_wsgi.c source code and change:

       /*
        * Cleanup the Apache scoreboard to ensure that any
        * shared memory segments or memory mapped files not
        * available to code in daemon processes.
        */

       ap_cleanup_scoreboard(0);

to

#if 0
       /*
        * Cleanup the Apache scoreboard to ensure that any
        * shared memory segments or memory mapped files not
        * available to code in daemon processes.
        */

       ap_cleanup_scoreboard(0);
#endif

and then look for:

#if !defined(AP_ACCEPT_MUTEX_TYPE)
   sconfig->lock_mechanism = ap_accept_lock_mech;
#else
   sconfig->lock_mechanism = APR_LOCK_DEFAULT;
#endif

and change it to:

#define AP_ACCEPT_MUTEX_TYPE 1
#if !defined(AP_ACCEPT_MUTEX_TYPE)
   sconfig->lock_mechanism = ap_accept_lock_mech;
#else
   sconfig->lock_mechanism = APR_LOCK_DEFAULT;
#endif

Then build mod_wsgi

Solution 2 (Thanks to Jeff Trawick from Apache)
===================================

Extract the Source tar ball in a directory.....cd into that directory

Locate the file include/mpm_common.h

Change
        extern apr_lockmech_e ap_accept_lock_mech;
to
        AP_DECLARE_DATA extern apr_lockmech_e ap_accept_lock_mech;


Locate the file include/scoreboard.h

Change
        apr_status_t ap_cleanup_scoreboard(void *d);
to
        AP_DECLARE(apr_status_t) ap_cleanup_scoreboard(void *d);

And then issue the following commands
        ./configure
        make

After this step, there will be a httpd.exp file create in the server
directory and a httpd file created in the present directory

remove httpd

edit server/httpd.exp and add one line for ap_accept_lock_mech

        make
        make install (as root)

Then build mod_wsgi 3.3 from Source Tarball

Regards,
Anurag



On Nov 20, 9:18 am, Graham Dumpleton <[email protected]>
wrote:
> On Saturday, November 20, 2010, Anurag Chourasia
>
> <[email protected]> wrote:
> > Hi Graham,
> > The page 
> > at http://httpd.apache.org/docs/current/programs/apxs.html indicates that
>
> > When using such pre-compiled objects make sure they are compiled for 
> > position independent code (PIC) to be able to use them for a dynamically 
> > loaded shared object. For instance with GCC you always just have to 
> > use -fpic.
>
> If -fpic is required for AIX, which may not be the case as various
> platforms default to generating pic code anyway, then it is up tp
> Apache to ensure that that option is provided by apxs. Setting that
> option is not the job of mod_wsgi makefile.
>
> That said, you can add it in if you want, but don't think it will make
> a difference.
>
> Add the option '-Wc,-fpic' to CFLAGS in the makefile.
>
> > I also noticed that the mod_wsgi.a file get deleted after this process. Is 
> > there a way to statically link mod_wsgi into apache?
>
> No, configure/makefile for mod_wsgi only supports dynamically linked
> Apache module.
>
> Graham
>
>
>
>
>
>
>
> > Please guide.
>
> > Regards,
>
> > Anurag
> > On Sat, Nov 20, 2010 at 1:35 AM, Graham Dumpleton 
> > <[email protected]> wrote:
>
> > So it is cross referenced here, the ServerFault link for this issue is at:
>
> >   http://serverfault.com/questions/204047/aix-missing-symbols-ap-cleanu...
>
> > I still don't really have anything to suggest.
>
> > Seems to be a AIX dynamic symbol linking issue and since I don't
> > really know anything about specifics of AIX, just got no idea where to
> > go.
>
> > Graham
>
> > On Friday, November 19, 2010, Guddu <[email protected]> wrote:
> >> Dear modwsgi Team,
>
> >> I hope you could help me with a mod_wsgi load error upon startup of
> >> apache. This is affecting one of our site Go Live and I would
> >> appreciate any help
>
> >> offered in this regard. I am willing to try out code changes on my
> >> machine and rebuilding and retesting if someone could send me the
> >> changes source files.
>
> >> The error upon startup of Apache is as follows
>
> >> root [zibal]% ./usr/local/apache2/bin/apachectl restart
> >> httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf:
> >> Cannot load /usr/local/apache2/modules/mod_wsgi.so into server: rtld:
> >> 0712-001 Symbol
>
> >> ap_cleanup_scoreboard was referenced\n      from module /usr/local/
> >> apache2/modules/mod_wsgi.so(), but a runtime definition\n      of the
> >> symbol was not
>
> >> found.\nrtld: 0712-001 Symbol ap_accept_lock_mech was referenced
> >> \n      from module /usr/local/apache2/modules/mod_wsgi.so(), but a
> >> runtime definition\n
>
> >>  of the symbol was not found.
>
> >> I built Apaxhe 2.2.17 and Mod_Wsgi 3.3 using the source and the
> >> compiler was gcc-4.2.
>
> >> Here are the AIX Server Details
>
> >> Here is the Apache Build Information
> >> =====================================
>
> >> root [zibal]% ./usr/local/apache2/bin/httpd -V
> >> Server version: Apache/2.2.17 (Unix)
> >> Server built:   Nov 18 2010 05:04:25
> >> Server's Module Magic Number: 20051115:25
> >> Server loaded:  APR 1.4.2, APR-Util 1.3.10
> >> Compiled using: APR 1.4.2, APR-Util 1.3.10
> >> Architecture:   32-bit
> >> Server MPM:     Prefork
> >>   threaded:     no
> >>     forked:     yes (variable process count)
> >> Server compiled with....
> >>  -D APACHE_MPM_DIR="server/mpm/prefork"
> >>  -D APR_HAS_SENDFILE
> >>  -D APR_HAS_MMAP
> >>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
> >>  -D APR_USE_SYSVSEM_SERIALIZE
> >>  -D APR_USE_PTHREAD_SERIALIZE
> >>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
> >>  -D APR_HAS_OTHER_CHILD
> >>  -D AP_HAVE_RELIABLE_PIPED_LOGS
> >>  -D DYNAMIC_MODULE_LIMIT=128
> >>  -D HTTPD_ROOT="/usr/local/apache2"
> >>  -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
> >>  -D DEFAULT_PIDLOG="logs/httpd.pid"
> >>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
> >>  -D DEFAULT_LOCKFILE="logs/accept.lock"
> >>  -D DEFAULT_ERRORLOG="logs/error_log"
> >>  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
> >>  -D SERVER_CONFIG_FILE="conf/httpd.conf"
>
> >> Contents of config.nice file are as follows
>
> >> ++++++++++++++++++++++++
> >> #! /bin/sh
> >> #
> >> # Created by configure
>
> >> CC="gcc"; export CC
> >> "./configure" \
> >> "CC=gcc" \
> >> "$@"
> >> ++++++++++++++++++++++++
>
> >> Information about Apache Modules Loaded
> >> =======================================
>
> >> root [zibal]% ./usr/local/apache2/bin/httpd -l
> >> Compiled in modules:
> >>   core.c
> >>   mod_authn_file.c
> >>   mod_authn_default.c
> >>   mod_authz_host.c
> >>   mod_authz_groupfile.c
> >>   mod_authz_user.c
> >>   mod_authz_default.c
> >>   mod_auth_basic.c
> >>   mod_include.c
> >>   mod_filter.c
> >>   mod_log_config.c
> >>   mod_env.c
> >>   mod_setenvif.c
> >>   mod_version.c
> >>   prefork.c
> >>   http_core.c
> >>   mod_mime.c
> >>   mod_status.c
> >>   mod_autoindex.c
> >>   mod_asis.c
> >>   mod_cgi.c
> >>   mod_negotiation.c
> >>   mod_dir.c
> >>   mod_actions.c
> >>   mod_userdir.c
> >>   mod_alias.c
> >>   mod_so.c
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "modwsgi" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/modwsgi?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to