我正在考虑使用 python 服务基于 json 的 web 服务,我的优先级是,按顺序:
- 可维护性
- 易于编码
- 高可用性
- 表现
Apache->AJP->Flup->Python 对我来说似乎没问题,你会推荐其他设置还是这样?
What would AJP do in that setup? The only "flup" I can find is a package with a "Random assortment of WSGI servers", which doesn't seem very helpful.
I'd recommend you to look at Pyramid and Django. Two Python web frameworks with different philosophies that both fulfill your requirements. Then pick the one that you like best.
如果您已经知道 Flup,那么该设置将起作用。还有大约一百万个其他配置,包括使用一些纯 python 服务器(和 Apache ProxyPass)。如果你需要 Tomcat,那么这是完全合理的。我建议添加paste
到组合中以管理配置。
您没有提供足够的信息来回答这个问题。您的 Web 服务在做什么(除了提供 JSON 服务)?数据从何而来?有多少种不同类型的输出?它有多动态?需要什么样的处理?它需要认证吗?它需要数据库连接吗?会是 REST 吗?它需要处理 POST 以及 GET 吗?等等,等等。
如果您只是非常简单的要求以只读方式提供几种不同类型的内容,那么您提出的解决方案可能很好(尽管像 Lennart 我不明白 AJP 在那里做什么)。不过,如果你有更复杂的东西,你可能想研究一下运行在 Apache + mod_wsgi 上的 Django + Piston。