使用Syncthing自建私有同步盘教程
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

简介
syncthing应该是目前开源界人气最高的一款同步盘程序了,这个主打私有,真的完全私有。。。没有公开分享的功能,并且同步必须要两端相互添加对方许可才行。
毕竟是基于GO开发的,搭建都很简单,并且官方提供了二进制文件,下载即用:
wget https://github.com/syncthing/syncthing/releases/download/v1.0.0/syncthing-linux-amd64-v1.0.0.tar.gztar -xzvf syncthing-linux-amd64-v1.0.0.tar.gzcd syncthing-linux-amd64-v1.0.0cp syncthing /usr/bin| 1234 | wget https://github.com/syncthing/syncthing/releases/download/v1.0.0/syncthing-linux-amd64-v1.0.0.tar.gztar -xzvf syncthing-linux-amd64-v1.0.0.tar.gzcd syncthing-linux-amd64-v1.0.0cp syncthing /usr/bin |
这里我还是按照自己的习惯把程序配置成systemd的服务:
vi /etc/systemd/system/syncthing.service| 1 | vi /etc/systemd/system/syncthing.service |
写入:
[Unit]Description=Syncthing - Open Source Continuous File SynchronizationAfter=network.target[Service]User=rootExecStart=/usr/bin/syncthing -no-restart -logflags=0Restart=on-failureSuccessExitStatus=3 4RestartForceExitStatus=3 4ProtectSystem=fullPrivateTmp=trueSystemCallArchitectures=nativeMemoryDenyWriteExecute=trueNoNewPrivileges=true[Install]WantedBy=default.target| 123456789101112131415161718 | [Unit]Description=Syncthing - Open Source Continuous File SynchronizationAfter=network.target [Service]User=rootExecStart=/usr/bin/syncthing -no-restart -logflags=0Restart=on-failureSuccessExitStatus=3 4RestartForceExitStatus=3 4ProtectSystem=fullPrivateTmp=trueSystemCallArchitectures=nativeMemoryDenyWriteExecute=trueNoNewPrivileges=true [Install]WantedBy=default.target |
然后运行:
systemctl start syncthing| 1 | systemctl start syncthing |
设置开机启动:
systemctl enable syncthing| 1 | systemctl enable syncthing |
因为syncthing默认只监听本地,所以我们要用Nginx做一下反向代理,但是syncthing新版本加入了一个主机头检测的功能,这个要关闭,不然Nginx无法进行反代:
vi ~/.config/syncthing/config.xml| 1 | vi ~/.config/syncthing/config.xml |
在GUI设置的下面加入:
true
如图所示:
然后重启:
| 1 | systemctl restart syncthing |
安装Nginx:
yum -y install nginx| 1 | yum -y install nginx |
新建一个Nginx站点配置文件:
vi /etc/nginx/conf.d/syncthing.conf| 1 | vi /etc/nginx/conf.d/syncthing.conf |
写入:
server { listen 5862; client_max_body_size 100000m; server_name example.com;location /syncthing/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:8384/; proxy_read_timeout 600s; proxy_send_timeout 600s; }}| 1234567891011121314151617 | server { listen 5862; client_max_body_size 100000m; server_name example.com; location /syncthing/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:8384/; proxy_read_timeout 600s; proxy_send_timeout 600s; }} |
这里我把syncthing监听在了5862端口,不是常规端口,因为这个WEBUI初次启动的时候是没有密码验证的,为防止滥用建议监听一个高位端口,后续我们登录进去设置了密码再修改回80都可以的。
现在启动Nginx以及设置开机启动
systemctl start nginxsystemctl enable nginx| 12 | systemctl start nginxsystemctl enable nginx |
现在打开你的站点域名:
http://example.com:5862/syncthing
应该可以访问到这个同步盘的首页:
现在你应该立即给这个WEBUI设置密码:
Windows客户端的话,我个人推荐这个:https://github.com/canton7/SyncTrayzor
下载:https://github.com/canton7/SyncTrayzor/releases/download/v1.1.22/SyncTrayzorSetup-x64.exe
测试了一下功能,可以正常同步:
[资源]历史优惠活动内容
猜你可能想看的VPS
- racknerd→高配便宜 VPS $29 年 KVM 虚拟 VPS 4全球[VPS测评]
- 景文互联→日本服务器月付 900 元起 软银+CN2 线路 快速上架日本VPS[主机]
- 199 元 年 1G 内存 20G 硬盘 2Mbps@不限量 KVM 香香港VPS[主机]
- ¥163 年 512M 内存 20G SSD 100Mbps 不限流量 WINDOWS
- 特价 Hostodo→ 1 核 512MB 内存 8GB NVMe 硬盘全球[VPS测评]
- 傲游主机春季促销→全场 75 折 XEN KVM 香港&日本&韩国&新加日本VPS[主机]
- 促销 傲游主机→日本大阪终身 75 折 全场 8 折优惠日本VPS[主机]
- 微信支付→支付失败!当前页面的 URL 未注册全球[VPS测评]
- AuroraCloud→180 元 月 1GB 内存 20GB SSD 虚拟空间(主机)
- raksmart 美国大陆优化服务器带宽速度及综合性能测评,raksma独立服务器[U]
- XKCDN→亚洲 美国等节点 不限流量 月付 0.99 元;有国内节点美国VPS[主机]
- 做站 腾讯云双 11 秒杀活动→国内云服务器低至 88 元 年 香港免备香港VPS[主机]
- Uncaught SyntaxError: Block-scoped d全球[VPS测评]
- 数脉科技香港服务器五一促销,阿里云网络与自治网络自由切换,10M 无限流香港VPS[主机]
- racknerd 劳动节促销,便宜高性价比美国 vps,3 核 3G 内美国VPS[主机]
- 狗云 VPS:五大 CN2 GIA 直连数据中心 圣何塞 CN2 GIA全球[VPS测评]
- CubeCloud 2核心 1G内存 15G SSD 1T流量 1G带宽全球[VPS测评]
- DMIT.io 香港VPS CVM N3系列香港VPS[主机]
- 中概股扫描网传拼多多正筹备跨境电商平台首站登陆美国美国VPS[主机]
- 2022年最新的15个美容院抖音文案,美容院文案怎么写全球[VPS测评]
- 乐趣云怎么样?香港美国云服务器首月8.8元,新增IP5元/个美国VPS[主机]
- 云服务器和服务器各有什么优缺点?全球[VPS测评]
- LOCVPS,全新香港大浦CN2 VPS 2核4G内存3M仅54/月香港VPS[主机]
- 易凡云:国内洛阳BGP,辽宁BGP防CC,云服务器低至48.26元/月,香港VPS[主机]
- 景林网络:香港CN2vps,1核1G3M月付35元;美国高防vps,48美国VPS[主机]
- 6种样式社交论坛网站HTML5模板 - Social全球[VPS测评]
- kvmcloud怎么样?香港BGP云服务器 月付12.9元香港VPS[主机]
- 好朋友51WORLD启动“地球克隆计划5”,我要去元宇宙参加了全球[VPS测评]
- 自适应bootstrap左侧导航可关闭全球[VPS测评]
- 常见的CN2,GIA,CIA 各个网络线路解释全球[VPS测评]
转载请注明原文地址:http://140.238.13.167:12355/read-21606.html











