Hello,
Ok I see...
This happens with newer versions of nginx.
The problem that some nginx options had changed and it does not
work as it was before.
1. You must start it as root (otherwise it would fail to write to logs)
2. Then it forks of to undefined user and can't open a socket that
the cppcms application creates - as it runs as root.
So you have two options:
1. Use TCP/IP - instead of Unix domain sockets:
switch "socket" : "/tmp/hello-fcgi-socket" to "port" : 9000
so you will not have permission options.
2. Configure nginx manually such that it and the cppcms service run in
same user:group instead of using cppcms_run.
You can configure it instantly for some socket or TCP ip port
and then run application as any other applications.
./hello.fcgi -c config.js
And the web server connect it.
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.sf.net/
CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/
>________________________________
>From: Richard Catlin <ric...@gm...>
>To: cpp...@li...
>Sent: Monday, October 3, 2011 6:57 PM
>Subject: [Cppcms-users] Hello_world with Nginx 502 Bad Gateway
>
>
>I'm trying to run the hello_world example with Nginx. It looks like everything is working right, but when I go to
>http://localhost/hello.fcgi it tells me "502 Bad Gateway"
>
>
>Richard-Catlins-MacBook-Pro:hello_world richardcatlin$ sudo /usr/local/bin/cppcms_run -S nginx -p 80 -h 127.0.0.1 hello.fcgi -c config.js
>Password:
>Web Server Host:127.0.0.1
>Web Server Port:80
>Document Root:/Users/richardcatlin/C++Projects/cppcms/examples/hello_world
>Script:/hello.fcgi
>Api:fastcgi
>Socket:/tmp/hello-fcgi-socket
>Server:/usr/local/nginx/sbin/nginx -c /Users/richardcatlin/C++Projects/cppcms/examples/hello_world/cppcms_rundir/cppcms-nginx.conf
>Starting Application Server:/hello.fcgi
>Application Server PID:343
>Starting Web Server
>Web Server PID:345
>
>------------------------------------
>- Press Any Key To Stop The Server -
>------------------------------------
>
>
>------------------------------------------------------------------------------
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.
>http://p.sf.net/sfu/splunk-d2dcopy1
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
|