Create New Document

The title of your document (will be displayed as H1)
URL-friendly name (no spaces, use dashes)
Path where to create document (optional, use forward slashes to create subdirectories)

Move/Rename Document

Current location of the document
New path for the document (including the slug)
This only changes the document's path. It does not modify the document's title (H1 heading).

Delete Document

Are you sure you want to delete this document? This action cannot be undone.

Warning: If this is a folder, all contents including subfolders and documents will be deleted.

Message

Message content goes here.

Confirm Action

Are you sure?

Attachments

Allowed file types: jpg, jpeg, png, gif, svg, webp, txt, log, csv, sfd, zip, pdf, docx, xlsx, pptx, mp4 (Max: 10MB)

Document Files

Loading attached files...

Document History

Previous Versions

Loading versions...

Preview

Select a version to preview

Wiki Settings

Language for the user interface
Number of versions to keep per document. Set to 0 to disable versioning.
Maximum allowed file size for uploads in MB.

User Management

Add New User

Leave empty to keep current password
Users with these groups can access restricted sections.

Define path-based access rules for sections of your wiki, then assign users to groups in the Users tab. Rules are evaluated in order. First match wins.

Active Rules

Import markdown files from a ZIP archive. Files will be processed and stored in the appropriate document structure. Directory structure in the ZIP (category/subcategory) will be preserved in the wiki.

Upload a ZIP file containing markdown (.md) files to import.

Create and manage backups of your wiki data. Backups include all documents, images, and configuration files.

Available Backups

Loading backups...

Add/Edit Access Rule

Selected: /

Add Column

Banner

Nginx

前端多版本Nginx 软链接切换方法

“多版本部署 + 软连接切换 + Nginx 配置模板 + 一键脚本”,直接复制就能用。

一、部署目录结构建议

假设你的网站部署在 /www/wwwroot/html.didaha.com,结构如下:

/www/wwwroot/html.didaha.com/
├── v1.0/ # 第一版打包产物
├── v1.1/ # 第二版打包产物
├── v1.2/ # 第三版打包产物
├── current -> v1.2 # 当前启用版本(软连接)
└── switch.sh # 一键切换脚本

二、Nginx 配置模板

宝塔路径示例:/www/server/panel/vhost/nginx

server
{
    listen 80;
    listen 443 ssl;
    listen 443 quic;
    http2 on;
    #替换 html.didaha.com 为你的域名或服务器 IP。
    server_name html.didaha.com;
    index index.html;
    root /www/wwwroot/html.didaha.com/current;
    #CERT-APPLY-CHECK--START
    # 用于SSL证书申请时的文件验证相关配置 -- 请勿删除
    include /www/server/panel/vhost/nginx/well-known/html.didaha.com.conf;
    #CERT-APPLY-CHECK--END

    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START
    set $isRedcert 1;
    if ($server_port != 443) {
        set $isRedcert 2;
    }
    if ( $uri ~ /\.well-known/ ) {
        set $isRedcert 1;
    }
    if ($isRedcert != 1) {
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #HTTP_TO_HTTPS_END
    ssl_certificate    /www/server/panel/vhost/cert/html.didaha.com/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/html.didaha.com/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_tickets on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    add_header Alt-Svc 'quic=":443"; h3=":443"; h3-29=":443"; h3-27=":443";h3-25=":443"; h3-T050=":443"; h3-Q050=":443";h3-Q049=":443";h3-Q048=":443"; h3-Q046=":443"; h3-Q043=":443"';
    error_page 497  https://$host$request_uri;

    #SSL-END

    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END

    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-00.conf;
    #PHP-INFO-END

    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/html.didaha.com.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }

    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }

    #禁止在证书验证目录放入敏感文件
    if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
        return 403;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log /dev/null;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log /dev/null;
    }
    access_log  /www/wwwlogs/html.didaha.com.log;
    error_log  /www/wwwlogs/html.didaha.com.error.log;
}

三、配置一键切换版本脚本 switch.sh

路径示例:/www/wwwroot/html.didaha.com/

#!/bin/bash
#切换目标版本
VERSION=$1
DEPLOY_PATH=/www/wwwroot/html.didaha.com
#判断版本是否存在
if [ ! -d "$DEPLOY_PATH/$VERSION"];then
    echo "[错误]版本 $VERSION 不存在!"
    exit 1
fi
#创建软链接
ln -sfn "$DEPLOY_PATH/$VERSION" "$DEPLOY_PATH/current"
echo "[完成]已切换版本为 $VERSION!"
#重载 Nginx
nginx -s reload
echo "[完成] Nginx 已重载"

四、使用方法 脚本 switch.sh

1.首次创建软链接

cd /www/wwwroot/html.didaha.com/

#`chmod +x file`:添加可执行权限
chmod +x switch.sh     # 只需一次

./switch.sh v1.0     # 切换版本

2.后续切换版本

ssh root@-server

cd /www/wwwroot/html.didaha.com/
./switch.sh v1.3.0

---------------------------


日常命令行操作

目录操作

  1. pwd
    显示当前所在目录的绝对路径。
  2. cd <目录名>
    进入指定目录。
    • cd ..:返回上级目录
    • cd ~cd:返回用户主目录
    • cd -:返回上一个所在的目录
  3. ls
    列出当前目录下的文件和子目录。
    • ls -l:显示详细信息(权限、大小、时间)
    • ls -a:显示隐藏文件(以 . 开头的文件)
    • ls -lh:以易读格式显示文件大小(如 KB、MB)
  4. mkdir <目录名>
    创建新目录。
    • mkdir -p dir1/dir2:递归创建多级目录。
  5. rmdir <目录名>
    删除空目录(仅当目录为空时生效)。

文件操作

  1. touch <文件名>
    创建空文件或更新文件的访问/修改时间。
  2. cat <文件名>
    查看文件内容(直接输出到终端)。
  3. less <文件名>more <文件名>
    分页查看文件内容(支持上下滚动)。
  4. head <文件名>
    查看文件前 10 行。
    • head -n 20 file.txt:查看前 20 行。
  5. tail <文件名>
    查看文件最后 10 行。
    • tail -f file.log:实时跟踪日志文件更新。
  6. cp <源文件> <目标路径>
    复制文件或目录。
    • cp -r dir1 dir2:递归复制目录。
  7. mv <源文件> <目标路径>
    移动文件/目录,或重命名文件。
    • mv oldname.txt newname.txt:重命名文件。
  8. rm <文件名>
    删除文件。
    • rm -r dir:递归删除目录及其内容
    • rm -f file:强制删除(不提示确认)

权限管理

  1. chmod <权限> <文件/目录>
    修改文件/目录权限。
    • chmod 755 script.sh:赋予所有者读写执行权限,其他用户读执行。
    • chmod +x file:添加可执行权限。
  2. chown <用户>:<组> <文件/目录>
    修改文件/目录的所有者和所属组。
    • sudo chown root:root file.txt:将文件所有者改为 root。
  3. chgrp <组名> <文件/目录>
    修改文件/目录的所属组。

搜索与查找

  1. find <路径> -name "<文件名>"
    按名称搜索文件。
    • find /home -name "*.txt":在 /home 下查找所有 .txt 文件。
  2. grep "<关键词>" <文件名>
    在文件中搜索关键词。
    • grep -i "error" log.txt:忽略大小写搜索 "error"。
    • grep -r "pattern" /path:递归搜索目录下所有文件。
  3. locate <文件名>
    快速查找文件(依赖数据库,需先运行 updatedb)。
  4. which <命令>
    显示命令的绝对路径(如 which python)。

压缩与解压

  1. tar -czvf archive.tar.gz dir/
    将目录压缩为 .tar.gz 文件。
    • c:创建压缩包,z:用 gzip 压缩,v:显示进度,f:指定文件名。
  2. tar -xzvf archive.tar.gz
    解压 .tar.gz 文件。
  3. zip -r archive.zip dir/
    压缩为 ZIP 文件。
  4. unzip archive.zip
    解压 ZIP 文件。

系统信息

  1. tophtop
    实时查看系统进程和资源占用(htop 更直观)。
  2. df -h
    查看磁盘空间使用情况(-h 以易读单位显示)。
  3. du -sh <目录>
    查看目录占用空间大小(-s 显示总计,-h 易读格式)。
  4. free -h
    查看内存使用情况。
  5. uname -a
    显示系统内核信息。

网络相关

  1. ping <域名/IP>
    测试网络连通性。
  2. curl <URL>
    发送 HTTP 请求(如下载文件或测试 API)。
  3. wget <URL>
    下载文件到当前目录。
  4. ssh user@host
    远程登录到服务器。
  5. scp <本地文件> user@host:<远程路径>
    通过 SSH 安全复制文件。

其他实用命令

  1. history
    查看命令历史记录。
  2. alias
    创建命令别名(如 alias ll='ls -lah')。
  3. man <命令>
    查看命令的手册页(按 q 退出)。
  4. exit
    退出终端或 SSH 连接。
  5. clear
    清空终端屏幕。
  6. sudo <命令>
    以管理员权限执行命令。

Attached Files

Loading attached files...
Search Results