I'm trying to use a UNIX socket for communication between rTorrent and ruTorrent, rather than a TCP port. To be clear, it currently works using these config values:
Code: (.rtorrent.rc)
scgi_port = 127.0.0.1:5000
Code: (ruTorrent config.php)
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
I am running nginx with php5-fpm, and my nginx site has this block:
Code:
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php5-fpm-sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_param HTTPS on;
}
Then I have a file /etc/nginx/conf.d/php-sock.conf:
Code:
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.soc;
}
My understanding is that this passes any php files through to php-fpm using FastCGI. Under my web root is a rutorrent directory, and I have an nginx location block used to set up basic HTTP auth - this seems to work fine. I've seen a lot of talk about rpc plugin, etc. and I have not configured any of these to my knowledge, but in my nginx log file I see listed POST /rutorrent/plugins/httprpc.
Anyway, to try a unix socket I've set it up like this:
.rtorrent.rc:
Code:
scgi_local = /var/run/rtorrent/rtorrent-scgi.soc
ruTorrent config.php:
Code:
$scgi_port = 0;
$scgi_host = "unix:///var/run/rtorrent/rtorrent-scgi.soc";
But rtorrent gives the usual message 'No connection to rtorrent, check scgi_port and scgi_host' etc. I checked that rtorrent had created the socket and then tried adjusting the permissions on it and the /var/run/rtorrent directory but the error persisted. Even setting rwx for everyone did not work.
So why can't rutorrent find the socket to communicate with rtorrent? Like I said, works fine using a port.
Thanks in advance.
Code: (.rtorrent.rc)
scgi_port = 127.0.0.1:5000
Code: (ruTorrent config.php)
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
I am running nginx with php5-fpm, and my nginx site has this block:
Code:
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php5-fpm-sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_param HTTPS on;
}
Then I have a file /etc/nginx/conf.d/php-sock.conf:
Code:
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.soc;
}
My understanding is that this passes any php files through to php-fpm using FastCGI. Under my web root is a rutorrent directory, and I have an nginx location block used to set up basic HTTP auth - this seems to work fine. I've seen a lot of talk about rpc plugin, etc. and I have not configured any of these to my knowledge, but in my nginx log file I see listed POST /rutorrent/plugins/httprpc.
Anyway, to try a unix socket I've set it up like this:
.rtorrent.rc:
Code:
scgi_local = /var/run/rtorrent/rtorrent-scgi.soc
ruTorrent config.php:
Code:
$scgi_port = 0;
$scgi_host = "unix:///var/run/rtorrent/rtorrent-scgi.soc";
But rtorrent gives the usual message 'No connection to rtorrent, check scgi_port and scgi_host' etc. I checked that rtorrent had created the socket and then tried adjusting the permissions on it and the /var/run/rtorrent directory but the error persisted. Even setting rwx for everyone did not work.
So why can't rutorrent find the socket to communicate with rtorrent? Like I said, works fine using a port.
Thanks in advance.