I don't think there is a such thing as a "real" server. Any process that listens on a TCP port and talks HTTP is a legitimate server, regardless of when or how it's started up.
Upstart is a fine way to run your server and make sure it's restarted if it dies. It's not hacky or unconventional, in fact it's probably the best way. Sitting nginx in front of something usually goes like this: You make your server process listen on some port, but only accepting connections from localhost. Then you make nginx listen on port 80 directly from the internet, and when it receives a request, it forwards it to your server via that internal port on localhost, and returns the results. This extra layer of abstraction gives you a lot of power and flexibility. Of course, you could get fancier than just using localhost, and you might even want several servers running at once, not just one, and round-robin requests to them. But this is the basic idea. And it's the same no matter what language your server is written in, as long as it knows how to talk HTTP over TCP. -Steven On Sun, Aug 18, 2013 at 11:21 AM, John Jacobsen <eigenhom...@gmail.com>wrote: > Many thanks to everyone who replied about deploying a Web server to > production. Specific replies: > > On Aug 17, 2013, at 6:51 PM, Mark Mandel <mark.man...@gmail.com> wrote: > > > > > On Sun, Aug 18, 2013 at 6:52 AM, John Jacobsen <eigenhom...@gmail.com> > wrote: > >> After some prototyping and development, we are now getting to the stage > where "lein run" and a Jetty server running from -main aren't going to cut > it. > > > > At the risk of asking a dumb question, but being quite new to Clojure, I > don't mind - why do you say they won't cut it? > > On Aug 18, 2013, at 9:25 AM, Norman Richards <o...@nostacktrace.com> wrote: > > > Other than that, mechanically our deploy is not significantly different > from a lein ring server, so maybe you can explain what your concerns with > that are? > > My main concern was just the need to ssh into the server and run leiningen > in the background, as opposed to setting up a "real" server which starts at > boot time. I'm OK w/ wrapping 'lein ring server-headless' with > Apache/Nginx, if there are no known issues w/ that approach. > > > On Aug 17, 2013, at 4:52 PM, Ray Miller <r...@1729.org.uk> wrote: > > > One option is simply to write an upstart script that invokes 'lein > > ring server-headless' and sit an apache or nginx proxy in front of it. > > That's how my website is currently running. Alternatively, you could > > deploy your application as a war to tomcat or jetty. > > > > The upstart configuration, which is installed to /etc/init/cms.conf, > > can be found here: https://gist.github.com/ray1729/6258845 > > That's very helpful -- can you be a little more specific about what you > mean by "sit an apache or nginx proxy in front of it"? It looks like your > example is self-contained (need Clojure/lein + upstart, and that's it). > > Thanks again everyone. > > John > > > > -- > -- > 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.