我应该如何在一台服务器上托管多个 Pylons 网站?
我目前在我的服务器上运行一个 Pylons 网站,该网站使用 nginx 作为 Paster 的代理进行设置。在不久的将来,我计划在同一服务器上托管另一个 Pylons 站点。
如果我采用相同的路线并使用 nginx+Paster,则意味着在不同端口上运行两个 Paster 实例,然后使用一台 nginx 服务器作为代理转发器到 127.0.0.1:808(1|2)。
让两个粘贴服务器为两个不同的站点运行似乎是一个坏主意。如果我的服务器上有 10 个 Pylons 站点,则意味着有 10 个 Paster 服务器实例正在运行...
有什么更好的解决方案?
I currently have one Pylons website running on my server that is setup using nginx as a proxy to Paster. In the near future, I plan to host another Pylons site on the same server.
If I were to go the same route and use nginx+Paster, it would mean running two paster instances on different ports and then using the one nginx server as a proxy forwarder to 127.0.0.1:808(1|2).
It seems like a bad idea to have two paster servers running for two different sites. If I were to have 10 Pylons sites on the server, it would mean 10 Paster server instances running...
What's a better solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为运行少量的 Paster 实例并没有什么问题,但你应该考虑使用 FastCGI(或 wsgi)和虚拟主机,因为它更适合“生产环境”。
FastCGI 示例:
现在,您必须站点:
您还可以设置 IP 来“监听”,例如:
这样您就可以使用 IP 而不是 DNS 名称。
对于 Pylons 应用程序,您应该将配置更改为 FastCGI:
对于第一个主机,对于第二个主机:
希望这会有所帮助。
I think there is nothing wrong with running few paster instances, but you should consider using FastCGI (or wsgi) and Virtual Hosts, because it's more suitable for "production environment".
Example with FastCGI:
Now, you have to sites:
You can also set IP in for "listen", e.g.:
so you are able to use IP instead of DNS name.
For Pylons app you should change configuration to FastCGI:
for first host, and for second:
Hope this helps.
您可以使用单个粘贴器实例来启动多个应用程序。下面的链接有一篇很好的文章,解释了如何使用 Paster 的 urlmap 来实现这一点。
http://countergram.com/pylons-virtual-host-multiple-domain
You can use a single paster instance to launch multiple applications. The link below has a nice article explaining how to use paster's urlmap to achieve this.
http://countergram.com/pylons-virtual-host-multiple-domain