Access by WebUI on shared host


merlinuwe

Recommended Posts

I run btsync under debian 6 on a hosted webspace by starting it in the directory "www/btsync" with the command "./btsync"

 

How can I access to bittorrent sync via the WebUI? Access with the url "xxx.xxx.xxx.xxx:8888/gui" doesn't work.

 

(If I run it by "./btsync --config sync.conf", the WebUI doesn't work, too - but it is possible to sync with other peers.)

 

On my FreeNAS at home I can access the WebUI. Is it only possible to access the WebUI in a local network?

 

Greetings

 

merlinuwe

Link to comment
Share on other sites

{   "device_name": "servername.de btsync",  "listening_port" : 0,                       // 0 - randomize port  /* storage_path dir contains auxilliary app files   if no storage_path field: .sync dir created in the directory    where binary is located.   otherwise user-defined directory will be used *///  "storage_path" : "/home/user/.sync",    "storage_path" : "/home/www/doc/41467373/servername.de/www/btsync/.sync",  // uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/btsync/btsync.pid",   "pid_file" : "/home/www/doc/41467373/servername.de/www/btsync/btsync.pid",     "check_for_updates" : true,   "use_upnp" : true,                              // use UPnP for port mapping/* limits in kB/s   0 - no limit*/  "download_limit" : 0,                         "upload_limit" : 0, /* remove "listen" field to disable WebUI   remove "login" and "password" fields to disable credentials check*/  "webui" :  {    "listen" : "serverip:44444",    "login" : "thisisthelogin",    "password" : "thisisapassword"  }/* !!! if you set shared folders in config file WebUI will be DISABLED !!!   shared directories specified in config file   override the folders previously added from WebUI.*/  ,  "shared_folders" :  [    {//  use --generate-secret in command line to create new secret      "secret" : "thesecretissecret",                   // * required field      "dir" : "/home/www/doc/41467373/servername.de/www/Austausch", // * required field//  use relay server when direct connection fails      "use_relay_server" : true,      "use_tracker" : true,       "use_dht" : true,      "search_lan" : false,//  enable sync trash to store files deleted on remote devices      "use_sync_trash" : true,//  specify hosts to attempt connection without additional search           "known_hosts" :      [        "anotherservername.no-ip.org:32725"      ]    }  ]// Advanced preferences can be added to config file.// Info is available in BitTorrent Sync User Guide.,"disk_low_priority": true,"rate_limit_local_peers": false,"folder_rescan_interval": 600,"sync_max_time_diff": 600,"lan_encrypt_data": true,"sync_trash_ttl": 30,"lan_use_tcp": false,"send_buf_size": 5,"max_file_size_diff_for_patching": 1000,"recv_buf_size": 5,"max_file_size_for_versioning": 1000}

This is the code of my sync.config, which runs and syncs ok, but without WebUI.

 

Could you please be so kind to change it, that I can run the WebUI? 

Link to comment
Share on other sites

-snip-

This is the code of my sync.config, which runs and syncs ok, but without WebUI.

 

Could you please be so kind to change it, that I can run the WebUI? 

 

 

It clearly notates:-

// !!! if you set shared folders in config file WebUI will be DISABLED !!!

So, there's your issue. Here's a fully edited version (With comments removed as I find them annoying):-

{	"device_name": "servername.de btsync",	"listening_port": 0,	"storage_path": "/home/www/doc/41467373/servername.de/www/btsync/.sync",	"pid_file": "/home/www/doc/41467373/servername.de/www/btsync/btsync.pid",	"check_for_updates": true,	"use_upnp": true,	"download_limit": 0, //kB/s	"upload_limit": 0, //kB/s	"webui": {		"listen": "serverip:44444",		"login": "thisisthelogin",		"password": "thisisapassword"	},	"disk_low_priority": true,	"rate_limit_local_peers": false,	"folder_rescan_interval": 600,	"sync_max_time_diff": 600,	"lan_encrypt_data": true,	"sync_trash_ttl": 30,	"lan_use_tcp": false,	"send_buf_size": 5,	"max_file_size_diff_for_patching": 1000,	"recv_buf_size": 5,	"max_file_size_for_versioning": 1000}

If you want to add the comments back, there should be zero issue.

Link to comment
Share on other sites

Thanks for your help, now I use your sync.config (with my server, path etc.) and have a connection to btsync installed on my notebook like before.

 

But I cannot yet access the WebUI.

 

I tested your sync.conf with 

  • i386
  • lInux i386(glibc 2.3)

Both releases are running fine (which of them is the right for debian 6?) but as I said, without access to the WebUI.

 

What can I do to solve the problem?

Link to comment
Share on other sites


Here are some informations to the OS:

 

uname -a

Linux www809 2.6.26-2-xen-686 #1 SMP Wed Sep 21 09:56:47 UTC 2011 i686 GNU/Linux

 

 


cat /etc/debian_version

6.0.8

 


 


ldd --version

 

ldd (Debian EGLIBC 2.11.3-4) 2.11.3

Copyright © 2009 Free Software Foundation, Inc.

 

 

So I think, btsync 386 should be the right release.

Link to comment
Share on other sites

Thanks for your help, now I use your sync.config (with my server, path etc.) and have a connection to btsync installed on my notebook like before.

 

But I cannot yet access the WebUI.

 

I tested your sync.conf with 

  • i386
  • lInux i386(glibc 2.3)

Both releases are running fine (which of them is the right for debian 6?) but as I said, without access to the WebUI.

 

What can I do to solve the problem?

Okay, two more things to try, one listening on ALL hosts (You may have set up your listening port incorrectly):-

 

Replace:

"listen": "serverip:44444",

With:-

"listen": "0.0.0.0:44444",

And try that config. If it still doesn't work, can you go ahead and type (While BTSync is running):-

curl http://127.0.0.1:8085/gui/en/index.html -i -u username:password | egrep "HTTP|Set-Cookie"

Obviously replacing username and password. You may also want to remove the value of the GUID cookie.

 

I'm not sure if it's just not listening, or, only listening to certain devices. You may also want to try netstat with and without BTSync running, to make sure nothing else is listening on that port, also, try changing the port around.

Link to comment
Share on other sites

I tried "listen": "0.0.0.0:44444",

and couldn't access the WebUI.

 

Then I tried (after changing the sync.conf to port 8888)

 

curl http://127.0.0.1:8888/gui/en/index.html -i -u mybtsyncusername:mybtsyncpassword | egrep "HTTP|Set-Cookie"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15837  100 15837    0     0  15837      0  0:00:01 --:--:--  0:00:01 15.1M
HTTP/1.1 200 OK
Set-Cookie: GUID=yvOUYUyLejOr7TQd0vFa; path=/

 

 

and couldn't access the WebUI, too.

 

 

When I tried

 

curl http://127.0.0.1:8888/gui/en/index.html -i -u username:mypassword | egrep ""

 

I got the websites html-code.

.

 

When I tried

 

netstat -a

 

I saw, that port 8888 is listed somewhere:

 

netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:8000                  *:*                     LISTEN
tcp        0      0 *:60384                 *:*                     LISTEN
tcp        0      0 localhost:submission    *:*                     LISTEN
tcp        0      0 *:sunrpc                *:*                     LISTEN
tcp        0      0 *:auth                  *:*                     LISTEN
tcp        0      0 *:4433                  *:*                     LISTEN
tcp        0      0 *:33907                 *:*                     LISTEN
tcp        0      0 *:ftp                   *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 *:8888                  *:*                     LISTEN
tcp        0      0 localhost:smtp          *:*                     LISTEN
tcp        0      0 *:10972                 *:*                     LISTEN
 

 

So I changed the port it in the sync.conf to a few numbers, at last to 8080 and now IT WORKS!

 

(BTW: It doesn't matter if I use 0.0.0.0:8080 or ip-address:8080)

 

MANY thanks for your help!

Link to comment
Share on other sites

MANY thanks for your help!

 

Actually, I'm super confused on what was happening, if you could connect via localhost, it sounds like it was listening. My best guess is that considering 8080 is a very popular port, for some reason it was let past your firewall while all other ports were blocked.

 

May I ask, do you have a firewall setup/does your host have any firewalls?

Link to comment
Share on other sites

This is the/a working configuration on my shared host:

 

In the sync.conf:

-----snip-----"webui": {                "listen": "server-ip:8080",                "login": "whatever",                "password": "whatevertoo"},-----snip-----

The url in the Browser is:

http://server-ip:8080/gui/de/index.html

 

The port-number must be the same, of course.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.