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 [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. > > > -- 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.
