使用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
- 90VM→45 元 月 1GB 内存 8GB SSD 空间 1TB 流量虚拟空间(主机)
- 阿里云 - 8 月 ECS 限量抢 2C8G5M 三年付 3000 元全球[VPS测评]
- tudcloud 香港沙田大带宽 vps 七折起,100M 带宽无限流量香港VPS[主机]
- vultr→上韩国云服务器 SK 机房 大陆直连不绕道韩国VPS[主机]
- Skynode→€19 月 i3-2120 16G 内存 1TB 硬盘 全球[VPS测评]
- 标准互联→90 元 月-4GB 80GB 30M 无限流量 洛杉矶(CN全球[VPS测评]
- 宝塔面板开启 Memcache 及 Memcached 缓存的方法全球[VPS测评]
- kvmla 折上折促销,香港 日本 新加坡,vps8 折+充 500 送独立服务器[U]
- 搬瓦工 DC6 限量版补货,最便宜的美国 cn2vps,优质稳定靠谱的三美国VPS[主机]
- 高速 tmhhost→1G 1 核 20G 15M 1T 流量 季付¥9全球[VPS测评]
- 滴盾双十二东莞BGP独立服务器16核32G内存500G流量G口50m带宽独立服务器[U]
- HostNamaste印度商家:美国/法国便宜KVM VPS 1核1G/美国VPS[主机]
- HostSlim Cyber Monday 荷兰便宜OpenVZ VPS全球[VPS测评]
- VPSnet.com立陶宛便宜vps,€1.99起/月-基于Virtuo全球[VPS测评]
- 如何设置指定路径跳转指定域名?全球[VPS测评]
- 云计算拯救互联网巨头:谁抢跑,谁追赶?全球[VPS测评]
- SugarHosts糖果主机双十一大促销 虚拟主机最高6折优惠全球[VPS测评]
- 拼多多也要做跨境电商?出海之路能一帆风顺吗,了解一下全球[VPS测评]
- 云计算的大门依旧没向雷军敞开全球[VPS测评]
- 消费复苏形势良好,我们将多措并举实施扩大内需政策全球[VPS测评]
- 奇异互动,2核4G香港云服务器仅655元/年,注册领550元新手大礼包香港VPS[主机]
- 自适应bootstrap左侧导航可关闭全球[VPS测评]
- Bloggar-移动端友好的新闻博客类HTML5模板全球[VPS测评]
- 云服务器都是有哪些特点?全球[VPS测评]
- 宏海数据9.9云服务器:香港VPS CN2线路1核1G 9.9/首月香港VPS[主机]
- 极光KVM:美国香港vps CN2 GIA专线高速稳定,BGP服务器低至美国VPS[主机]
- 阿里云香港服务器多少钱一年?阿里云香港云服务器如何购买?香港VPS[主机]
- JGKVM活动钜惠:美国cn2,香港cmi,大带宽vps,三网直连,10美国VPS[主机]
- 酷锐云元旦钜惠:大量香港/美国vps优惠码,香港1核2G云主机仅20元/美国VPS[主机]
- 美云香港云服务器怎么样?1核1G香港云服务器价格99元/月香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-31339.html











