[root@ modules]# ldd mod_wsgi.so
linux-vdso.so.1 => (0x00007fff2b7ff000)
libpython2.7.so.1.0 =>
/usr/local/lib/anaconda/lib/libpython2.7.so.1.0 (0x00007f645d54e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f645d317000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f645d113000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f645cf10000)
libm.so.6 => /usr/local/lib/anaconda/lib/libm.so.6
(0x00007f645cc8c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f645c8f9000)
/lib64/ld-linux-x86-64.so.2 (0x000000304d800000)
On Friday, March 8, 2013 7:57:58 PM UTC-5, Graham Dumpleton wrote:
>
> What do you get when you run:
>
> ldd mod_wsgi.so
>
> Graham
>
>
> On 8 March 2013 16:49, Steve Liang <[email protected] <javascript:>> wrote:
>
>> Thanks Graham, I still get the same error.
>>
>> SELinux is disabled.
>> [root@ /]# sestatus
>> SELinux status: disabled
>>
>> user apache has access to /usr/local/lib/anaconda/
>> [root@ /]# sudo -u apache ls /usr/local/lib/anaconda/
>> bin conda-meta docs envs etc include lib LICENSE.txt pkgs share
>> var
>>
>>
>> Here are some output:
>> [user@ mod_wsgi-3.4]$ ./configure
>> --with-python=/usr/local/lib/anaconda/bin/python
>> checking for apxs2... no
>> checking for apxs... /usr/sbin/apxs
>> checking Apache version... 2.2.15
>> configure: creating ./config.status
>> config.status: creating Makefile
>>
>> [user@ mod_wsgi-3.4]$ LD_RUN_PATH=/usr/local/lib/anaconda/lib make
>> /usr/sbin/apxs -c -I/usr/local/lib/anaconda/include/python2.7 -DNDEBUG
>> mod_wsgi.c -L/usr/local/lib/anaconda/lib
>> -L/usr/local/lib/anaconda/lib/python2.7/config -lpython2.7 -lpthread -ldl
>> -lutil -lm
>> /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic
>> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>> --param=ssp-buffer-size=4 -m64 -mtune=generic -Wformat-security
>> -fno-strict-aliasing -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread
>> -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1
>> -I/usr/local/lib/anaconda/include/python2.7 -DNDEBUG -c -o mod_wsgi.lo
>> mod_wsgi.c && touch mod_wsgi.slo
>> ... ...
>>
>> [root@ mod_wsgi-3.4]# LD_RUN_PATH=/usr/local/lib/anaconda/lib make install
>> /usr/sbin/apxs -i -S LIBEXECDIR=/usr/lib64/httpd/modules -n 'mod_wsgi'
>> mod_wsgi.la
>> /usr/lib64/httpd/build/instdso.sh
>> SH_LIBTOOL='/usr/lib64/apr-1/build/libtool'
>> mod_wsgi.la/usr/lib64/httpd/modules
>> /usr/lib64/apr-1/build/libtool --mode=install cp
>> mod_wsgi.la/usr/lib64/httpd/modules/
>> libtool: install: cp .libs/mod_wsgi.so
>> /usr/lib64/httpd/modules/mod_wsgi.so
>> libtool: install: cp .libs/mod_wsgi.lai /usr/lib64/httpd/modules/
>> mod_wsgi.la
>> libtool: install: cp .libs/mod_wsgi.a /usr/lib64/httpd/modules/mod_wsgi.a
>> libtool: install: chmod 644 /usr/lib64/httpd/modules/mod_wsgi.a
>> libtool: install: ranlib /usr/lib64/httpd/modules/mod_wsgi.a
>> libtool: finish:
>> PATH="/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin::/root/bin:/sbin"
>>
>> ldconfig -n /usr/lib64/httpd/modules
>> ----------------------------------------------------------------------
>> Libraries have been installed in:
>> /usr/lib64/httpd/modules
>>
>> Verifying the libraries:
>> [root@ modules]# ldd mod_wsgi.so
>> linux-vdso.so.1 => (0x00007fff2b7ff000)
>> libpython2.7.so.1.0 =>
>> /usr/local/lib/anaconda/lib/libpython2.7.so.1.0 (0x00007f645d54e000)
>> libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f645d317000)
>> libdl.so.2 => /lib64/libdl.so.2 (0x00007f645d113000)
>> libutil.so.1 => /lib64/libutil.so.1 (0x00007f645cf10000)
>> libm.so.6 => /usr/local/lib/anaconda/lib/libm.so.6
>> (0x00007f645cc8c000)
>> libc.so.6 => /lib64/libc.so.6 (0x00007f645c8f9000)
>> /lib64/ld-linux-x86-64.so.2 (0x000000304d800000)
>>
>> The new mod_wsgi.so is about 426k, is it a reasonable size? The orginal
>> one is about 150k.
>> [root@sacqtwe03 modules]# ls -al mod_wsgi*
>> -rwxr-xr-x 1 root root 426744 Mar 8 19:40 mod_wsgi.so
>> -rwxr-xr-x 1 root root 150888 Aug 22 2010 mod_wsgi.so.orig
>>
>> start apache (log level info):
>> [root@ modules]# service httpd start
>> Starting httpd: [ OK ]
>>
>> This is what's in the error_log:
>> [Fri Mar 08 19:44:46 2013] [notice] suEXEC mechanism enabled (wrapper:
>> /usr/sbin/suexec)
>> [Fri Mar 08 19:44:46 2013] [notice] Digest: generating secret for digest
>> authentication ...
>> [Fri Mar 08 19:44:46 2013] [notice] Digest: done
>> [Fri Mar 08 19:44:46 2013] [info] APR LDAP: Built with OpenLDAP LDAP SDK
>> [Fri Mar 08 19:44:46 2013] [info] LDAP: SSL support available
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17206): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17206): Initializing
>> Python.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17207): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17207): Initializing
>> Python.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17208): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17208): Initializing
>> Python.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17209): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17209): Initializing
>> Python.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17210): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17210): Initializing
>> Python.
>> Could not find platform independent libraries <prefix>
>> Could not find platform dependent libraries <exec_prefix>
>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>> ImportError: No module named site
>> Could not find platform independent libraries <prefix>
>> Could not find platform dependent libraries <exec_prefix>
>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>> ImportError: No module named site
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17211): Python home
>> /usr/local/lib/anaconda.
>> [Fri Mar 08 19:44:46 2013] [info] mod_wsgi (pid=17211): Initializing
>> Python.
>> Could not find platform independent libraries <prefix>
>> Could not find platform dependent libraries <exec_prefix>
>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>> ImportError: No module named site
>> .... ....
>>
>>
>>
>>
>> On Friday, March 8, 2013 6:07:26 PM UTC-5, Graham Dumpleton wrote:
>>
>>> Don't link the .so into /usr/lib.
>>>
>>> Try instead when building mod_wsgi, doing:
>>>
>>> ./configure --with-python=/usr/local/lib/**anaconda/bin/python
>>> LD_RUN_PATH=/usr/local/lib/**anaconda/lib make
>>> LD_RUN_PATH=/usr/local/lib/**anaconda/lib make install
>>>
>>> That will embed the library location in mod_wsgi.so so you don't have to
>>> symlink it into system directories.
>>>
>>> Other than that, don't see any specific issues with what you have done.
>>>
>>> Do make sure though that /usr/local/lib/anaconda is readable to others
>>> so Apache user can see inside that directory.
>>>
>>> Ensure you aren't running some sort of security extensions such as
>>> SELinux.
>>>
>>> Graham
>>>
>>> On 8 March 2013 14:15, Steve Liang <[email protected]> wrote:
>>>
>>>> OS: CentOS 6
>>>> Apache: 2.2.15 from repository
>>>> Python: different versions installed
>>>> - default: 2.6.6 from repository (/usr/bin)
>>>> - also installed anaconda at /usr/lcoal/lib/anaconda
>>>>
>>>> mod_wsgi:
>>>> - default 3.2.1 from "yum install mod_wsgi" (this works with the
>>>> "hello world" test.wsgi)
>>>>
>>>> we want to use 2.7.3 python so we download mod_wsgi 3.4 and did the
>>>> following based in the instructions:
>>>> - ./configure --with-python=/usr/local/lib/**anaconda/bin/python
>>>> - make
>>>> - make install (install to /etc/httpd/modules)
>>>>
>>>> - ldd /etc/httpd/modules/mod_wsgi.so disp libpyhon2.7.so not found, so
>>>> we did the following:
>>>> - ln -s /usr/local/lib/anaconda/lib/**libpython2.7.so.1.0
>>>> /lib64/libpython2.7.so.1.0
>>>>
>>>> - edit /etc/httpd/conf/httpd/conf to include the following:
>>>>
>>>> WSGIPythonHome /usr/local/lib/anaconda
>>>> #WSGIPythonPath /usr/local/lib/anaconda/lib/**python2.7/site-packages
>>>> WSGIScriptAlias /abc /var/www/wsgi-scripts/abc
>>>>
>>>> <Directory "/var/www/wsgi-scripts">
>>>> Order allow,deny
>>>> Allow from all
>>>> </Directory>
>>>>
>>>> But after httpd restart, we still get error: here is the error log:
>>>> [Fri Mar 08 16:44:24 2013] [notice] Apache/2.2.15 (Unix) DAV/2
>>>> PHP/5.3.3 mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal
>>>> operations
>>>> [Fri Mar 08 16:44:24 2013] [info] Server built: Feb 13 2012 22:31:42
>>>> Could not find platform independent libraries <prefix>
>>>> Could not find platform dependent libraries <exec_prefix>
>>>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>>> ImportError: No module named site
>>>> [Fri Mar 08 16:44:24 2013] [info] mod_wsgi (pid=32538): Python home
>>>> /usr/local/lib/anaconda.
>>>> [Fri Mar 08 16:44:24 2013] [info] mod_wsgi (pid=32538): Initializing
>>>> Python.
>>>> Could not find platform independent libraries <prefix>
>>>> Could not find platform dependent libraries <exec_prefix>
>>>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>>> ImportError: No module named site
>>>>
>>>> In fact, not only wsgi not working, httpd does not working properly, as
>>>> our other webpages does not response.
>>>>
>>>> Any suggestions?
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "modwsgi" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to modwsgi+u...@**googlegroups.com.
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at
>>>> http://groups.google.com/**group/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en>
>>>> .
>>>> For more options, visit
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/modwsgi?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.