-
Notifications
You must be signed in to change notification settings - Fork 413
NGINX PHP FPM RTORRENT
young-druid edited this page Dec 17, 2014
·
1 revision
The following group should be created: rtorrent-socket
We assume that rtorrent is running under rtorrent user.
NGINX worker is running under www-data user.
PHP-FPM worker(s) is running under rutorrent user.
All three users belong to rtorrent-socket group.
In .rtorrent.rc file the following lines should be added
execute.nothrow = rm,~/.rtorrent.sock
network.scgi.open_local = /home/rtorrent/.rtorrent.sock
schedule = socket_chmod,0,0,"execute=chmod,0660,~/.rtorrent.sock"
schedule = socket_chgrp,0,0,"execute=chgrp,rtorrent-socket,~/.rtorrent.sock"
We assume that in /etc/php5/fpm/php.ini you have the following setting:
cgi.fix_pathinfo=1
In that case you can have the following configuration inside /etc/php5/fpm/pool.d/rutorrent.conf
[rutorrent]
user = rutorrent
group = rutorrent
listen = /var/run/php-fpm-rutorrent.sock
listen.owner = rutorrent
listen.group = www-data
listen.mode = 0660
pm = static
pm.max_children = 2
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
Inside your http section of nginx.conf you should include the following lines:
upstream backendrutorrent {
server unix:/var/run/php-fpm-rutorrent.sock;
}
upstream backendrtorrent {
server unix:/home/rtorrent/.rtorrent.sock;
}
And inside server section include the lines below:
location /rutorrent {
access_log /var/log/nginx/rutorrent.access.log;
error_log /var/log/nginx/rutorrent.error.log;
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backendrutorrent;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/rutorrent$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}
location /RPC2 {
access_log /var/log/nginx/rutorrent.rpc2.access.log;
error_log /var/log/nginx/rutorrent.rpc2.error.log;
include /etc/nginx/scgi_params;
scgi_pass backendrtorrent;
}
- Home
- Downloading
- Installation and configuration
-
Plugins
- Current plugins
- _cloudflare
- _getdir
- _noty
- _noty2
- _task
- AutoTools
- Check_Port
- Chunks
- Cookies
- Cpuload
- Create
- Data
- DataDir
- Diskspace
- Dump
- Edit
- Erasedata
- ExtRatio
- ExtSearch
- Feeds
- FileDrop
- GeoIP
- History
- HttpRPC
- IPad
- LoginMgr
- LookAt
- Mediainfo
- Ratio
- Retrackers
- RPC
- RSS
- RSSURLRewrite
- Rutracker_check
- Scheduler
- Screenshots
- SeedingTime
- Show Peers Like Wtorrent
- Source
- Spectrogram
- Theme
- Throttle
- TrackLabels
- Traffic
- Unpack
- UploadETA
- XMPP
- 3rd Party Plugins
- Current plugins
- Usage
- Versions
- Error Messages
- Future Plans
- Special Thanks