isc442 / demodemo

Automatically exported from code.google.com/p/demodemo
0 stars 0 forks source link

安装Mod_python 在Solaris #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
bash-2.03# gzip -dv mod_python-3.3.1.tgz
mod_python-3.3.1.tgz:    81.4% -- replaced with mod_python-3.3.1.tar

bash-2.03# tar xvf mod_python-3.3.1.tar

$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
--with-python=/usr/local/bin/python

Original issue reported on code.google.com by Deo...@gmail.com on 11 Feb 2009 at 9:17

GoogleCodeExporter commented 8 years ago
*** Warning: Linking the shared library mod_python.la against the non-libtool
*** objects  _eprintf.o _floatdidf.o _muldi3.o is not portable!
Text relocation remains                         referenced
    against symbol                  offset      in file
<unknown>                           0x1030      /usr/local/lib/python2.5/config/
libpython2.5.a(floatobject.o)
<unknown>                           0x1034      /usr/local/lib/python2.5/config/
libpython2.5.a(floatobject.o)

Original comment by Deo...@gmail.com on 12 Feb 2009 at 1:23

GoogleCodeExporter commented 8 years ago
install new python:

./configure --prefix=/opt/python2.6 --enable-shared

Original comment by Deo...@gmail.com on 12 Feb 2009 at 2:41

GoogleCodeExporter commented 8 years ago
./configure --with-apxs=/usr/local/apache2/bin/apxs
--with-python=/opt/python2.6/bin/python

/usr/include/sys/feature_tests.h:96:1: warning: this is the location of the 
previous
definition
/opt/mod_python-3.3.1/src/_pspmodule.c:32: warning: 'yy_init_globals' defined 
but not
used
gcc -shared 
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/psp_string.o
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/psp_parser.o
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/_pspmodule.o 
-lpython2.6 -o
build/lib.solaris-2.8-sun4u-2.6/mod_python/_psp.so
ld: fatal: library -lpython2.6: not found
ld: fatal: File processing errors. No output written to
build/lib.solaris-2.8-sun4u-2.6/mod_python/_psp.so
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make[1]: *** [build] Error 1
make[1]: Leaving directory `/opt/mod_python-3.3.1/dist'
make: *** [do_dso] Error 2

Original comment by Deo...@gmail.com on 12 Feb 2009 at 2:55

GoogleCodeExporter commented 8 years ago
#crle - configure runtime linking environment
#add new library search directory

bash-2.03# crle -u
crle: /var/ld/ld.config: corrupt file, possible truncation
bash-2.03# crle -l /opt/python2.6/lib
bash-2.03#

Original comment by Deo...@gmail.com on 12 Feb 2009 at 3:05

GoogleCodeExporter commented 8 years ago
#add -L /opt/python2.6/lib for link the library manually.

gcc -shared 
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/psp_string.o
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/psp_parser.o
build/temp.solaris-2.8-sun4u-2.6/opt/mod_python-3.3.1/src/_pspmodule.o -L
/opt/python2.6/lib -lpython2.6 -o 
build/lib.solaris-2.8-sun4u-2.6/mod_python/_psp.so

Original comment by Deo...@gmail.com on 12 Feb 2009 at 3:25

GoogleCodeExporter commented 8 years ago
>>> import md5
__main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib 
instead
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python2.6/lib/python2.6/md5.py", line 10, in <module>
    from hashlib import md5
  File "/opt/python2.6/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/opt/python2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5

=====hashlib安装失败。
bash-2.03# ls -l |grep failed
-rwxr-xr-x   1 root     other     141912 Feb 12 10:43 _curses_failed.so
-rwxr-xr-x   1 root     other      31428 Feb 12 10:43 _curses_panel_failed.so
-rwxr-xr-x   1 root     other      30640 Feb 12 10:43 _hashlib_failed.so
-rwxr-xr-x   1 root     other      71832 Feb 12 10:43 _multiprocessing_failed.so
-rwxr-xr-x   1 root     other      89632 Feb 12 10:43 _ssl_failed.so
在编译python的各个库时,编译出来的库都会做一次load,如果l
oad不成功,就会把这个库改名
为xxx_failed.so,
你看看那个_hashlib_failed.so是不是有什么依赖库你没有的。 

bash-2.03# ldd _hashlib_failed.so
        libssl.so.0.9.8 =>       (file not found)
        libcrypto.so.0.9.8 =>    (file not found)
        libpython2.6.so.1.0 =>   /opt/python2.6/lib//libpython2.6.so.1.0
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Netra-240/lib/libc_psr.so.1

没有找到需要的包,需要重新安装。

Original comment by Deo...@gmail.com on 12 Feb 2009 at 4:47

GoogleCodeExporter commented 8 years ago
#添加新的SO搜索路径。
bash-2.03# crle -l /usr/local/ssl/lib -u

#成功加载动态库
bash-2.03# ldd _hashlib.so
        libssl.so.0.9.8 =>       /usr/local/ssl/lib/libssl.so.0.9.8
        libcrypto.so.0.9.8 =>    /usr/local/ssl/lib/libcrypto.so.0.9.8
        libpython2.6.so.1.0 =>   /opt/python2.6/lib/libpython2.6.so.1.0
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        librt.so.1 =>    /usr/lib/librt.so.1
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Netra-240/lib/libc_psr.so.1

Original comment by Deo...@gmail.com on 12 Feb 2009 at 5:13

GoogleCodeExporter commented 8 years ago
#配置一个路径解析URL请求。

<Location "/relation/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE relation.settings
    PythonOption django.root /relation
    PythonDebug On
    PythonPath "['/opt/deon_demo'] + sys.path"
</Location>

Original comment by Deo...@gmail.com on 12 Feb 2009 at 6:21

GoogleCodeExporter commented 8 years ago
http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=15775&rel
ease_id=491012

Original comment by Deo...@gmail.com on 12 Feb 2009 at 7:03

GoogleCodeExporter commented 8 years ago
在Linux上加载一个Library路径
[root@ipata-dev ld.so.conf.d]# pwd
/etc/ld.so.conf.d
[root@ipata-dev ld.so.conf.d]# cat python-2.6.conf
/usr/local/python2.6/lib
[root@ipata-dev ld.so.conf.d]# ldconfig -f python-2.6.conf
[root@ipata-dev ld.so.conf.d]#

Original comment by wudalong@gmail.com on 10 Jun 2009 at 3:22

GoogleCodeExporter commented 8 years ago
#安装apache2 的配置命令
./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so 
--enable-cgi

Original comment by wudalong@gmail.com on 10 Jun 2009 at 4:06