3

I created a yesod webapp using yesod init. During development I used yesod devel to run the warp server on debug mode. Now I've finished a preliminary version and I want to deploy it on ec2 amazon server. So for an Apache server I could do sudo service appache start to start the server, and the server can keep on running after I close of the terminal.

How do I put my application on warp server and run it (production mode)? Is there any good websites that can show a quick tutorial on this? I've been searching for sometime but no luck, the closes ones are The yesod book, this blog and haskellwiki.

HHC
  • 2,513
  • 2
  • 18
  • 26

2 Answers2

3

You can consider following the recommendations in the deployment chapter, or using the Keter deployment system.

Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
  • I am following the set up for Nginx, but I still need to get warp running so that Nginx can redirect all tcp(port 80) traffic to it right (warp port)? – HHC Mar 24 '13 at 23:44
  • The scaffolded site includes Warp inside of it. The executable you compile already contains a fully functional web server. – Michael Snoyman Mar 25 '13 at 04:47
  • Oh really ? I though it was on warpDebug mode? So I can just run yesod devel? Also as to the question of server shuts down after I close the terminal, I think there is a work around where I could just run yesod in the background using the command unix command nohup. But somehow I feel there is a better way to do this. – HHC Mar 25 '13 at 06:10
  • You don't want to use yesod devel, you want to compile a binary. And then you probably want to run it with a process monitor such as upstart. The deployment chapter has full details on such a setup. – Michael Snoyman Mar 25 '13 at 10:58
  • Do I need to move Procfile to root and make package.json in-order for the binary to work? When I go directly to my dist/build/appname/appname and run it, it returns error appname: InvalidYaml (Just (YamlException "Yaml file not found: config/settings.yml")) – HHC Mar 26 '13 at 00:15
1

This discussion board is really informative on how to run a Yesod web site on actual servers.

HHC
  • 2,513
  • 2
  • 18
  • 26