The app server and process monitoring questions have been covered elsethread. There hasn't been much talk about the static content.
I'd say there are two main strategies available here: a. set appropriate caching headers on your static pages & use a caching proxy such as varnish b. precompile your assets and serve them straight from disk using nginx's try_files directive Option a is probably easier to get going with, and for a personal blog probably good enough. For option b, I'd use sprockets if I were in the ruby world, but I'm not sure what clojure libraries are in this space. Phil On Jun 29, 2013 6:59 PM, "Ravindra Jaju" <ravindra.j...@gmail.com> wrote: > Thank you Daniel and James. I appreciate the detailed response and advice. > > I'll make myself more clear and specify what I have in mind. I don't want > hot-deploys, for sure. :) I erred when I mentioned "without restarting" - > that certainly changes quite a few things! > > Here's what I have in mind for my app as well as the deployment design. > Its main goals are primarily to (1) Get more familiar with clojure dev > since I enjoy it, (2) host my personal blog (mostly markdown, processed at > runtime or pre-preprocessed), and (3) some dynamic content. > > | nginx | --------> | static content - markdown, possibly preprocessed - > with markdown-clj | ------> | clojure app for some dynamic content | > > I've only started using luminus, and it serves markdown by processing it > at runtime, which makes my content serving dependent on the app-server. I > have the option of pre-processing markdown and serving it completely > statically with nginx. Until then, I'm okay right now using the app to > serve it. > > It is at this point where I need advice. I currently only know of running > the clojure app via "lein ring server" (or equivalent) from the > command-line - no scripts which can run it like those init scripts with > start/stop/reload support. nginx runs fine as a daemon, but I need to > figure out the java side. > > 1] Upstart is good - so, I will need to figure out the equivalent on > Fedora (which is what I use - primarily because I'm too familiar with it > and have been an RH/Fedora guy since about ~1995). Essentially, a daemon > monitor which will restart in case of failures. I've been somewhat rusty > with the recent releases of all Linux-es from the systems admin point of > view. > 2] Is there a suggested way to manage the java process - especially > starting and stopping? I'm okay with a few seconds of downtime, and I can > write scripts to do this myself, but don't want to reinvent the wheel if > there are already some tools/scripts/practices which make it > straightforward. I'm especially looking for current practices with folks > who use clojure with jetty/http-kit like servers, and not jboss et al. :) > > Best regards, > jaju > > > > On Sat, Jun 29, 2013 at 10:36 PM, James Reeves <ja...@booleanknot.com>wrote: > >> If you just want to deploy your application, and don't particularly care >> about having control over your system architecture, you might want to >> consider a platform like Heroku. >> >> Otherwise, a common solution, and one I'd personally recommend, is to >> have a standalone app executed via Upstart, running behind an nginx proxy. >> >> Upstart allows you to run a process as a daemon, and it can do useful >> things like automatically restart a process if it unexpectedly terminates. >> Upstart is by no means the only program that does this, but it's the one >> Ubuntu uses and is therefore stable and well-tested. >> >> A HTTP proxy server like nginx is useful for buffering against restarts >> and application failures. You can configure nginx to buffer a request while >> your server restarts, or to distribute request over a cluster of processes, >> or to cache static content. >> >> You could create the standalone app manually, with a -main function that >> calls run-jetty, or use the lein-ring plugin and the "lein ring uberjar" >> command to do it for you. >> >> - James >> >> >> On 29 June 2013 15:47, Ravindra Jaju <ravindra.j...@gmail.com> wrote: >> >>> I want to deploy a small web app - serving mostly static content. I'm >>> using Luminus (http://www.luminusweb.net/) - which is quite neat in the >>> way it builds itself from well-known components. >>> >>> I'm having trouble deciding how to deploy it. I want some automation >>> while deploying upgrades, and would like it to be light-weight. Jetty, >>> http-kit, or immutant? >>> (I tried immutant - but it seems to be taking up too much memory for my >>> comfort, on my modest server.) >>> >>> Jetty and http-kit - I would like to hear about how I can deploy them as >>> nice system daemons, with monitoring etc. so that they can be brought up >>> automatically if something goes wrong. I'm also unable to find out how I >>> can do a re-deploy without restarting. >>> >>> Any help or pointers appreciated! >>> >>> Thanks, >>> jaju >>> >>> -- >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.