部署 Yesod 的推荐方式是什么?
我在共享 Web 服务器上,并且本地安装了 apache2,因此我可以按照我需要的方式进行设置。部署 yesod 应用程序最受支持的方式是什么?我可以将 apache2 设置为 Warp 的代理。这是最好的设置吗?或者我应该选择 FastCGI?
我也希望了解有关如何设置一切的详细信息。我的意思是如何编写一个请求处理程序,如果我需要一个,apache 的 VirtualHost 应该是什么样子,等等,因为我是 yesod 的新手。
I am on a shared web server, and I have apache2 installed locally, so I can set it up any way I need. What is the most supported way to deploy a yesod application? I can set up my apache2 as a proxy to Warp. Would this be the best setup? Or should I just go with FastCGI?
I also would appreciate details on how to set up everything. I mean how to write a request handler, if I need one, what apache's VirtualHost should look like, etc, because I am new to yesod.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 Yesod Book,使用反向代理进行 Warp 是推荐的方法,但是那里还详细描述了各种其他部署选项。
According to the Yesod Book, Warp with a reverse proxy is the recommended approach, but the various other deployment options are also described in great detail there.
Keter 非常容易使用。 GitHub 页面上有更多文档。它是为 Yesod 设计的,并且
yesod
二进制文件支持它,因为您可以运行yesod keter
来生成应用程序的捆绑版本,并将其放入/opt /keter/incoming
方便更新。Keter 位于最前端,因此您不需要 Apache 或 nginx;它可以处理 https 的 SSL。
然而,如果您需要一个功能更齐全的前端服务器,那么在 Keter 前面运行 Apache 或 nginx 似乎是个坏主意,最好将 http 直接反向代理到 Yesod 二进制文件。只需在某种守护进程(
systemd
或upstart
)中运行您的应用程序,并在命令行MyApplication Development -p 3000
上指定端口号,然后将 Apache 在匹配的连接上将反向代理设置为 3000。
Keter is really easy to use. There is more documentation on the GitHub page. It is designed for Yesod and the
yesod
binary supports it in that you can runyesod keter
to produce a bundled up version of your app that you drop into/opt/keter/incoming
for easy updates.Keter sits at the very front end so you don't need Apache or nginx; it can handle SSL for https.
If however you need a more full-featured front end server, it appears to be a bad idea to run Apache or nginx in front of Keter, and its better to reverse proxy http directly to the Yesod binary. Just run you app in some sort of daemon (
systemd
orupstart
) specifying the port number on the command lineMyApplication Development -p 3000
and then set Apache to reverse proxy to 3000 on matching connections.