uTorrent or Transmission web interface hosted on web server

0

Is it possible to host my Transmission or uTorrent web interface on my web server? They have a local network web interface, and I don't want to port forward... Can I somehow configure it to it to log into my server and host the interface there?

tekknolagi

Posted 2011-08-09T03:29:34.440

Reputation: 1 130

2You could set up a reverse proxy over an SSH tunnel... if you really wanted to... – cdhowie – 2011-08-09T03:35:53.237

How would I go about that? – tekknolagi – 2011-08-09T03:57:04.273

1It was kind of a joke. But you could do it by using the -R argument to ssh to reverse-forward a port to your torrent client's web interface, if your hosting company allows -R. Then you'd set up a reverse proxy in Apache over the forwarded port. – cdhowie – 2011-08-09T04:08:19.057

wow.... o.O interesting! i think i might. thank you! – tekknolagi – 2011-08-09T04:09:23.987

enjoy the rep from upvoted comments :) – tekknolagi – 2011-08-09T04:09:36.607

1@tekknolagi, you don't get rep for upvoted comments...sorry. Only questions. – tombull89 – 2011-08-09T08:33:33.923

1@cdhowie, you might want to consider posting this suggestion as an answer, since it seems to have been helpful to the OP. – DMA57361 – 2011-08-09T08:58:04.807

oh....darn. he should answer it then – tekknolagi – 2011-08-09T17:38:52.010

@cdhowie answer it! and more upvotes if you include some detail :) – tekknolagi – 2011-08-09T17:39:19.170

Answers

0

Port forwarding would have served as an appropriate answer... It works flawlessly.

tekknolagi

Posted 2011-08-09T03:29:34.440

Reputation: 1 130

2

Ok, since all of you asked for a kludge, here it is.

You can set it up so you can access the web interface through your web hosting account, with the following restrictions:

  • The actual interface will still be hosted by your torrent client, but you will be able to reach it via your website.
  • Your host must allow remote port forwards (ssh -R). Most VPS hosts will allow this; shared hosting will probably not.
  • Your host must allow you to configure Apache with the ProxyPass directive, which means that you must have write access to some part of the Apache config (not .htaccess files) and your host must load (or allow you to load) mod_proxy into Apache.
  • Your host should allow the installation of an SSH public key so that you can survive an ssh disconnection without needing to enter a password to reconnect.

Here's the basic idea. Let's call the port that your web interface is served on locally port L. Pick some random port in the range 49152-65535 and call it S; this is the port that the server will be listening on.

Create an SSH key for this setup, and do not encrypt the private key with a password (hit enter when prompted). Use ssh-keygen for this. (ssh-keygen -f $KEY_OUTPUT_PATH -- pick some file like $HOME/torrentproxy.key for the output path.) Then install the public key on the server: ssh-copy-id -i $KEY_OUTPUT_PATH.pub user@yourwebhost.

Create a shell script torrent-ssh-proxy.sh with these contents:

#!/bin/sh

while true; do
    # Replace S and L with the ports chosen above.
    # Replace $KEY_OUTPUT_PATH with the path to your SSH private key.
    ssh -i $KEY_OUTPUT_PATH -R S:localhost:L user@yourwebhost

    echo 'Disconnected from server.'
    sleep 5
done

When you run this, you should get a shell prompt from the server with no password entry required; this is good. Leave this script running.

(At this point, you might verify that the remote host is in fact listening on port S by running netstat -tnlp | grep :S in the server shell.)

Now we need to configure Apache. You just need to add this to your Apache config (it won't work from .htaccess files):

ProxyPass /torrentweb http://localhost:S/

Again, replace S with the listening port chosen. Restart Apache.

If this all worked, when you go to http://yourwebsite.example.com/torrentweb you should see your torrent client's web interface.

Note that you can run the ssh client on a different box from the web host; just adjust "localhost" in the ssh line in the script to match the IP address or hostname of the machine running the torrent web interface.


Regarding loading mod_proxy, this is how the module is loaded on Debian:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so

The path to mod_proxy.so is likely to be different depending on your distribution's way of arranging package contents in the filesystem.

cdhowie

Posted 2011-08-09T03:29:34.440

Reputation: 368

Is the Apache config /etc/httpd/conf/httpd.conf ? – tekknolagi – 2011-08-09T20:42:15.620

Depending on your distro, yes, it could very well be that. – cdhowie – 2011-08-09T20:44:01.150

Shoot. Is there an alternative file that could have the same effect? On WebFaction (my provider) I cannot edit that file. Could I place the line somewhere else? – tekknolagi – 2011-08-09T20:45:35.017

You may be given a per-account Apache config file. Contact your host for assistance with this. Also, not that your host must have mod_proxy loaded; I would suspect that they do not. – cdhowie – 2011-08-09T20:47:58.697

How would I load mod_proxy? That might be a good thing to add – tekknolagi – 2011-08-09T20:49:14.467

1I've added a short paragraph on the loading of mod_proxy. – cdhowie – 2011-08-10T19:09:43.150

here's my OS: Linux web201.webfaction.com 2.6.18-238.9.1.el5PAE #1 SMP Tue Apr 12 18:52:55 EDT 2011 i686 i686 i386 GNU/Linux – tekknolagi – 2011-08-10T19:21:58.530

That's your kernel build, but not your distro. I was looking at webfaction -- do you have a hosting plan, or a dedicated server plan? – cdhowie – 2011-08-10T19:55:21.253

Hosting plan...and how do i find my distro? – tekknolagi – 2011-08-10T21:55:22.177

1If you are on the hosting plan then this probably won't work (but it might). There is no bulletproof way to determine your distro. – cdhowie – 2011-08-10T22:21:09.120