Jump to content

Webui on server with apache installed


pronkax

Recommended Posts

  • 4 weeks later...
  • 2 months later...

If you want to use a location other than /gui/, like /utorrent/, then change the lines in the httpd.conf to:

ProxyPass /utorrent http://localhost:[port]/gui

ProxyPassReverse /utorrent http://localhost:[port]/gui

and then go to C:\Documents and Settings\[user]\Application Data\uTorrent\webui.zip. Go through all of the javascript files in there and replace "/gui/" with "/utorrent/".

You won't be able to access the webui from the normal port anymore (it will hang at log in), but when you go to http://localhost/utorrent/ it will work like normal.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

antiism I follow ur code but I Get in blank page after logon U can solve?

i have many user in my computer each use one port for utorrent such as

user1: use port 11000

user2: use port 11001

user3: use port 11002

user4: use port 11003

and i use appache 2.2 to forward port to port 80

by this "ProxyPass /gui http://localhost:11001/gui"

that one user can be use at "http://ip/gui/"

how to change "http://ip/gui" into "http://ip/user1" in this newest version of web ui

i change three word of "gui" in script.js but that result in blank page

how can i solve multi user for 80 port by appache 2.2

Link to comment
Share on other sites

  • 3 months later...

I'm using apache and utorrent webUI. I had the same probleme as many others, the 80 port was reserved for apache, so i read some apache docs and figured this out.

With this setting http://server/gui and http://server/torrent works fine.

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

<VirtualHost *:80>

ServerAdmin webmaster@torrentbox

DocumentRoot D:/htdocs/

ServerName torrentbox

ErrorLog logs/torrent_proxy-error_log.txt

TransferLog logs/torrent_proxy-access_log.txt

ProxyPass /torrent http://127.0.0.1:8080/gui

ProxyPass /gui http://127.0.0.1:8080/gui

</VirtualHost>

Link to comment
Share on other sites

I've been struggling with reverseproxying the webui in apache for a few days now, and I've just got it to work. I thought I'd share my solution.

Firstly, we run two instances of utorrent (one downloads allday, the other only on off-peak), so I am using two separate ports, let's call them port 1111 and port 2222.

Secondly, I wanted to map it to something like this: ut.domain.tld/normal and ut.domain.tld/offpeak

After reading about reverse proxy this seemed easy enough and I tried this in my httpd-vhosts.conf:

ProxyPass /normal/ http://localhost:1111/gui/
ProxyPassReverse /normal/ http://localhost:1111/gui/

ProxyPass /offpeak/ http://localhost:2222/gui/
ProxyPassReverse /offpeak/ http://localhost:2222/gui/

Didn't work though, I got the annoying "Loading..." forever. So then I thought it might be a problem with cookies, so I added reverse proxy for them too (well I figured it couldn't hurt to try it):

ProxyPass /normal/ http://localhost:1111/gui/
ProxyPassReverse /normal/ http://localhost:1111/gui/
ProxyPassReverseCookieDomain http://localhost:1111/gui/ http://ut.domain.tld/normal/
ProxyPassReverseCookiePath /gui/ /normal/

ProxyPass /offpeak/ http://localhost:2222/gui/
ProxyPassReverse /offpeak/ http://localhost:2222/gui/
ProxyPassReverseCookieDomain http://localhost:2222/gui/ http://ut.domain.tld/offpeak/
ProxyPassReverseCookiePath /gui/ /offpeak/

Didn't make a difference though. Still hanging on that "Loading..." screen. Very annoying.

So I tried a few different things, nothing of which worked. I'd checked that it was working locally, and I'd tried the ?list=1, and that was spitting out my torrents properly. I didn't know what to do.

Then I checked my javascript error console. Ah, there's the problem:

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://ut.domain.tld/common.js :: Ajax :: line 448" data: no]

Source File: http://ut.domain.tld/common.js

Line: 448

After reading someone mention changing all references to /gui in the .js files I tried it

And now it works!

So in conclusion, if you're mapping your webui to anything other than domain.tld/gui you'll have to find all references to /gui in the js and replace it with whatever subdirectory you want to use.

Just a thought for the next version of the webUI, maybe make it so you can run it from whatever subdirectory you want, without having to delve into the js.

And sorry for the long winded post, but I found this problem most annoying, so I thought I'd share my solution, hope it helps.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hi Folks,

I am very happy that I have found this Reverse Proxy topic...

I have already set up the very simple, apache based reverse proxy described above.

It works like a dream.

The code is, as decribed.:

ProxyPass /gui/ http://localhost:8080/gui/

ProxyPassReverse /gui/ http://localhost:8080/gui/

What I want to achive on top of that is a very simple filtering of HTTP requests.:

I want to filter all HTTP requests which include the "/?action=setsetting" string (or something simmilar)

The reason is this.: I dont want to allow that users modify some "deep" settings.

I am aware ot the Lord Alderan Shell, but I want to have something very simple.

I am quite sure that only one additional line is missing. I have already experimented, but the

Apache docu is quite heavy and has little examples about filtering function...

Cheers

Janos

Link to comment
Share on other sites

  • 6 months later...
  • 8 months later...

This has worked for me without the need for modifying any of the webui javascripts.

<VirtualHost *:80>

DocumentRoot /var/www
ServerName torrents.mydomain.com

RewriteEngine On
RewriteRule ^/gui/?(.*)$ /$1 [R]

<Location />
ProxyPass http://127.0.0.1/gui/
ProxyPassReverse http://127.0.0.1/gui/
</Location>

</VirtualHost>

This assumes 'torrents.mydomain.com' is resolving to the server webui is running on. If utorrent is not running on the server that 'torrents.mydomain.com' is resolving to then just change the '127.0.0.1' to the appropriate place.

As an example lets say you're running uTorrent with webui on your box on your home network on port 8080, and your machine has a IP of '192.168.0.3'. You would change the lines containing '127.0.0.1' to:

    ProxyPass http://192.168.0.3:8080/gui/
ProxyPassReverse http://192.168.0.3:8080/gui/

Hope this helps!

Link to comment
Share on other sites

  • 10 months later...
Aha this works:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

ProxyPass /gui http://localhost:40000/gui
ProxyPassReverse /gui http://localhost:40000/gui

Replace the 40000 with your utorrent/webui port.

Stupid that I didn't think about it myself.

http://localhost/gui/

You have to use /gui

If you do not want to use /gui you'll have to replace all instances of /gui with your prefered word in the webui .js files.

U sir are awesome! TY

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...