我在家用服务器上安装了 deluge 服务器和 web-gui(它实际上运行的是 debian)。以前它运行良好,但现在由于某种原因,deluge web 服务器在“127.0.0.1 : 8112”上启动,这意味着我无法从另一台机器访问 web gui。我如何配置 deluge 以在外部接口上启动,例如“192.168.1.50:8112”。
这是 deluge-web 日志文件(我使用 -L 调试标志启动了 deluge-web)
[INFO ] 18:36:46 ui:121 Deluge ui 1.3.10
[DEBUG ] 18:36:46 ui:122 options:
{'fork': False, 'profile': False,
'loglevel': 'debug', 'quiet': False,
'ssl': False, 'base': None,
'logfile': '/var/log/deluge/web-gui.log',
'config': None, 'port': None}
[DEBUG ] 18:36:46 ui:123 args: []
[INFO ] 18:36:46 ui:124 Starting web ui..
[DEBUG ] 18:36:47 configmanager:111 Getting config 'web.conf'
[DEBUG ] 18:36:47 config:197 Setting 'sidebar_show_zero' to False of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'show_session_speed' to False of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'first_login' to True of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'https' to False of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'sessions' to {} of <type 'dict'>
[DEBUG ] 18:36:47 config:197 Setting 'enabled_plugins' to [] of <type 'list'>
[DEBUG ] 18:36:47 config:197 Setting 'cert' to ssl/daemon.cert of <type 'str'>
[DEBUG ] 18:36:47 config:197 Setting 'pkey' to ssl/daemon.pkey of <type 'str'>
[DEBUG ] 18:36:47 config:197 Setting 'port' to 8112 of <type 'int'>
[DEBUG ] 18:36:47 config:197 Setting 'theme' to gray of <type 'str'>
[DEBUG ] 18:36:47 config:197 Setting 'session_timeout' to 3600 of <type 'int'>
[DEBUG ] 18:36:47 config:197 Setting 'show_sidebar' to True of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'default_daemon' to of <type 'str'>
[DEBUG ] 18:36:47 config:197 Setting 'sidebar_multiple_filters' to True of <type 'bool'>
[DEBUG ] 18:36:47 config:197 Setting 'base' to / of <type 'str'>
[DEBUG ] 18:36:47 config:391 Config /home/deluge/.config/deluge/web.conf version: 1.1
loaded: {'port': 8112, 'enabled_plugins': [], 'theme': u'gray',
'show_sidebar': True, 'sidebar_show_zero': True,
'pkey': u'ssl/deluge-ssl.key.protected',
'https': True, 'sessions': {},
'base': u'/', u'interface': u'192.168.1.45',
'show_session_speed': False, 'first_login': False,
'cert': u'ssl/deluge-ssl.crt', 'session_timeout': 3600,
'default_daemon': u'', 'sidebar_multiple_filters': True}
[DEBUG ] 18:36:47 server:253 Adding directory `/usr/lib/python2.7/dist-packages/deluge/ui/web/css` with path ``
[DEBUG ] 18:36:47 server:253 Adding directory `/usr/lib/python2.7/dist-packages/deluge/ui/web/icons` with path ``
[DEBUG ] 18:36:47 server:253 Adding directory `/usr/lib/python2.7/dist-packages/deluge/ui/web/images` with path ``
[DEBUG ] 18:36:47 json_api:315 Registering method: web.add_host
[DEBUG ] 18:36:47 json_api:315 Registering method: web.add_torrents
[DEBUG ] 18:36:47 json_api:315 Registering method: web.connect
[DEBUG ] 18:36:47 json_api:315 Registering method: web.connected
[DEBUG ] 18:36:47 json_api:315 Registering method: web.deregister_event_listener
[DEBUG ] 18:36:47 json_api:315 Registering method: web.disconnect
[DEBUG ] 18:36:47 json_api:315 Registering method: web.download_torrent_from_url
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_config
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_events
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_host_status
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_hosts
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_magnet_info
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_plugin_info
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_plugin_resources
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_plugins
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_torrent_files
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_torrent_info
[DEBUG ] 18:36:47 json_api:315 Registering method: web.get_torrent_status
[DEBUG ] 18:36:47 json_api:315 Registering method: web.register_event_listener
[DEBUG ] 18:36:47 json_api:315 Registering method: web.remove_host
[DEBUG ] 18:36:47 json_api:315 Registering method: web.set_config
[DEBUG ] 18:36:47 json_api:315 Registering method: web.start_daemon
[DEBUG ] 18:36:47 json_api:315 Registering method: web.stop_daemon
[DEBUG ] 18:36:47 json_api:315 Registering method: web.update_ui
[DEBUG ] 18:36:47 json_api:315 Registering method: web.upload_plugin
[DEBUG ] 18:36:47 configmanager:111 Getting config 'hostlist.conf.1.2'
[DEBUG ] 18:36:47 config:197 Setting 'hosts' to
[('eb5a43f81b25b5f4bd68c01ffe686794eda9ba54', '127.0.0.1', 58846, '', '')] of <type 'list'>
[WARNING ] 18:36:47 config:361 Unable to open config file
/home/deluge/.config/deluge/hostlist.conf.1.2:
[Errno 2] No such file or directory: '/home/deluge/.config/deluge/hostlist.conf.1.2'
[DEBUG ] 18:36:47 coreconfig:43 CoreConfig init..
[DEBUG ] 18:36:47 sessionproxy:55 SessionProxy init..
[DEBUG ] 18:36:47 json_api:315 Registering method: auth.change_password
[DEBUG ] 18:36:47 json_api:315 Registering method: auth.check_session
[DEBUG ] 18:36:47 json_api:315 Registering method: auth.delete_session
[DEBUG ] 18:36:47 json_api:315 Registering method: auth.login
[DEBUG ] 18:36:47 configmanager:111 Getting config 'web.conf'
[DEBUG ] 18:36:47 pluginmanagerbase:65 Plugin manager init..
[DEBUG ] 18:36:47 configmanager:111 Getting config 'web.conf'
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Extractor 0.4 at /usr/lib/python2.7/dist-packages/deluge/plugins/Extractor-0.4.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Execute 1.3 at /usr/lib/python2.7/dist-packages/deluge/plugins/Execute-1.3.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Blocklist 1.3 at /usr/lib/python2.7/dist-packages/deluge/plugins/Blocklist-1.3.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: AutoAdd 1.04 at /usr/lib/python2.7/dist-packages/deluge/plugins/AutoAdd-1.04.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Label 0.2 at /usr/lib/python2.7/dist-packages/deluge/plugins/Label-0.2.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Notifications 0.2 at /usr/lib/python2.7/dist-packages/deluge/plugins/Notifications-0.2.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: WebUi 0.1 at /usr/lib/python2.7/dist-packages/deluge/plugins/WebUi-0.1.egg
[DEBUG ] 18:36:47 pluginmanagerbase:124 Found plugin: Scheduler 0.2 at /usr/lib/python2.7/dist-packages/deluge/plugins/Scheduler-0.2.egg
[INFO ] 18:36:47 server:661 Starting server in PID 15148.
[DEBUG ] 18:36:47 server:589 Enabling SSL using:
[DEBUG ] 18:36:47 server:590 Pkey: ssl/deluge-ssl.key.protected
[DEBUG ] 18:36:47 server:591 Cert: ssl/deluge-ssl.crt
[INFO ] 18:36:47 server:681 serving on 0.0.0.0:8112 view at https://127.0.0.1:8112
在我的 web.conf 文件中,我尝试设置interface
参数:
{ “文件”:1,“格式”:1}{“端口”:8112,“enabled_plugins”:[],“主题”:“灰色”,“show_sidebar”:true,“sidebar_show_zero”:true,“pkey”:“ssl / deluge-ssl.key.protected”,“https”:true,“会话”:{},“base”:“/”,“接口”:“192.168.1.45”,“show_session_speed”:false,“first_login”:false,“cert”:“ssl / deluge-ssl.crt”,“session_timeout”:3600,“default_daemon”:“”,“sidebar_multiple_filters”:true}
deluge-web.log 文件中的这一行显示了这一点:
'base': u'/', u'interface': u'192.168.1.45',
但它似乎什么也没做,因为最终的效果是
[INFO ] 18:36:47 server:681 serving on 0.0.0.0:8112 view at https://127.0.0.1:8112
答案1
查看 deluge 代码的“web”文件夹中的 server.py 文件,其中有以下内容:
672 def start_normal(self):
673 self.socket = reactor.listenTCP(self.port, self.site)
674 log.info("serving on %s:%s view at http://127.0.0.1:%s", "0.0.0.0",
675 self.port, self.port)
676
677 def start_ssl(self):
678 check_ssl_keys()
679 self.socket = reactor.listenSSL(self.port, self.site, ServerContextFactory())
680 log.info("serving on %s:%s view at https://127.0.0.1:%s", "0.0.0.0",
681 self.port, self.port)
因此,对于 deluge-web 1.3.10,它是硬编码的https://127.0.0.1
。所以我们不应该关注日志文件中的这一行。在接口 0.0.0.0 上启动 deluge 实际上也使其可供外部计算机使用。
就我而言,deluge-web 启动正常,真正的问题是 SSL 证书配置错误。