纯IPV6服务器(Euserv)安装哪吒面板
本次实验在Euserv上安装哪吒面板。无需通过宝塔面板反代,直接通过Nginx反代,并解决在安装过程中出现的重启面板失败的问题
重启并更新面板
[14926] INTERNAL ERROR: cannot create temporary directory!
[14927] INTERNAL ERROR: cannot create temporary directory!
[14928] INTERNAL ERROR: cannot create temporary directory!
重启失败,可能是因为启动时间超过了两秒,请稍后查看日志信息
准备工作
1、安装基本的的软件包
apt upgrade -y
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates
2、安装warp,解决无法获取github的问题
本次用到的是甬哥的Cloudflare warp多功能一键脚本
wget -N --no-check-certificate https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh && bash CFwarp.sh
3、安装nginx
apt install nginx -y
安装 Docker 以及 Docker Compose 参考
使用官方源安装 Docker
1、加入 Docker 的 GPG 公钥和 apt 源
curl -sS https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
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
apt update
apt-get install docker-ce docker-ce-cli containerd.io
3、使用 docker version 命令检查是否安装成功
安装 Docker Compose
1、使用 Docker 官方发布的 Github 直接安装最新版本:
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
2、使用 docker-compose version 命令检查是否安装成功
哪吒探针面板安装
具体教程请参考
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh
./nezha.sh
通过acme申请证书
1、安装acme:
curl https://get.acme.sh | sh
2、添加软链接
ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh
3、切换CA机构
acme.sh --set-default-ca --server letsencrypt
4、申请证书
acme.sh --issue -d abc.com -k ec-256 --webroot /var/www/html
5、安装证书
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、备份原配置文件
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
2、修改nginx.conf
vi /etc/nginx/nginx.conf
清空内容,替换成下面的内容
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
server {
listen [::]:443 ssl;
listen 443 ssl;
# listen [::]:80 ipv6only=on;
# listen 80;
server_name abc.com; #你的域名
ssl_certificate /root/cert/cert.crt; #证书位置
ssl_certificate_key /root/cert/private.key; #私钥位置
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
location /
{
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $host;
}
location /ws
{
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
server {
listen 80;
location /.well-known/ {
root /var/www/html;
}
location / {
rewrite ^(.*)$ https://$host$1 permanent;
}
}
}
评论
发表评论