zoukankan      html  css  js  c++  java
  • Apache + mod_wsgi (Python)部署webpy应用

    1. 搭建 Apache 服务器

      (1). 下载 Httpd 及依赖 -- apr、apr-util

        httpd : http://httpd.apache.org/

        apr & apr-util : https://apr.apache.org/

      (2). 编译 

        apr :
    $ ./configure --prefix=/usr/local/apr
    $ make & sudo make install
        apr-util : 
    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
    make & sudo make install
        httpd :     
    $ ./configure --prefix=/usr/local/apache2 
    --with-apr=/usr/local/apr 
    --with-apr-util=/usr/local/apr-util 
    --sysconfdir=/etc/ 
    --enable-modules=all 
    --enable-mpms-shared=all
    
    $ make & sudo make install

    2. 配置 wsgi 框架

      1. 下载mod_wsgi.so模块文件 : http://code.google.com/p/modwsgi

      2. 编译安装: 

    $ ./configure --with-apxs=/usr/local/apache2/bin/apxs 
    --with-python=/usr/bin/python
    
    $ make & sudo make install

      3. 配置 httpd.conf 文件 : 

    LoadModule wsgi_module modules/mod_wsgi.so
    
    <IfModule wsgi_module>
        WSGIScriptAlias /webapp /var/www/webpy-app/code.py/
    
        Alias /webapp/static /var/www/webpy-app/static/
        AddType text/html .py
    
        <Directory /var/www/webpy-app/>
            AllowOverride all
            Options Indexes FollowSymLinks ExecCGI
            Order deny,allow
            SetHandler wsgi-script
            Allow from all
        </Directory>
    </IfModule>
    
    ServerName 127.0.1.1:80

    PS : 将 Request 注释,如下 : 

    <Directory />
        AllowOverride none
        # Require all denied
    </Directory>
  • 相关阅读:
    mybatis显示sql语句 log4j.properties配置文件
    Netty 4.0 demo
    Netty多线程处理机制
    crontab定时任务中文乱码问题
    linux grep、find 命令详解
    resin access.log format配置详解
    linux top命令详解
    正则表达式介绍及案例分享
    java定时任务
    rhApp遇到的项目问题
  • 原文地址:https://www.cnblogs.com/naray/p/4225807.html
Copyright © 2011-2022 走看看