在/data/lujianxing/bottle 文件夹中创建三个文件:

bottle.py bottle的源文件

a.py

from bottle import Bottle, run
mybottle = Bottle()
@mybottle.route('/')
def index():
  return 'default_app'
application=mybottle

uwsgi.xml

<uwsgi>  
<socket>0.0.0.0:10005</socket>  
<listen>20</listen>  
<master>true</master>  
<pidfile>/usr/local/nginx/uwsgi.pid</pidfile>  
<processes>8</processes>  
<module>a</module>
<pythonpath>/data/lujianxing/bottle/</pythonpath> 
<profiler>true</profiler>  
<enable-threads>true</enable-threads>  
<logdate>true</logdate>  
</uwsgi>

通过命令  uwsgi -x uwsgi.xml 启动服务

nginx配置:

server {
                listen 10015;
                server_name test.com;
                access_log /tmp/log;
                error_log /tmp/log1;
                location / {
                        uwsgi_pass 127.0.0.1:10005;
                        include  uwsgi_params;
                }
               

        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2021-06-02
  • 2022-12-23
  • 2021-12-15
  • 2021-10-23
猜你喜欢
  • 2021-11-15
  • 2022-02-08
  • 2022-01-03
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案