纯IPV6服务器(Euserv)安装哪吒面板


本次实验在Euserv上安装哪吒面板。无需通过宝塔面板反代,直接通过Nginx反代,并解决在安装过程中出现的重启面板失败的问题
  1. 重启并更新面板
  2. [14926] INTERNAL ERROR: cannot create temporary directory!
  3. [14927] INTERNAL ERROR: cannot create temporary directory!
  4. [14928] INTERNAL ERROR: cannot create temporary directory!
  5. 重启失败,可能是因为启动时间超过了两秒,请稍后查看日志信息

准备工作

1、安装基本的的软件包

  1. apt upgrade -y
  1. apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates

2、安装warp,解决无法获取github的问题

本次用到的是甬哥的Cloudflare warp多功能一键脚本

  1. wget -N --no-check-certificate https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh && bash CFwarp.sh

3、安装nginx

  1. apt install nginx -y

安装 Docker 以及 Docker Compose 参考

使用官方源安装 Docker

1、加入 Docker 的 GPG 公钥和 apt 源

  1. curl -sS https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
  1. echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://download.docker.com/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list

2、更新系统后即可安装 Docker CE

  1. apt update
  1. apt-get install docker-ce docker-ce-cli containerd.io

3、使用 docker version 命令检查是否安装成功

安装 Docker Compose

1、使用 Docker 官方发布的 Github 直接安装最新版本:

  1. curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose
  1. chmod +x /usr/local/bin/docker-compose

2、使用 docker-compose version 命令检查是否安装成功

哪吒探针面板安装

具体教程请参考

  1. curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh
  1. ./nezha.sh

通过acme申请证书

1、安装acme:

  1. curl https://get.acme.sh | sh

2、添加软链接

  1. ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh

3、切换CA机构

  1. acme.sh --set-default-ca --server letsencrypt

4、申请证书

  1. acme.sh --issue -d abc.com -k ec-256 --webroot /var/www/html

5、安装证书

  1. acme.sh --install-cert -d abc.com --ecc --key-file /root/cert/private.key --fullchain-file /root/cert/cert.crt --reloadcmd "systemctl force-reload nginx"

设置反向代理

1、备份原配置文件

  1. cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak

2、修改nginx.conf

  1. vi /etc/nginx/nginx.conf

清空内容,替换成下面的内容

  1. user www-data;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. include /etc/nginx/modules-enabled/*.conf;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. sendfile on;
  10. tcp_nopush on;
  11. tcp_nodelay on;
  12. keepalive_timeout 65;
  13. types_hash_max_size 2048;
  14. include /etc/nginx/mime.types;
  15. default_type application/octet-stream;
  16. gzip on;
  17. server {
  18. listen [::]:443 ssl;
  19. listen 443 ssl;
  20. # listen [::]:80 ipv6only=on;
  21. # listen 80;
  22. server_name abc.com; #你的域名
  23. ssl_certificate /root/cert/cert.crt; #证书位置
  24. ssl_certificate_key /root/cert/private.key; #私钥位置
  25. ssl_session_timeout 1d;
  26. ssl_session_cache shared:MozSSL:10m;
  27. ssl_session_tickets off;
  28. ssl_protocols TLSv1.2 TLSv1.3;
  29. ssl_prefer_server_ciphers off;
  30. location /
  31. {
  32. proxy_pass http://127.0.0.1:8008;
  33. proxy_set_header Host $host;
  34. }
  35. location /ws
  36. {
  37. proxy_pass http://127.0.0.1:8008;
  38. proxy_http_version 1.1;
  39. proxy_set_header Upgrade $http_upgrade;
  40. proxy_set_header Connection "Upgrade";
  41. proxy_set_header Host $host;
  42. }
  43. }
  44. server {
  45. listen 80;
  46. location /.well-known/ {
  47. root /var/www/html;
  48. }
  49. location / {
  50. rewrite ^(.*)$ https://$host$1 permanent;
  51. }
  52. }
  53. }

评论

此博客中的热门博文

纯IPV6 VPS安装hysteria、x-ui面板,并实现多VPS轮换

CentOS7修改默认SSH端口