What is the recommended way to deploy 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 ev开发者_JAVA百科erything. 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.
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 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 run yesod 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
or upstart
) specifying the port number on the command line
MyApplication Development -p 3000
and then set Apache to reverse proxy to 3000 on matching connections.
精彩评论