• [Centos] mod_wsgi 安装流程以及遇到问题解决办法。apxs: command not found 或 Sorry, Python developer package does not appear to be installed.


    前提: Centos 系统, apache 已安装, python 已安装。

    1. 首先下载mod_wsgi-3.5.tar.gz

        下载地址:https://code.google.com/p/modwsgi/

    2. 解压:tar -zxvf mod_wsgi-3.5.tar.gz

    3. 进入解压后的目录:cd mod_wsgi-3.5

    4. 配置:./configure 

        此时可能会遇到问题:apxs: command not found

                            原因: apache 组件 httpd-devel 没有安装

                            解决办法: yum install httpd-devel

    5. 编译:make 

        此时可能会遇到问题编译失败。查看错误第一行,发现:Sorry, Python developer package does not appear to be installed.

                            原因:python组件 python-devel没有安装

                            解决办法: yum install python-devel

    6. 安装:make install

        至此安装完成,可以看到此时的输出:

       

    # 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/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib64/httpd/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/lib64/httpd/modules
    
    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
       - have your system administrator add LIBDIR to `/etc/ld.so.conf'
    
    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    chmod 755 /usr/lib64/httpd/modules/mod_wsgi.so

        

  • 相关阅读:
    第一周编程总结
    7-3 抓老鼠亏了还是赚了
    7-1 打印沙漏
    2019春第十二周作业
    2019春第十一周作业
    2019年春第十周作业
    第九周作业总结
    第八周作业总结
    第七周作业总结
    第六周作业
  • 原文地址:https://www.cnblogs.com/bolddream/p/mod_wsgi.html
Copyright © 2020-2023  润新知