sip 导出c++对象供python脚本用
boost c++用python
python安装时修改configure产生的Makefile,在CFLAGS里加上-fPIC,这样后面的mod_wsgi-3.4才能make成功
mod_wsgi-3.4安装
./configure --with-apxs=/usr/local/apache2/bin/apxs
配置apache
WSGIScriptAlias /wsgi/ "/data/www/mywsgi/"
<Directory "/data/www/mywsgi">
Require all granted
</Directory>
/data/www/mywsgi/mywsgi.wsgi
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
浏览器输入:
10.0.0.2/wsgi/mywsgi.wsgi