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>
  • 相关阅读:
    正则表达式语法
    Linux之Shell脚本计算命令行的所有和
    Linux之匹配符
    Linux之ls命令
    Linux之Shell的算术运算
    Linux 之 shell 比较运算符
    tensorboard的使用
    模型训练减少随机性
    keras 下载预训练模型报错SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
    Deep face recognition: a survey v4
  • 原文地址:https://www.cnblogs.com/naray/p/4225807.html
Copyright © 2011-2022 走看看