AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1626595
Accepted
BespokeChaplain
BespokeChaplain
Asked: 2021-02-17 12:09:00 +0800 CST2021-02-17 12:09:00 +0800 CST 2021-02-17 12:09:00 +0800 CST

多用户的syncthing + apache反向代理

  • 772

好的,所以我有点母马。

在一台计算机上,我有三个用户,例如user1、user2和user3。8384每个用户分别在/ 22000、8385/22001和8386/上运行同步和监听22002。

对于每个用户,我都设置了一个带有反向代理的 Apache 虚拟主机。虚拟主机文件的内容是(比如 for user1):

<VirtualHost *:80>
ServerName user1.syncthing.mydomain.com

ErrorDocument 404 /404.html

RewriteEngine On
ProxyRequests Off
ProxyPreserveHost On

ProxyPass / "http://localhost:8384/"
ProxyPassReverse / "http://localhost:8384/"
<Proxy *>
Order deny,allow
Allow from localhost
</Proxy>

ErrorLog ${APACHE_LOG_DIR}/user1_syncthing_error.log
CustomLog ${APACHE_LOG_DIR}/user1_syncthing_access.log combined

RewriteCond %{SERVER_NAME} =user1.syncthing.mydomain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

我已验证 syncthing 正在为每个用户在正确的端口上运行

$ sudo lsof -i -P -n | grep syncthing | grep LISTEN
syncthing   649         user2   12u  IPv6  23903      0t0  TCP *:22001 (LISTEN)
syncthing   649         user2   17u  IPv4  19216      0t0  TCP 127.0.0.1:8385 (LISTEN)
syncthing   656         user1   16u  IPv6  14254      0t0  TCP *:22000 (LISTEN)
syncthing   656         user1   19u  IPv4  23931      0t0  TCP 127.0.0.1:8384 (LISTEN)
syncthing   668         user3   13u  IPv6  23921      0t0  TCP *:22002 (LISTEN)
syncthing   668         user3   19u  IPv4  18427      0t0  TCP 127.0.0.1:8386 (LISTEN)

user1.syncthing.mydomain.com此外,尝试连接到远程计算机user2.syncthing.mydomain.com并user3.syncthing.mydomain.com从远程计算机都将我发送到正确的 IP 地址。

但!该设置仅适用于user1!使用 telnet 检查服务器上的连接user2并user3告诉我

Trying <correct IP address>
telnet: Unable to connect to remote host: Connection refused

并从远程计算机告诉我(暂停后)

Trying <correct IP address>
telnet: Unable to connect to remote host: No route to host

我还尝试更改虚拟主机文件user3以匹配user1,但问题仍然存在。

当我大约一周前第一次设置它时,这个设置很有效,并且文件夹与当时设置的机器同步仍然有效,我只是在进入配置 GUI 时遇到了麻烦。

我猜有一些关于页面的实际服务我弄错了,但我正在失去头发试图找出什么。

networking apache-http-server
  • 1 1 个回答
  • 129 Views

1 个回答

  • Voted
  1. Best Answer
    BespokeChaplain
    2021-02-17T14:33:00+08:002021-02-17T14:33:00+08:00

    问题在于我是如何发夹的——在添加主机条目时,我用手指指了指 IP 地址:user1.syncthing.mydomain.com指向 192.168.20.12(正确),但user2.syncthing.mydomain.com都user3.syncthing.mydomain.com指向 192.168.10.12(错误)。

    当我在问题描述中说 telnet 将转到正确的地址时,我没有注意到10/的20区别!

    • 0

相关问题

  • 用户使用 FileZilla 连接到 SFTP 服务器拒绝连接

  • apache2 可以在没有 conf 文件的情况下工作吗?

  • NAT 后面的 NAT 如何工作(路由器的 NAT 和 ISP 的 NAT)?

  • Win10 1803:如何让移动热点成为专用网络?

  • nc如何识别服务名称

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve