Re: Clojure-Nginx on Ubuntu 14.04 install/setup problem (maybe somebody can help me)

286 views
Skip to first unread message

Yuexiang Zhang

unread,
Nov 17, 2016, 11:05:06 AM11/17/16
to Szabolcs Baader, Nginx-Clojure
Please check error.log to find the reason.
I think it was caused by the wrong jvm_classpath.



On Thu, Nov 17, 2016 at 3:01 AM, Szabolcs Baader <dam...@gmail.com> wrote:
If .. the answer.. that will not work with Ubuntu > ok. Just please give me a help.. because the general infos not enough. Private ok. Etc. Many thanks!!

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojure+unsubscribe@googlegroups.com.
To post to this group, send email to nginx-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nginx-clojure/eacaf3e6-e217-4f4a-85b9-9fdea7de0f55%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Szabolcs Baader

unread,
Nov 17, 2016, 2:21:49 PM11/17/16
to Nginx-Clojure, dam...@gmail.com
sudo apt-get install build-essential

java
-version
sudo apt
-get install default-jdk
sudo apt
-get install default-jre
sudo update
-alternatives --config javac # get the path

Sudo apt-get
Stable - 11 bugfull: http://nginx.org/download/nginx-1.10.1.tar.gz

wget http
://nginx.org/download/nginx-1.11.3.tar.gz
tar
-zxvf nginx-1.11.3.tar.gz
sudo apt
-get install --reinstall libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev

./configure --sbin-path=/etc/nginx/ --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module
make
sudo make install

wget https
://github.com/nginx-clojure/nginx-clojure/archive/v0.4.4.tar.gz
tar
-zxvf v0.4.4.tar.gz
 
./configure --add-module=nginx-clojure-0.4.4/src/c


This is my first way to install nginx-clojure. But I don't understand exactly, what I did wrong. Maybe I did something wrong..
I got every time back:
nginx: [emerg] unknown directive "handler_type" in /etc/nginx/sites-enabled/default:38

Any idea?

Thanks in advance,
Szabolcs


Szabolcs Baader

unread,
Nov 17, 2016, 2:22:51 PM11/17/16
to Nginx-Clojure, dam...@gmail.com
That is the clojure handler


On Thu, Nov 17, 2016 at 3:01 AM, Szabolcs Baader <dam...@gmail.com> wrote:
If .. the answer.. that will not work with Ubuntu > ok. Just please give me a help.. because the general infos not enough. Private ok. Etc. Many thanks!!

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojur...@googlegroups.com.

To post to this group, send email to nginx-...@googlegroups.com.

Yuexiang Zhang

unread,
Nov 17, 2016, 8:05:35 PM11/17/16
to Szabolcs Baader, Nginx-Clojure
The files from  https://sourceforge.net/projects/nginx-clojure/files/  is pre-compiled binary files which contains nginx-clojure module already. You can not do ./configure with them.

If you want to build it by yourself please update the command by adding nginx-clojure module :

./configure --sbin-path=/etc/nginx/ --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module --add-module=${you-nginx-clojure-path-here}/src/
make 
sudo make install



BTW nginx-clojure 0.4.4 can not compiled with nginx 1.11.0+. The latest nginx-clojure source can be compiled with nginx 1.11.0+.

To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojure+unsubscribe@googlegroups.com.

To post to this group, send email to nginx-...@googlegroups.com.

Szabolcs Baader

unread,
Nov 18, 2016, 4:10:54 PM11/18/16
to Nginx-Clojure, dam...@gmail.com
Thanks for your answer! I understand better how works nginx-clojure! Yes, I tried to compile again. :s
Now, I can run the ./nginx command without any error. But not loaded anything on the site.. just I see "sandglass" (running running the loading circle).
What do you think, what is the problem?


2016. november 18., péntek 2:05:35 UTC+1 időpontban xfeep a következőt írta:
The files from  https://sourceforge.net/projects/nginx-clojure/files/  is pre-compiled binary files which contains nginx-clojure module already. You can not do ./configure with them.

If you want to build it by yourself please update the command by adding nginx-clojure module :

./configure --sbin-path=/etc/nginx/ --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module --add-module=${you-nginx-clojure-path-here}/src/
make 
sudo make install



BTW nginx-clojure 0.4.4 can not compiled with nginx 1.11.0+. The latest nginx-clojure source can be compiled with nginx 1.11.0+.
On Fri, Nov 18, 2016 at 3:22 AM, Szabolcs Baader <dam...@gmail.com> wrote:
That is the clojure handler


On Thu, Nov 17, 2016 at 3:01 AM, Szabolcs Baader <dam...@gmail.com> wrote:
If .. the answer.. that will not work with Ubuntu > ok. Just please give me a help.. because the general infos not enough. Private ok. Etc. Many thanks!!

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojur...@googlegroups.com.
To post to this group, send email to nginx-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nginx-clojure/eacaf3e6-e217-4f4a-85b9-9fdea7de0f55%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojur...@googlegroups.com.
To post to this group, send email to nginx-...@googlegroups.com.

Szabolcs Baader

unread,
Nov 18, 2016, 4:13:30 PM11/18/16
to Nginx-Clojure, dam...@gmail.com
80 port: curl: (7) Failed to connect to 178.238.224.75 port 80: Connection refused (ok, that is normal I think)
8080 port: curl - no any answer in the terminal

Thanks in advance,
Szabolcs

Szabolcs Baader

unread,
Nov 18, 2016, 4:29:33 PM11/18/16
to Nginx-Clojure, dam...@gmail.com
Maybe that is helpful.

2016/11/18 22:26:17 [notice] 22786#0: signal process started
Exception in thread "main" java.lang.RuntimeException: can not load factory:nginx.clojure.clj.NginxClojureHandlerFactory
    at nginx.clojure.NginxHandlerFactory.fetchFactory(NginxHandlerFactory.java:35)
    at nginx.clojure.NginxHandlerFactory.fetchHandler(NginxHandlerFactory.java:42)
    at nginx.clojure.NginxClojureRT.registerCode(NginxClojureRT.java:858)
Caused by: java.lang.NoClassDefFoundError: clojure/lang/RT
    at nginx.clojure.clj.Constants.<clinit>(Constants.java:27)
    at nginx.clojure.clj.NginxClojureHandlerFactory.<init>(NginxClojureHandlerFactory.java:23)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:383)
    at nginx.clojure.NginxHandlerFactory.fetchFactory(NginxHandlerFactory.java:32)
    ... 2 more
Caused by: java.lang.ClassNotFoundException: clojure.lang.RT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 10 more
2016/11/18 22:26:20 [error] 22789#0: invalid clojure content_handler code : 
                        (fn[req]
                          {
                            :status 200,
                            :headers {"content-type" "text/plain"},
                            :body  "Hello Clojure & Nginx!"
                            })

Szabolcs Baader

unread,
Nov 18, 2016, 5:09:02 PM11/18/16
to Nginx-Clojure, dam...@gmail.com
Ok, I solved! Sorry for the lot of messages!
I just forget drop to the jars the clojure folder (jars)!!

Many thanks for your help!!!
Szabolcs

Szabolcs Baader

unread,
Nov 21, 2016, 12:38:10 PM11/21/16
to Nginx-Clojure, dam...@gmail.com
If somebody would like to start.. from zero.. here is my code.. maybe useful: https://github.com/damesek/clojure-nginx-setup-ssh/

Yuexiang Zhang

unread,
Nov 22, 2016, 8:31:22 AM11/22/16
to Szabolcs Baader, Nginx-Clojure
Hi, Szabolcs,

Thank you for your work!

But there's unnecessarily code  in your shell script. viz. 

wget http://nginx.org/download/nginx-1.10.1.tar.gz
tar -zxvf nginx-1.10.1.tar.gz
cd nginx-1.10.1

./configure --sbin-path=/etc/nginx/ --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module
make
mkdir -p /etc/nginx
sudo make install

The above code will generate an executable nginx file whose different version is contained in nginx-clojure.0.4.4.tar.gz too. So you need either 
of them but not both of them typically.



Regards.
xfeep

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojure+unsubscribe@googlegroups.com.

To post to this group, send email to nginx-...@googlegroups.com.

Szabolcs Baader

unread,
Dec 6, 2016, 5:09:16 AM12/6/16
to Nginx-Clojure, dam...@gmail.com
Hello,

Thanks for your help! Ok, I cut this part!

I uploaded the web-example-project - but not so work. I added to user root.. still I see the "exception.." message.
Could you help me, how can I setup previously created project to nginx-clojure server?

I saw
location /myClojure {
          content_handler_type 'clojure';
          content_handler_name 'my.hello/hello-world';
       }

In this case, what I need to drop to the class-path? The jar file or simple the full project?
 (sorry I'm beginner in this)

I got this message:
nginx: [emerg] getgrnam("nobody") failed
Exception in thread "main" java.lang.RuntimeException: start error:ngx_init_cycle

Regards,
Szabolcs


2016. november 22., kedd 14:31:22 UTC+1 időpontban xfeep a következőt írta:
Hi, Szabolcs,

Thank you for your work!

But there's unnecessarily code  in your shell script. viz. 

wget http://nginx.org/download/nginx-1.10.1.tar.gz
tar -zxvf nginx-1.10.1.tar.gz
cd nginx-1.10.1
./configure --sbin-path=/etc/nginx/ --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module
make
mkdir -p /etc/nginx
sudo make install

The above code will generate an executable nginx file whose different version is contained in nginx-clojure.0.4.4.tar.gz too. So you need either 
of them but not both of them typically.



Regards.
xfeep
On Tue, Nov 22, 2016 at 1:38 AM, Szabolcs Baader <dam...@gmail.com> wrote:
If somebody would like to start.. from zero.. here is my code.. maybe useful: https://github.com/damesek/clojure-nginx-setup-ssh/

2016. november 18., péntek 23:09:02 UTC+1 időpontban Szabolcs Baader a következőt írta:
Ok, I solved! Sorry for the lot of messages!
I just forget drop to the jars the clojure folder (jars)!!

Many thanks for your help!!!
Szabolcs

--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojur...@googlegroups.com.

To post to this group, send email to nginx-...@googlegroups.com.

Szabolcs Baader

unread,
Dec 6, 2016, 5:35:58 AM12/6/16
to Nginx-Clojure, dam...@gmail.com
Ok, I created with simple lein uberjar and works. Sorry, I don't know that is so simple.
The questions is, how works the embed web example? Where do I need to upload and how can I start the lein with-profile embed run?

Many thanks,
Szabolcs

Szabolcs Baader

unread,
Dec 6, 2016, 5:45:19 AM12/6/16
to Nginx-Clojure, dam...@gmail.com
Possible to add like inline code just from the external (from directory)?
(I read that, but I'm not sure.. I understand 100% :: Setting Compojure Router/External Http Service Handler)
Reply all
Reply to author
Forward
0 new messages