首页
友情链接
统计
推荐
上网导航
魔逸网盘
号卡购买
Search
1
为你的服务器添加免费的公网IPv6!
603 阅读
2
使用socat进行端口转发
513 阅读
3
Nginx反代cloudflare站点
420 阅读
4
拥有一个自己的私人网盘—Cloudreve(Linux篇)
259 阅读
5
linux/windows使用rclone挂载OneDrive等各大网盘
223 阅读
默认分类
网络技术
思科模拟器
华为模拟器
企业网络构建
防火墙技术
网站教程
网站源码
登录
/
注册
Search
标签搜索
网络构建
思科模拟器
CISCO
网盘
Linux
Cloudreve
Ubuntu
Centos
bash
子网掩码
ip
网络知识
rclone
OneDrive
Windows
服务器
IPv6
Free
laomoy
累计撰写
17
篇文章
累计收到
26
条评论
首页
栏目
默认分类
网络技术
思科模拟器
华为模拟器
企业网络构建
防火墙技术
网站教程
网站源码
页面
友情链接
统计
推荐
上网导航
魔逸网盘
号卡购买
搜索到
6
篇与
的结果
2023-10-26
Nginx反代cloudflare站点
Nginx反代cloudflare站点报502或403错误解决办法{card-describe title="卡片描述"}在一次安装aapanel面板的时候 发现下载文件的时候非常慢,于是我下载了脚本文件打开发现有 echo "Selected download node..." nodes=(https://node.aapanel.com)于是就开始了“反代之路”发现并没有那么简单,因为cloudflare默认屏蔽了Nginx的反代,直接用反代配置文件肯定报502或者403,捣鼓了一下,所以就有了今天这篇文章额教程~{/card-describe}本文使用 https://node.aapanel.com/ 作为反代目标站点以下是宝塔&aapanel的Nginx默认反代配置文件#PROXY-START/ location ^~ / { proxy_pass https://node.aapanel.com; 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 REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; # proxy_hide_header Upgrade; #Persistent connection related configuration add_header X-Cache $upstream_cache_status; #Set Nginx Cache set $static_filevY6oU8Aw 0; if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ) { set $static_filevY6oU8Aw 1; expires 1m; } if ( $static_filevY6oU8Aw = 0 ) { add_header Cache-Control no-cache; } } #PROXY-END/将上面的配置文件的$host改成你需要反代的目标网站{alert type="warning"}特别注意:在添加反代的时候,格式是http(s)://node.aapanel.com 修改$host的时候仅需填写目标网站的域名即可 不需要写 http(s):// 和 / 否则会报400错误。{/alert}再加这个配置 #反代CF增加规则 proxy_ssl_name $host; #把$host改成目标域名 proxy_ssl_server_name on;完整的 全局 Nginx反代配置文件如下:#PROXY-START/ location ^~ / { proxy_pass https://node.aapanel.com; proxy_set_header Host node.aapanel.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; # proxy_hide_header Upgrade; #Persistent connection related configuration #反代CF增加规则 proxy_ssl_name node.aapanel.com; #把$host改成目标域名 proxy_ssl_server_name on; add_header X-Cache $upstream_cache_status; #Set Nginx Cache set $static_filevY6oU8Aw 0; if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ) { set $static_filevY6oU8Aw 1; expires 1m; } if ( $static_filevY6oU8Aw = 0 ) { add_header Cache-Control no-cache; } } #PROXY-END/方法二(推荐临时使用)指定 路径(aapanel) 全局反代 # PROXY-START/ location /aapanel/ { # 去掉 /aapanel 前缀后再转发 rewrite ^/aapanel(/.*)$ $1 break; proxy_pass https://node.aapanel.com; proxy_set_header Host node.aapanel.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; proxy_ssl_name node.aapanel.com; proxy_ssl_server_name on; add_header X-Cache $upstream_cache_status; set $static_file9uY9s480 0; if ($uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$") { set $static_file9uY9s480 1; expires 1m; } if ($static_file9uY9s480 = 0) { add_header Cache-Control no-cache; } } # PROXY-END/ 现在你就可以成功的反代cloudflare的站点了~
2023年10月26日
420 阅读
5 评论
27 点赞
2023-10-06
使用socat进行端口转发
今天来教大家使用socat工具进行端口转发{card-describe title="socat的介绍"}socat(Socket Cat)是一个多功能的命令行工具,用于在不同的网络通信协议之间建立连接、转发数据、调试网络应用程序等。它可以用于创建虚拟端口、代理网络流量、重定向数据流以及执行其他网络相关的任务。以下是一些 socat 的功能和用途:建立连接:socat 可以用于建立各种类型的网络连接,包括TCP、UDP、UNIX域套接字等。这对于测试网络服务或连接到远程服务器非常有用。转发数据:您可以使用 socat 将数据从一个端口或套接字传输到另一个端口或套接字。这对于端口重定向或端口转发非常有用。代理服务器:socat 可以用作代理服务器,充当数据中转站,将来自客户端的数据传递给目标服务器,并将响应返回给客户端。这对于创建自定义代理服务器非常有用。串口通信:socat 可以用于串口通信,允许您通过串口连接到设备,进行数据传输和控制。加密和解密:socat 可以与加密套接字一起使用,以确保数据在传输过程中得到加密和解密。这对于安全通信非常有用。调试网络应用程序:socat 可以用于调试网络应用程序,例如通过查看数据流量或捕获数据包来诊断问题。虚拟端口:socat 可以用于创建虚拟端口,使应用程序可以通过虚拟端口进行通信,而不是物理串口或网络套接字。文件操作:除了网络通信,socat 还可以用于文件操作,如复制、合并和转换文件。总之,socat 是一个功能强大的工具,可以用于各种网络任务,从简单的端口转发到复杂的网络调试和代理服务器设置。您可以根据需要使用 socat 来满足各种网络通信需求。请注意,socat 的使用需要一定的网络知识和谨慎,因为错误的配置可能导致安全问题或网络故障。以上介绍来自ChatGPT{/card-describe}安装:Ubuntu:sudo apt-get install socat -y Centos:sudo yum install socat -y临时转发(重启或退出终端就失效):socat TCP-LISTEN:<本服务器的端口>,fork TCP:<目标服务器的IP>:<目标服务器的端口>例如:socat TCP-LISTEN:8080,fork TCP:8.8.8.8:443临时转发(后台挂起但重启就失效)nohup socat TCP-LISTEN:<本服务器的端口>,fork TCP:<目标服务器的IP>:<目标服务器的端口> &例如:nohup socat TCP-LISTEN:8080,fork TCP:8.8.8.8:443 &永久转发(重启或退出终端不失效):用systemctl保活sudo vim /etc/systemd/system/socat.service单端口转发示例:[Unit] Description=Socat Port Forwarding Service [Service] ExecStart=/usr/bin/socat TCP-LISTEN:8080,fork TCP:8.8.8.8:443 Restart=always User=root [Install] WantedBy=multi-user.target多端口转发示例:创建一个 socat 脚本文件,例如 socat-script.sh,并添加多个 socat 命令,每个命令负责一个端口转发规则。例如:sudo vim /usr/local/bin/socat-script.shsocat-script.sh内容如下:#!/bin/bash # 切换到脚本所在的目录 cd /usr/local/bin/ # 启动 socat 以前台方式 socat TCP-LISTEN:8080,fork TCP:1.2.3.4:443 & socat TCP-LISTEN:8081,fork TCP:1.2.3.4:8443 & # 无限循环以防止脚本退出 while true; do sleep 10 done然后将 socat-script.sh 脚本文件保存在一个合适的位置,例如 /usr/local/bin 目录下,并确保它具有可执行权限:sudo chmod +x /usr/local/bin/socat-script.sh最后在 socat.service 单元文件的 ExecStart 行中执行该脚本,如下所示:sudo vim /etc/systemd/system/socat.servicesocat.service内容如下:[Unit] Description=Socat Port Forwarding Service [Service] ExecStart=/usr/local/bin/socat-script.sh Restart=always User=root Type=simple [Install] WantedBy=multi-user.target重新加载 systemd 守护进程以读取更新后的服务单元文件:sudo systemctl daemon-reload启用并启动 socat 服务sudo systemctl enable socat.service sudo systemctl start socat.service检查socat服务的状态sudo systemctl status socat.servicesudo systemctl stop socat.service # 停止服务 sudo systemctl restart socat.service # 重新启动服务PS:切记!端口不可用重复的,否则无法启动服务的!
2023年10月06日
513 阅读
3 评论
9 点赞
2023-08-18
为你的服务器添加免费的公网IPv6!
今天教大家获取免费的公网IPv6,准确的说是一个公网的IPv6隧道 并且还是64位的掩码哟~{card-describe title="关于 He.net"}Hurricane Electric 是一家位于美国的全球互联网服务提供商,该公司成立于 1994 年,提供 IPv4 和 IPv6 接入,以及位于美国圣荷西的数据中心服务。该公司是世界上最大的交换中心参与者,其参与的交换中心包括了所有 73 个 Euro-IX 的交换中心。Hurricane Electric(HE.net)运营了许多网络服务,涵盖了多个领域。以下是一些主要的服务:IPv6隧道服务:HE.net 提供了免费的IPv6隧道服务,称为“Tunnel Broker”。这个服务允许用户在IPv4网络上建立一个虚拟的IPv6连接,使他们能够访问IPv6内容,同时也促进了IPv6的采用和推广。BGP Peering服务:Hurricane Electric 运营了全球性的BGP Peering服务,允许其他网络运营商和企业通过BGP协议与他们建立互联,共享路由信息和流量。这有助于改善网络的性能和可靠性。DNS服务:HE.net 提供了递归DNS服务器(RDNSS)以及域名解析服务。他们的DNS服务器可用于解析IPv4和IPv6地址,帮助用户轻松访问互联网内容。IPv6互联网骨干网:Hurricane Electric 维护了一个广泛的IPv6互联网骨干网,使全球范围内的IPv6流量得以顺利传输。这有助于推动IPv6技术的普及和发展。免费IPv6培训:HE.net 提供免费的IPv6培训课程,帮助网络管理员和技术人员了解IPv6的基础知识、部署技巧以及相关的最佳实践。Looking Glass工具:Hurricane Electric 的Looking Glass工具允许用户查询特定的BGP路由信息、网络状态和连接性。这对网络管理员来说是一个有用的诊断工具,帮助他们监控和管理网络。DDoS保护服务:HE.net 提供分布式拒绝服务(DDoS)保护服务,帮助客户防御网络攻击。他们的服务能够检测异常流量并分散攻击流量,从而保护网络免受停机和数据泄露。云计算和服务器托管:除了网络服务,HE.net 还在多个数据中心提供云计算和服务器托管服务。这包括租赁服务器、提供云实例以及其他与数据中心相关的服务。总之,Hurricane Electric 提供了广泛的网络服务,涵盖了互联网连接、IPv6技术、数据中心、域名解析、DDoS保护等多个领域,为客户和网络社区提供了各种有用的工具和资源。以上介绍来自ChatGPT{/card-describe}介绍完毕开始本次的教程,本次教程用到的官网地址是 https://www.tunnelbroker.net/登录后选择创建IPv6 Create Regular TunnelPS:填写VPS的公网IPv4地址进行验证 记得开启 ICMP 需要所有权验证!然后选择你想要的IPv6隧道地区 推荐你这台服务器相近的地区~找到选择配置示例(Example Configurations),选择 Linux-net-tools,然后你会看到这5行配置,复制出来,然后直接粘贴在SSH终端即可!ifconfig sit0 up ifconfig sit0 inet6 tunnel ::216.218.221.6 #隧道通信的IPv4 ifconfig sit1 up ifconfig sit1 inet6 add 2001:***:**:**::*/64 #分配给你的IPv6 route -A inet6 add ::/0 dev sit1执行ip a或ifconfig查看是否添加成功 [root@test-tpe /]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:16:3c:e3:14:e4 brd ff:ff:ff:ff:ff:ff inet 23.***.***.**/28 brd 23.***.***.** scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::216:3cff:fee3:14e4/64 scope link valid_lft forever preferred_lft forever 3: sit0@NONE: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN group default qlen 1000 link/sit 0.0.0.0 brd 0.0.0.0 inet6 ::23.***.***.**/96 scope global valid_lft forever preferred_lft forever inet6 ::127.0.0.1/96 scope host valid_lft forever preferred_lft forever 4: sit1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN group default qlen 1000 link/sit 0.0.0.0 peer 216.218.221.6 inet6 2001:***:**:**::*/64 scope global valid_lft forever preferred_lft forever inet6 fe80::17f8:b05c/64 scope link valid_lft forever preferred_lft forever [root@test-tpe /]# 在网卡 inet6 可以看到有2001开头的IPv6地址,恭喜你已经添加成功了!PS:网卡重启 服务器重启 这些临时配置都会失效的如何实现永久生效呢?Centos教程让脚本开机执行即可 我这里利用Centos的/etc/rc.d/rc.local先创建脚本文件touch /getipv6.sh编辑/getipv6.sh脚本文件,添加配置命令 就是添加上面那5行命令[root@test-tpe /]# ls bin dev lib lost+found mnt patch root sbin sys usr www boot etc home lib64 media opt proc run srv tmp var [root@test-tpe /]# touch /getipv6.sh [root@test-tpe /]# vi /getipv6.sh ifconfig sit0 up ifconfig sit0 inet6 tunnel ::216.218.221.6 ifconfig sit1 up ifconfig sit1 inet6 add 2001:***:**:**::*/64 route -A inet6 add ::/0 dev sit1 #保存后退出(按下Esc后 按住Shift+ZZ即可保存退出)保存后执行 cat /getipv6.sh 查看是否添加进去了[root@test-tpe /]# cat /getipv6.sh ifconfig sit0 up ifconfig sit0 inet6 tunnel ::216.218.221.6 ifconfig sit1 up ifconfig sit1 inet6 add 2001:***:**:**::*/64 route -A inet6 add ::/0 dev sit1 [root@test-tpe /]# 为getipv6.sh文件赋予执行权限[root@test-tpe /]# sudo chmod +x getipv6.sh编辑/etc/rc.d/rc.local文件,添加getipv6.sh脚本配置到rc.local的最后一行 [root@test-tpe /]# vi /etc/rc.d/rc.local [root@test-tpe /]# cat /etc/rc.d/rc.local #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot. touch /var/lock/subsys/local sh /getipv6.sh [root@test-tpe /]#最后为rc.local文件赋予执行权限sudo chmod +x /etc/rc.d/rc.local启用rc-local服务以确保在启动时运行sudo systemctl enable rc-local启动rc-local服务sudo systemctl start rc-localUbuntu教程在Ubuntu系统中,开机自动执行脚本的方式与CentOS略有不同。Ubuntu通常使用systemd作为初始化系统,因此我们使用systemd来管理开机自启动的脚本。创建Service文件: 使用文本编辑器创建一个.service文件,例如:sudo vi /etc/systemd/system/getipv6.service在文件中输入以下内容:[Unit] Description=Get IPv6 Script After=network.target [Service] Type=oneshot ExecStart=/bin/bash -c "ifconfig sit0 up && \ ifconfig sit0 inet6 tunnel ::216.218.221.6 && \ ifconfig sit1 up && \ ifconfig sit1 inet6 add 2001:***:**:**::*/64 && \ route -A inet6 add ::/0 dev sit1" RemainAfterExit=true [Install] WantedBy=default.target PS:请注意,IPv4和IPv6地址需要填写He.net分配给你的 不要直接照搬我的哈~然后保存文件并重新加载 systemd 配置:sudo systemctl daemon-reload随后启用和启动你的 Service:sudo systemctl enable getipv6.service sudo systemctl start getipv6.servicePS:systemd在大多数现代Linux发行版中被广泛使用,Centos也可以用Ubuntu的方法。配置完成后 重启服务器后会自动执行脚本 做到重启后IPV6隧道也不失效啦~
2023年08月18日
603 阅读
2 评论
86 点赞
2023-04-23
拥有一个自己的私人网盘—Cloudreve(Linux篇)
在上一篇文章中,我们在Windows上搭建了属于自己的Cloudreve私人网盘,今天我们来学习如何在Linux下搭建Cloudreve,同样也非常简单~拥有一个自己的私人网盘—Cloudreve(Windows篇)☞点我直达今天呢就教大家做一个自己的私人网盘!Cloudreve一款支持多家云存储的开源免费云盘系统 Cloudreve官网:https://cloudreve.org/Cloudreve Github:https://github.com/cloudreve/Cloudreve这是我的网盘https://pan.myycu.cn/感兴趣的小伙伴可以去康康喔~教程开始,首先准备好你的服务器(系统linux发行版本都可以)cloudreve_3.7.1_linux_amd64.tar.gz的程序包我这里演示使用的是腾讯云的Ubuntu 18.04.4 LTS,啥居然不知道自己操作系统/版本?执行以下命令即可查看自己的操作系统/版本ubuntu@VM-4-17-ubuntu:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" ubuntu@VM-4-17-ubuntu:~${cloud title="Cloudreve_3.7.1_linux" type="default" url="https://pan.myycu.cn/s/WBwUa" password="qn0pti"/}{cloud title="Cloudreve Github_3.7.1" type="default" url="https://github.com/cloudreve/Cloudreve/releases/tag/3.7.1" password=""/}Cloudreve_3.7.1_linux 是本站提供的高速下载地址Cloudreve Github_3.7.1是官方的Release下载地址我们先下载Cloudreve的Linux程序包ubuntu@VM-4-17-ubuntu:~$ wget https://github.com/cloudreve/Cloudreve/releases/download/3.7.1/cloudreve_3.7.1_linux_amd64.tar.gz --2023-04-23 22:10:17-- https://github.com/cloudreve/Cloudreve/releases/download/3.7.1/cloudreve_3.7.1_linux_amd64.tar.gz Resolving github.com (github.com)... 20.205.243.166 Connecting to github.com (github.com)|20.205.243.166|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/120156076/c476dc07-fbdd-498c-adec-c0b64cb960f4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230423%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230423T141017Z&X-Amz-Expires=300&X-Amz-Signature=1c718bb2b49e78fd2ac696e03c37999051a1566d7b665b2bcafed4856ca5fae1&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=120156076&response-content-disposition=attachment%3B%20filename%3Dcloudreve_3.7.1_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream [following] --2023-04-23 22:10:18-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/120156076/c476dc07-fbdd-498c-adec-c0b64cb960f4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230423%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230423T141017Z&X-Amz-Expires=300&X-Amz-Signature=1c718bb2b49e78fd2ac696e03c37999051a1566d7b665b2bcafed4856ca5fae1&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=120156076&response-content-disposition=attachment%3B%20filename%3Dcloudreve_3.7.1_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.111.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 24560355 (23M) [application/octet-stream] Saving to: ‘cloudreve_3.7.1_linux_amd64.tar.gz’ cloudreve_3.7.1_linux_amd64.tar.gz 32%[===============> ] 7.57M 26.1KB/s eta 9m 8s可以看到,速度是相当的感人哈,所以推荐使用本站提供的高速下载链接来下载,下载好了以后手动上传到服务器的网站运行目录即可!(嫌麻烦的可以一直等待它下好~)这里为了大众 我就等待它下载完经过漫长的等待 总算是下载好啦~下载好了以后我们切换到root账号 并进入ubuntu用户目录下 我们可以看到有我们刚刚下载的cloudreve_3.7.1_linux_amd64.tar.gz压缩包ubuntu@VM-4-17-ubuntu:~$ sudo -i root@VM-4-17-ubuntu:~# cd /home root@VM-4-17-ubuntu:/home# ls lighthouse ubuntu root@VM-4-17-ubuntu:/home# cd ubuntu root@VM-4-17-ubuntu:/home/ubuntu# ls cloudreve_3.7.1_linux_amd64.tar.gz root@VM-4-17-ubuntu:/home/ubuntu#我们将cloudreve_3.7.1_linux_amd64.tar.gz压缩包解压为了方便管理cloudreve我们这里在新建个cloudreve文件夹,再把cloudreve程序放进去解压root@VM-4-17-ubuntu:/home/ubuntu# ls cloudreve_3.7.1_linux_amd64.tar.gz root@VM-4-17-ubuntu:/home/ubuntu# mkdir cloudreve root@VM-4-17-ubuntu:/home/ubuntu# mv cloudreve_3.7.1_linux_amd64.tar.gz cloudreve root@VM-4-17-ubuntu:/home/ubuntu# ls cloudreve root@VM-4-17-ubuntu:/home/ubuntu# cd cloudreve/ root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# ls cloudreve_3.7.1_linux_amd64.tar.gz root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# tar -zxvf cloudreve_3.7.1_linux_amd64.tar.gz LICENSE README.md README_zh-CN.md cloudreve root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# ls cloudreve cloudreve_3.7.1_linux_amd64.tar.gz LICENSE README.md README_zh-CN.md root@VM-4-17-ubuntu:/home/ubuntu/cloudreve#得到cloudreve主程序,现在我们赋予它执行权限root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# chmod +x ./cloudreve root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# ll total 67756 drwxr-xr-x 2 root root 4096 Apr 23 22:43 ./ drwx------ 8 ubuntu ubuntu 4096 Apr 23 22:36 ../ -rwxr-xr-x 1 501 staff 44763173 Feb 13 19:39 cloudreve* -rw-rw-r-- 1 ubuntu ubuntu 24560355 Feb 13 19:42 cloudreve_3.7.1_linux_amd64.tar.gz -rw-r--r-- 1 501 staff 35146 Feb 4 19:39 LICENSE -rw-r--r-- 1 501 staff 4035 Feb 9 20:45 README.md -rw-r--r-- 1 501 staff 3904 Feb 9 20:45 README_zh-CN.md有了执行权限它就可以运行啦输入./cloudreve即可启动root@VM-4-17-ubuntu:/home/ubuntu/cloudreve# ./cloudreve ___ _ _ / __\ | ___ _ _ __| |_ __ _____ _____ / / | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \ / /___| | (_) | |_| | (_| | | | __/\ V / __/ \____/|_|\___/ \__,_|\__,_|_| \___| \_/ \___| V3.7.1 Commit #f172220 Pro=false ================================================ [Info] 2023-04-23 22:44:35 Initializing database connection... [Info] 2023-04-23 22:44:35 Start initializing database schema... [Info] 2023-04-23 22:44:35 Admin user name:
[email protected]
[Info] 2023-04-23 22:44:35 Admin password: cqkXTX6k [Info] 2023-04-23 22:44:37 Start executing database script "UpgradeTo3.4.0". [Info] 2023-04-23 22:44:37 Finish initializing database schema. [Info] 2023-04-23 22:44:37 Initialize task queue with WorkerNum = 10 [Info] 2023-04-23 22:44:37 Initialize crontab jobs... [Info] 2023-04-23 22:44:37 Current running mode: Master. [Info] 2023-04-23 22:44:37 Listening to ":5212" 我们可以看到cloudreve的账号信息,一定要保存好,这些信息只有第一次运行才会显示!如果忘了或者不小心关掉了终端 有两个办法可以解决1.最简单的就是删除cloudreve.db文件 重新再运行一次cloudreve就可以啦 (因为cloudreve.db是数据库文件 一旦删除,cloudreve所有的数据都会没有了 请谨慎操作!)2.在cloudreve程序目录下执行./cloudreve --database-script ResetAdminPassword 就会重设初始管理员(即UID为1的用户)的密码,新密码会在命令行日志中输出,请注意保存~.\cloudreve --database-script ResetAdminPasswordCloudreve 默认监听5212端口,如不想使用默认的 编辑cloudreve目录下的“conf.ini”文件修改你想要的端口即可~现在用浏览器打开你服务器的公网IP+5212就可以访问啦~是不是很简单呢有些小伙伴可能发现了,关掉终端或使用Ctrl后cloudreve就无法访问了,那是因为你关闭了cloudreve进程,现在就教大家使用进程守护来保持cloudreve在后台持续运行!# 编辑配置文件 vi /usr/lib/systemd/system/cloudreve.service将PATH_TO_CLOUDREVE 更换为你cloudreve的程序目录[Unit] Description=Cloudreve Documentation=https://docs.cloudreve.org After=network.target Wants=network.target [Service] WorkingDirectory=/PATH_TO_CLOUDREVE ExecStart=/PATH_TO_CLOUDREVE/cloudreve Restart=on-abnormal RestartSec=5s KillMode=mixed StandardOutput=null StandardError=syslog [Install] WantedBy=multi-user.target例如:[Unit] Description=Cloudreve Documentation=https://docs.cloudreve.org After=network.target Wants=network.target [Service] WorkingDirectory=/home/ubuntu/cloudreve ExecStart=/home/ubuntu/cloudreve/cloudreve Restart=on-abnormal RestartSec=5s KillMode=mixed StandardOutput=null StandardError=syslog [Install] WantedBy=multi-user.target编辑完后 按下键盘的Esc :wq 即可保存以下是systemctl常用的命令# 更新配置 systemctl daemon-reload # 启动服务 systemctl start cloudreve # 设置开机启动 systemctl enable cloudreve管理命令# 启动服务 systemctl start cloudreve # 停止服务 systemctl stop cloudreve # 重启服务 systemctl restart cloudreve # 查看状态 systemctl status cloudreve
2023年04月23日
259 阅读
5 评论
30 点赞
2023-04-17
拥有一个自己的私人网盘—Cloudreve(Windows篇)
目前免费的网盘有很多 我用过的网盘有很多比如,百度网盘、阿里云盘、天翼云盘、腾讯微云、蓝奏云存储、迅雷云盘 都有一些特点那就是 容量大但是限速,容量小不限速的,基本上都是各种限制 没办法企业也需要生存下去的呀,正所谓熊掌不可兼得!拥有一个自己的私人网盘—Cloudreve(Linux篇)☞点我直达今天呢就教大家做一个自己的私人网盘!Cloudreve一款支持多家云存储的开源免费云盘系统 Cloudreve官网:https://cloudreve.org/Cloudreve Github:https://github.com/cloudreve/Cloudreve这是我的网盘https://pan.myycu.cn/感兴趣的小伙伴可以去康康喔~现在教程正式开始!首先准备好你的服务器+Cloudreve的程序包 {cloud title="Cloudreve" type="default" url="https://pan.myycu.cn/s/nZ8FN" password="f62m7y"/}{cloud title="Cloudreve Github_3.7.1" type="default" url="https://github.com/cloudreve/Cloudreve/releases/tag/3.7.1" password=""/}我这里演示的环境是Windows沙盒+cloudreve_3.7.1_windows_amd64的程序包首先解压压缩包,目录下有个cloudreve cloudreve就是主程序直接双击运行即可 会弹出一个cmd输出,首次运行cloudreve会在运行目录下创建一个名为cloudreve.db文件,这是cloudreve的数据库通过图片我们可以看到cloudreve的账号信息,一定要保存好,这些信息只有第一次运行才会显示!如果忘了或者不小心关掉cmd窗口了 有两个办法可以解决 1.最简单的就是删除cloudreve.db文件 重新再运行一次cloudreve就可以啦 (因为cloudreve.db是数据库文件 一旦删除,cloudreve所有的数据都会没有了 请谨慎操作!)2.在cloudreve程序目录下执行.\cloudreve --database-script ResetAdminPassword 就会重设初始管理员(即UID为1的用户)的密码,新密码会在命令行日志中输出,请注意保存~.\cloudreve --database-script ResetAdminPasswordCloudreve 默认监听5212端口,如不想使用默认的 编辑cloudreve目录下的“conf.ini”文件修改你想要的端口即可~现在用浏览器打开你服务器的公网IP+5212就可以访问啦~是不是很简单呢啥?不知道你服务器的IP是多少?打开cmd输入ipconfig /allPS:由于我演示的环境在Windows沙盒,局域网环境 所以我没有公网IP!通过图片可以看到IP是172.21.115.175,我们在浏览器中输入http://172.21.115.175:5212输入cloudreve第一次生成的账号密码就可以登陆啦cloudreve后台:http://IP:5212/admin到这里我们的Cloudreve(Windows篇)教程就结束啦!
2023年04月17日
64 阅读
0 评论
7 点赞
1
2