Httprpc question

simur612

Member
May 25, 2018
879
0
16
Hi there everyone!
I have a question: I decided to use httprpc plugin, so I enabled it in plugins.
The only thing that I did besides that is edit my server's apache2.conf and commented the line
Code:
SCGIMount /RPC2 127.0.0.1:5000
Then restarted apache...
Rutorrent seems OK after the restart...
Is there anything else I should do? I noticed that in my conf directory of apache2, under mods-enabled I have scgi.load. Do I have to remove it from there, or commenting the line takes care of everything?
Is there anything else I should do???
Thanks a lot!


EDIT: Just realized that commenting the line in apache2.conf caused transdroid to fail to connect to my installation (it uses /RPC in settings)
If I have both httprpc and the setting in apache2.conf enabled, will the webgui use less bandwidth getting the benefit from httprpc? (and transdroid will manage to connect..huh.gif)
 

randac56

Member
May 25, 2018
915
0
16
If I have both httprpc and the setting in apache2.conf enabled, will the webgui use less bandwidth getting the benefit from httprpc? (and transdroid will manage to connect.. huh.gif )
Yes. ruTorrent will use httprpc (if you enable it in plugins), transdroid will use rpc mount point. But don't forget to protect /RPC2 with login/password.
 

simur612

Member
May 25, 2018
879
0
16
Thanks very much both of you!
I guess that if httprpc is active and I get the benefits for bandwidth, then keeping mod scgi for transdroid is not a problem!

P.S. My /RPC2 is protected, so I guess i am OK..
P.P.S.: Just for the sake of it, I will try what Kolor said, just to see what happens..

EDIT:OK, Kolor, I gave it a try and seems to work!
Thanks a lot for this!
So I am back to my initial question, since transdroid works: Besides commenting the line
Code:
SCGIMount /RPC2 127.0.0.1:5000
in apache2.conf and restarting apache, is there anything else I must do? Do I need to also remove the entry for the RPC2 protection or anything else?
Thanks once again guys!!
 

simur612

Member
May 25, 2018
879
0
16
I get a prompt for username/password and once I insert them I get
Code:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
undecided.gif

I believe that I must have done something wrong...I say that because
I have SCGIMount /RPC2 127.0.0.1:5000 commented in apache2.conf. If I disable httprpc plugin and reload the page I get no error from ruTorrent...
Even If I remove the plugin from plugins directory I get no error
Shouldn't I get an error that rutorrent cannot connect or something like that (or did I understand the whole thing wrong??)
 

randac56

Member
May 25, 2018
915
0
16
I have SCGIMount /RPC2 127.0.0.1:5000 commented in apache2.conf. If I disable httprpc plugin and reload the page I get no error from ruTorrent...
May be, you have enabled plugin 'rpc'? If no - check web-server access log.
 

simur612

Member
May 25, 2018
879
0
16
I have two rutorrent installations on the same server. In the main installation I had httprpc enabled and rpc disabled, but on the svn one, they were both enabled..
Perhaps one installation is affecting the other...
 

simur612

Member
May 25, 2018
879
0
16
OK.. I disabled plugins in both locations
Closed firefox, let it alone for a couple of minutes and then re-opened the address of my rutorrent.
A strange thing I noticed: Firefox prompts for login twice - once for accessing the webpage and once for accessing /RPC2 (same user/pass but different login messages..) In
The access log shows the following (I have changed IPs and web addresses)
See attached file - couldn't post it, it exceeds 20000 characters
 

simur612

Member
May 25, 2018
879
0
16
EDIT: I think I found what was wrong...but still not exactly sure..
In /etc/apache2/sites-available/default I had the following:
Code:
SCGIMount /RPC2 127.0.0.1:5000
<location /RPC2>
AuthName "rTorrent secure access"
AuthType Basic
AuthBasicProvider file
AuthUserFile /var/www/rutorrentpath/.htpasswd
Require user rutorrentuser
I suppose that the first line SCGIMount /RPC2 127.0.0.1:5000 was supposed to be commented? Anyway I commented it and It stills requires to enter user/pass twice, but the access log now, regarding RPC, writes:
Quote
193.xxx.xxx.xxx - rutorrentuser [26/Sep/2012:12:19:44 +0300] "POST /RPC2 HTTP/1.1" 404 524 "http://my.server.address/rutorrentpath/" "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"​

In the attached txt it was
Quote
193.xxx.xxx.xxx - - [26/Sep/2012:11:54:36 +0300] "POST /RPC2 HTTP/1.1" 401 793 "http://my.server.address/rutorrentpath/" "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"​

Now, when I enter http://my.server.address/RPC2 I don't get
Code:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.anymore, I get a 404 page not found
So I guess it is OK?

P.S.: RuTorrent responds as it should now: Having not a valid RPC2 and with plugins disabled, it says no connection to rtorrent
P.P.S.: But what is trying to access /RPC2 and I get the second login prompt?
I am guessing rutorrent, because it starts to try with plugins, sees no relative plugins and then tries the SCGI mount? (Just confirmed that this must be correct, because I enabled httprpc, reloaded rutorrent, it connects to rtorrent normally and no second login prompt pops up...)
I should remove the protection from RPC2 completely, I suppose, since it is not used anymore.
 

simur612

Member
May 25, 2018
879
0
16
I guess, this is because your main web page and /RPC2 has a different realms (AuthName in apache terms).
I don't think that this is the case... You see http://my.server.address/rutorrent_path was being protected by .htaccess/htpasswd which were in a folder inside the server. And then, wanting to protect /RPC2, too, I pointed to the same .htaccess/htpasswd files. So aren't they the same realms?
I tend to believe that my previous assumption is valid :
I am guessing rutorrent, because it starts to try with plugins, sees no relative plugins and then tries the SCGI mount?​
because with plugins disabled and RPC2 disabled, in access.log it was showing attempt to access /RPC2 and it was getting a 404 page.
But after enabling the plugins, the access.log was showing no attempt to access /RPC2 - I am guessing because the job could be done with the plugins and did not go any further trying to connect differently...
 

peshua19

Member
May 25, 2018
897
0
16
Your wrote above: "Firefox prompts for login twice - once for accessing the webpage and once for accessing /RPC2 (same user/pass but different login messages..)"
If FF auth dialog has a different login messages - then /rpc and main page has a differrent realms.