Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
I am still unable to start nomilkforme. I get this error: z@ubuntu:/tmp$ sudo start nomilkforme start: Job failed to start When I try $ init-checkconf -d /etc/init/nomilkforme.conf I get z@ubuntu:/deploy$ init-checkconf -d /etc/init/nomilkforme.conf DEBUG: upstart_path=/sbin/init DEBUG:

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
Is there another way to start the server besides using upstart? On Friday, December 27, 2013 9:44:10 PM UTC-4, James Reeves wrote: The script looks fine... Are you executing start nomilkforme as root or with sudo? Do you have a deploy user and a /deploy directory? - James On 28 December

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
Can I deploy this as explained here http://www.luminusweb.net/docs/deployment.md#running_standalone with java -jar myapp-0.1.0-SNAPSHOT-standalone.jar On Wednesday, December 25, 2013 10:06:58 AM UTC-4, James Reeves wrote: I currently serve a web app on a Ubuntu server. Here's the

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
Thanks, I just sent them an email asking more info. On Friday, December 27, 2013 7:22:12 PM UTC-4, Alexis Gallagher wrote: It's not free, but Kevin Lynagh sells a collection of nicely packaged and documented examples of basic dev ops setups. The package on server config illustrates exactly

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
Ok, I am having problems starting nginx with upstart as mentioned by James Reeves. Would starting with tmux work as well. Can you give more info? On Wednesday, December 18, 2013 6:40:51 PM UTC-4, Curtis Gagliardi wrote: I don't know how to configure an init script, but I just run the command

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
I tried it like this and it seems to work: z@ubuntu:/etc/nginx/sites-available$ export PORT=4000 z@ubuntu:/etc/nginx/sites-available$ java -jar /deploy/my-webapp-0.1.0-standalone.jar 2013-12-28 11:58:16.307:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT 2013-12-28

Re: How do I serve clojure pages with nginx

2013-12-28 Thread James Reeves
Upstart gives you useful tools like respawning failed services, log rotation, and starting on server boot. Have you checked the logs in /var/log/upstart/nomilkforme.log? Perhaps it's got something to do with the permissions of the deploy directory. - James On 28 December 2013 17:08, Zeynel

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Zeynel
Yes, but I don't see nomilkforme.log file. There are only .gz files: z@ubuntu:/var/log/upstart$ ls console-setup.log.1.gz container-detect.log.1.gz module-init-tools.log.1.gz networking.log.1.gz network-interface-eth0.log.1.gz procps.log.1.gz procps-static-network-up.log.1.gz

Re: How do I serve clojure pages with nginx

2013-12-28 Thread James Reeves
Logs are automatically gzipped up after a while, I believe. You can use something like zcat to take a look inside. - James On 28 December 2013 17:24, Zeynel azeyn...@gmail.com wrote: Yes, but I don't see nomilkforme.log file. There are only .gz files: z@ubuntu:/var/log/upstart$ ls

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Ahmet Zeynel
Great, I used zcat to look at them but I think they are too long to post here, do you know which one(s) would be relevant? z@ubuntu:/var/log/upstart$ ls console-setup.log.1.gz container-detect.log.1.gz module-init-tools.log.1.gz networking.log.1.gz network-interface-eth0.log.1.gz procps.log.1.gz

Re: How do I serve clojure pages with nginx

2013-12-28 Thread James Reeves
The one with the name of your app, if there is one. There's a log file per upstart service. - James On 28 December 2013 18:00, Ahmet Zeynel azeyn...@gmail.com wrote: Great, I used zcat to look at them but I think they are too long to post here, do you know which one(s) would be relevant?

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Ahmet Zeynel
Earlier I changed the permissions in /deploy but now I put it back to root and now I have: z@ubuntu:/deploy$ ll total 8164 drwxr-xr-x 2 root root4096 Dec 27 08:20 ./ drwxr-xr-x 24 root root4096 Dec 27 08:09 ../ -rw-r--r-- 1 root root 8351715 Dec 27 08:20 my-webapp-0.1.0-standalone.jar

Re: How do I serve clojure pages with nginx

2013-12-28 Thread James Reeves
The script I included in my example assumes that there is a deploy user that owns the /deploy directory and everything in it. - James On 28 December 2013 19:18, Ahmet Zeynel azeyn...@gmail.com wrote: Earlier I changed the permissions in /deploy but now I put it back to root and now I have:

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Mark Mandel
I have found in the past I needed to reload-configuration of initctl. Maybe try that? Mark Sent from my mobile doohickey On 29/12/2013 9:14 AM, James Reeves ja...@booleanknot.com wrote: The script I included in my example assumes that there is a deploy user that owns the /deploy directory

Re: How do I serve clojure pages with nginx

2013-12-28 Thread Ahmet Zeynel
Thanks so much! That worked: deploy@ubuntu:~$ sudo start nomilkforme [sudo] password for deploy: nomilkforme start/running, process 19945 deploy@ubuntu:~$ One more question: When I go to www.nomilkfor.me I see the 'jetty' favicon on the browser tab. Is it because ring is using jetty? I assume

Re: How do I serve clojure pages with nginx

2013-12-27 Thread Zeynel
Thank you, this is great, exactly what I was looking for. I had a few issues but I solved them and it is all set as you described, but I am unable to run it with $ start app-name. I created /etc/init/nomilkfor.me.conf (this is the domain name) and this is what is in the file: description

Re: How do I serve clojure pages with nginx

2013-12-27 Thread James Reeves
Perhaps try nomilkforme.conf instead of nomilkfor.me.conf ? - James On 28 December 2013 00:27, Zeynel azeyn...@gmail.com wrote: Thank you, this is great, exactly what I was looking for. I had a few issues but I solved them and it is all set as you described, but I am unable to run it with $

Re: How do I serve clojure pages with nginx

2013-12-27 Thread Ahmet Zeynel
I just tried it but I got the same error. Do I need to add exec or script in the conf file? Thanks. On Fri, Dec 27, 2013 at 9:20 PM, James Reeves ja...@booleanknot.com wrote: Perhaps try nomilkforme.conf instead of nomilkfor.me.conf ? - James On 28 December 2013 00:27, Zeynel

Re: How do I serve clojure pages with nginx

2013-12-27 Thread James Reeves
The script looks fine... Are you executing start nomilkforme as root or with sudo? Do you have a deploy user and a /deploy directory? - James On 28 December 2013 01:33, Ahmet Zeynel azeyn...@gmail.com wrote: I just tried it but I got the same error. Do I need to add exec or script in the

Re: How do I serve clojure pages with nginx

2013-12-27 Thread Ahmet Zeynel
I don't think I have a deploy user but I have a /deploy directory with the following content: z@ubuntu:/deploy$ ll total 8164 drwxr-xr-x 2 zz 4096 Dec 27 08:20 ./ drwxr-xr-x 24 root root4096 Dec 27 08:09 ../ -rw-r--r-- 1 zz8351715 Dec 27 08:20

Re: How do I serve clojure pages with nginx

2013-12-27 Thread Alexis Gallagher
It's not free, but Kevin Lynagh sells a collection of nicely packaged and documented examples of basic dev ops setups. The package on server config illustrates exactly what you are asking for: deploying a Clojure web app behind nginx, with some monitoring, server-hardening, etc.. It's at:

Re: How do I serve clojure pages with nginx

2013-12-26 Thread Malcolm Sparks
Here's an article I wrote that takes you through the full process of running nginx and and a Clojure web app. https://juxt.pro/articles/manual-clojure-deployment.html On Tuesday, December 17, 2013 12:44:34 PM UTC, Zeynel wrote: I've set up a home server with ubuntu and nginx and I can serve

Re: How do I serve clojure pages with nginx

2013-12-26 Thread Justin Smith
java -jar is fine in production. Jetty, Tomcat, or Immutant will offer some conveniences but are not necessary. What is needed (for security reasons) is an nginx proxy. On Wednesday, December 25, 2013 3:42:00 AM UTC-8, Zeynel wrote: Ok, I worked through the tutorial referenced

Re: How do I serve clojure pages with nginx

2013-12-25 Thread Zeynel
Ok, I worked through the tutorial referenced http://clojure-doc.org/articles/tutorials/basic_web_development.html#build-and-run-it and I created a jar file and ran it with $ java -jar -my-webapp.jar. This works. But my understanding is that this is would not work for production. I need to

Re: How do I serve clojure pages with nginx

2013-12-25 Thread James Reeves
I currently serve a web app on a Ubuntu server. Here's the configuration I use: In /etc/nginx/sites-available/app-name: server { listen 80; location / { proxy_set_header X-Real-IP$remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Re: How do I serve clojure pages with nginx

2013-12-20 Thread Dave Della Costa
Hi Zeynel, I don't know if setting things up the way I've laid out there is such a great idea. What I would do instead is set the port and whatnot in the jetty configuration inside of ring, assuming that's what you're using (this assumes a lot about how your app is set up, so let me know if this

Re: How do I serve clojure pages with nginx

2013-12-18 Thread Zeynel
On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote: ...I would probably simply push out an uberjar with lein which I would run with Java via an init script--for example, if using Ubuntu: http://upstart.ubuntu.com/cookbook/#run-a-java-application I want to try

Re: How do I serve clojure pages with nginx

2013-12-18 Thread Curtis Gagliardi
I build an uberjar of a web server that uses jetty with compojure and run it on port 3000, then I have nginx configured to proxy it like so: https://gist.github.com/cgag/8031034 -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: How do I serve clojure pages with nginx

2013-12-18 Thread Curtis Gagliardi
I don't know how to configure an init script, but I just run the command `java -jar mywebserver.jar` in a tmux session manually and then detach. For how to setup an uberjar to run a web server, there's a nice tutorial on clojure-doc. You just need to make sure you have your :main class

Re: How do I serve clojure pages with nginx

2013-12-18 Thread Zeynel
I am following your tutorial, but I am stuck with Jetty configuration. My installation does not seem to have a /contexts directory. Where is it? On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote: I have not done this specifically with Nginx but I suspect you probably

How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
I've set up a home server with ubuntu and nginx and I can serve static pages. Now I want to add clojure but I am not sure what I need to do. I asked the same question in StackOverflow but for some reason it is voted to be closed:

Re: How do I serve clojure pages with nginx

2013-12-17 Thread Dave Della Costa
I have not done this specifically with Nginx but I suspect you probably want something like what I set up with Apache + Jetty: https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd That is, set up Nginx to act as a proxy for Jetty:

Re: How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
Yes, this is helpful. I think this will be a good starting point for me once I read the references that you gave. I also heard about Immutant and I'm investigating it but do you think it may be helpful? I am not sure at this point exactly what it does. Thanks. On Tuesday, December 17, 2013

Re: How do I serve clojure pages with nginx

2013-12-17 Thread Toby Crawley
From an HTTP perspective, Immutant will behave similarly to Jetty - you would need to use Nginx as a proxy. Where Immutant differs from Jetty is when your application needs services beyond the web: scheduled jobs, messaging, XA transactions, etc. Immutant bundles those services and simplifies

Re: How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
Great, thanks. In that case I'll concentrate on Jetty. On Tuesday, December 17, 2013 11:51:42 AM UTC-4, Toby Crawley wrote: From an HTTP perspective, Immutant will behave similarly to Jetty - you would need to use Nginx as a proxy. Where Immutant differs from Jetty is when your application