使用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
- CentOS 7.x 系统安装和配置redis-7.0.4集群 全球[VPS测评]
- 7月份,经济复苏边际趋缓,央行降息幅度先稳后升 全球[VPS测评]
- 因搜包耽误员工下班,苹果将支付3050万美元赔款 全球[VPS测评]
- 曾经最大跨境电商平台团队收缩,只剩20人丨GoingGlobal周报 全球[VPS测评]
- 快速云:云服务器vps的区别是什么云服务器和vps哪个比较好2022-0 全球[VPS测评]
- 新华全媒+丨第六届全球跨境电商大会:跨境电商加快拓宽中国贸易新通道 全球[VPS测评]
- 快速云:科普云服务器服务器的概念和作用2022-08-2313:26来源 全球[VPS测评]
- 阿里行癫:如何理解当下的云计算 全球[VPS测评]
- 云计算竞争日趋白热化云计算行业市场前景分析 全球[VPS测评]
- 谷歌浏览器网址如何显示http,www,Chrome谷歌浏览器恢复地址栏 全球[VPS测评]
- tudcloud,香港沙田大带宽vps特惠7折,CN2+BGP直连,10 香港VPS[主机]
- 印象云vps,香港安畅gia低至22元起,1核1G内存,小带宽无限流量, 香港VPS[主机]
- 奇异互动,2核4G香港云服务器仅655元/年,注册领550元新手大礼包 香港VPS[主机]
- edgeNAT:2021元旦vps促销_全场韩国/美国/香港VPS低至7 韩国VPS[主机]
- 易凡云:香港CN2 2核2G云服务器仅29.78元/月,357元/年 香港VPS[主机]
- 硅云:香港免备案云服务器仅232元/年;香港2核2G2M仅482元/年 香港VPS[主机]
- 野草云:2021开年大促 – 香港VPS 136.8元年起;香港服务器3 香港VPS[主机]
- 傲游主机:香港CN2高防云主机8折158元/月起(最高50G防御/2核2 香港VPS[主机]
- m247服务器:香港/日本/新加坡/美国/欧洲等36个机房,1G~10G 日本VPS[主机]
- UCloud香港云服务器;企业89元/年,个人134元/年,最高可三年 香港VPS[主机]
- 易探云:香港云服务器2核2G5M首月39元,带1G防御,年付6.8折优惠 香港VPS[主机]
- V5.NET:香港/美国云服务器7折月付42港元起;香港物理服务器月付3 美国VPS[主机]
- 长三角地区的算力需求规模到底有多大? 全球[VPS测评]
- 购买香港服务器需要做哪些准备 香港VPS[主机]
- 创意IT服务公司主页网站模板 - Softets 全球[VPS测评]
- 做跨境电商,如何打造私域流量? 全球[VPS测评]
- JGKVM活动钜惠:美国cn2,香港cmi,大带宽vps,三网直连,10 美国VPS[主机]
- 印象云怎么样?85折香港安畅CN2vps带宽3M月付23元 香港VPS[主机]
- 啤啤云怎么样?香港CN2线路vps,有香港安畅机房,全部9折,38.7元 香港VPS[主机]
- 香港vps免费:青云互联,1核1G/50G硬盘/500GB流量/2M带宽 香港VPS[主机]
转载请注明原文地址: http://140.238.13.167:12355/read-28100.html











