关闭

mod_wsgi安装

299人阅读 评论(0) 收藏 举报
分类:
一、安装 httpd-devel (产生 apxs 文件)
    1. rpm -ihv apr-devel-1.3.9-3.el6_1.2.x86_64.rpm

    2. rpm -ihv apr-util-devel-1.3.9-3.el6_0.1.x86_64.rpm
        1) rpm -ihv db4-devel-4.7.25-17.el6.x86_64.rpm
            warning: db4-devel-4.7.25-17.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
            error: Failed dependencies:
            db4-cxx = 4.7.25-17.el6 is needed by db4-devel-4.7.25-17.el6.x86_64
            libdb_cxx-4.7.so()(64bit) is needed by db4-devel-4.7.25-17.el6.x86_64

        rpm -ihv db4-cxx-4.7.25-17.el6.x86_64.rpm
        rpm -ihv db4-devel-4.7.25-17.el6.x86_64.rpm

        2) rpm -ihv expat-devel-2.0.1-11.el6_2.x86_64.rpm

        3) rpm -ihv openldap-devel-2.4.23-26.el6.x86_64.rpm
            warning: openldap-devel-2.4.23-26.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
            error: Failed dependencies:
            cyrus-sasl-devel >= 2.1 is needed by openldap-devel-2.4.23-26.el6.x86_64

            rpm -ihv cyrus-sasl-devel-2.1.23-13.el6.x86_64.rpm
            rpm -ihv openldap-devel-2.4.23-26.el6.x86_64.rpm

        4) rpm -ihv apr-util-devel-1.3.9-3.el6_0.1.x86_64.rpm

    3. rpm -ihv httpd-devel-2.2.15-15.el6_2.1.x86_64.rpm


二、安装 mod_wsgi
    cd mod_wsgi-3.4/

    ./configure --with-apxs=/usr/sbin/apxs   --with-python=/usr/bin/python

    make
    make install
    
三、apache中配置python加载mod_wsgi,/etc/httpd/conf 中会包含/etc/httpd/conf.d所有已.conf结尾的文件
    a) cd /etc/httpd/conf.d
    b) vi wsgi.conf
    c) 加入如下内容
    LoadModule wsgi_module modules/mod_wsgi.so

四、/etc/httpd/conf/httpd.conf 加入端口监听,执行wgi,加入:
   WSGISocketPrefix run/wsgi

五、/etc/httpd/conf/httpd.conf 加入端口监听:
    Listen 81

六、/etc/httpd/conf/httpd.conf 中加入虚拟主机
    <VirtualHost *:81>
        DocumentRoot /var/www/test
        ErrorLog logs/test-error_log
        CustomLog logs/test-access_log common

        Alias /media/ /var/www/test/media/
        Alias /static/ /var/www/test/static/

        WSGIDaemonProcess test processes=1 threads=25 display-name=%{GROUP}
        WSGIProcessGroup test
        WSGIChunkedRequest On
        WSGIScriptAlias / /var/www/test/wsgi.py
    </VirtualHost>
    
七、屏蔽selinux
    vi /etc/selinux/config
        更改 SELINUX=disabled
        :wq
        然后dos中执行
        setenforce 0
八、重启生效 /etc/init.d/httpd restart

九、错误
    No such file or directory: [client 192.168.114.1:33773]
    mod_wsgi (pid=29813): Unable to connect to WSGI daemon process
    'ott_gd_topway_dav_hipi_game' on '/usr/local/apache/run/wsgi.1517.14.1.sock'
    after multiple attempts.
    
    是因为没有 /usr/local/apache/run 目录,手动创建一个就好了
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:92976次
    • 积分:1766
    • 等级:
    • 排名:千里之外
    • 原创:83篇
    • 转载:47篇
    • 译文:0篇
    • 评论:5条
    文章分类
    最新评论