1.下载
cd /data/mindoc
wget https://github.com/lifei6671/mindoc/releases/download/v1.0.1/mindoc_linux_amd64.zip
unzip mindoc_linux_amd64.zip
2.安装mysql并建库
  1. –centos7
    yum -y install mariadb-server mariadb
    systemctl restart mariadb
    systemctl enable mariadb
  2. unbuntu
    sudo apt update
    sudo apt install mariadb-server -y
  3. mysql
    CREATE DATABASE mindoc DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;
    grant all privileges on mindoc.* to mindoc_user@localhost   identified by 'mindoc_pw';
    grant all privileges on mindoc.* to mindoc_user@'127.0.0.1' identified by 'mindoc_pw';
    #grant all privileges on mindoc.* to mindoc_user@'%' identified by 'mindoc_pw';
    flush privileges;
  4. mysql.8.0
    CREATE DATABASE mindoc DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;
    CREATE USER 'mindoc_user'@'127.0.0.1' IDENTIFIED BY 'mindoc_pw';
    GRANT ALL PRIVILEGES ON mindoc.* TO 'mindoc_user'@'127.0.0.1';
    flush privileges;
3.配置mindoc conf
  1. vim /data/mindoc/conf/app.conf
    db_adapter="mysql"
    db_host="127.0.0.1"
    db_port="3306"
    db_database="mindoc"
    db_username="mindoc_user"
    db_password="mindoc_pw"
4. –centos7 关闭防护墙
sudo systemctl stop firewalld #临时关闭防火墙
sudo systemctl disable firewalld #禁用防火墙自启
sudo systemctl status firewalld #检查防火墙状态
5.拉起mindoc
cd /data/mindoc
mv mindoc_linux_amd64 mindoc
./mindoc install
nohup ./mindoc > nohup.out 2>&1
6.登入
192.168.10.30:8181
u:admin
p:123456
7.supervisorctl
  1. 配置 /etc/supervisor/conf.d/mindoc.conf
    [program:__mindoc]
    command=/data/mindoc/mindoc
    directory=/data/mindoc/
    autostart=False
    autorestart=True
    user=lu
    stderr_logfile=/var/log/mindoc.err.log
    stdout_logfile=/var/log/mindoc.out.log
  2. cmd
    sudo supervisorctl reread
    sudo supervisorctl update
8.nginx
  1. 配置 /etc/nginx/conf.d/mindoc.conf

    server {
     listen 80;
     server_name morninglu.cn www.morninglu.cn;
    
     location / {
         proxy_pass http://127.0.0.1:8181/;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
    
     location /files/ {
         alias /var/www/ngx-share/;
         autoindex on;
     }
    }
  2. cmd

    sudo systemctl reload nginx
9. –centos7 固定ip
  1. vim /etc/sysconfig/network-scripts/ifcfg-ens32

    TYPE=Ethernet
    BOOTPROTO=static
    NAME=ens33
    DEVICE=ens33
    ONBOOT=yes
    IPADDR=192.168.1.100     # 你想设置的IP
    NETMASK=255.255.255.0    # 子网掩码
    GATEWAY=192.168.1.1      # 默认网关
    DNS1=8.8.8.8             # DNS服务器
  2. cmd

    sudo systemctl restart network
10.公网安备
vim /data/mindoc/views/widgets/footer.tpl          #粤ICP
vim /data/mindoc/views/document/default_read.tpl   #粤ICP
vim /data/mindoc/views/widgets/header.tpl          #屏蔽登录
11.更新时间作者

vim /data/mindoc/static/css/kancloud.css

.manual-article .wiki-bottom{
    border-top: 1px solid #E5E5E5;
    line-height: 25px;color: #333;
    text-align:right;
    font-size: 0px;  #字体大小改成0
    margin-bottom: 20px;
    margin-top: 30px;
    padding: 5px;
}
12.http->https
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx          #修改nginx配置
sudo nginx -t                 #校验配置
sudo systemctl reload nginx   #重新加载配置
sudo certbot renew --dry-run  #校验续签是否成功
13.ico
/data/mindoc/favicon.ico   #网站图标
/data/mindoc/static/images #待替换的图
文档更新时间: 2026-06-09 11:32   作者:morninglu