Answer the question
In order to leave comments, you need to log in
How to properly configure RVM, Thin and Nginx?
Hi friends!
I install Thin for the first time, I can't set it up all day.
There is a Debian 7 x64 server, installed Ruby via RVM and gems rails and thin, Nginx.
Thin starts up normally and works from the project folder with the command thin start
There is a line in the manual: /usr/sbin/update-rc.d -f thin defaults
Which showed me an error:
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match thin Default-Stop values (S 0 1 6)
insserv: warning: current stop runlevel(s) (0 1 6) of script `thin' overrides LSB defaults (0 1 6 S).
then start your Thin cluster like this:
thin start -s3 -p 5000
To connect to Nginx using UNIX domain sockets edit the upstream block in your nginx config file:
nginx.conf
upstream backend {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
server unix:/tmp/thin.2.sock;
}
Answer the question
In order to leave comments, you need to log in
1. Yes, there is nothing in one user mode thin service - about runlevel
2. It is understood that three servers are launched on one machine and serve requests from clients, in your case there are 3 of them. Used for load balancing, for example when one server is doing a "heavy" task and more requests are coming in from clients.
2.1 The port can be used any higher than 1024.
2.2 Thin servers, by default, will be available on the network with the address, if memory does not change, 0.0.0.0 (i.e. any), to bind to a specific address, you must run with the key -a , example thin -a 127.0.0.1
About upstream in the nginx config, just the same, it is used to create a pool for the purpose of load balancing, only you have Unix sockets in your settings, (running thin -S /tmp/thin.sock -s3)
About linking with php, you will need before setting up Nginx for a specific configuration, i.e. what will be the backend for php (apache.fastcgi), and what are the conditions for redirecting to this backend.
Something like this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question