mindoc 部署过程
系统环境
CentOS7.4
1、系统环境搭建
firewalld selinux 关闭
2、环境变量添加
wget https://github.com/lifei6671/mindoc/blob/master/lib/time/zoneinfo.zip?raw=true
mv zoneinfo.zip /lib/time/
echo "export ZONEINFO=$ZONEINFO:/lib/time/zoneinfo.zip" >>/etc/profile
下载tar包
https://github.com/lifei6671/mindoc/releases
wget ...
解压,修改配置文件
mkdir -pv /usr/local/mindoc unzip mindoc_linux_amd64.zip -d /usr/local/mindoc/
cd /usr/local/mindoc/conf
vim app.conf # ... db_adapter=mysql db_host=127.0.0.1 db_port=3306 db_database=mindoc_db db_username=mindoc db_password=123456 ... #
安装数据库,启动
cat > /etc/yum.repos.d/MariaDB.repo <<EOF > > # MariaDB 10.2 CentOS repository list - created 2017-12-01 11:36 UTC > > # http://downloads.mariadb.org/mariadb/repositories/ > > [mariadb] > > name = MariaDB > > baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64 > > gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB > > gpgcheck=1 > > EOF yum install mariadb-server mariadb-client -y systemctl enable mariadb systemctl start mariadb mysql_secure_installation mysql -uroot -p123456
...
CREATE DATABASE mindoc_db DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci; grant all privileges on mindoc_db.* to mindoc@'%' identified by '123456';
...
安装主程序
cd /usr/local/mindoc/
# ./mindoc_linux_amd64 install
nginx代理配置
yum install -y nginx
systemctl start nginx
systemctl enable nginx
cd /etc/nginx/
grep -Ev "#|^$" nginx.conf.default >nginx.conf
nginx -s reload
nginx的配置文件
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
#此处应该配置你的域名:
server_name webhook.iminho.me;
charset utf-8;
#此处配置你的访问日志,请手动创建该目录:
access_log /var/log/nginx/webhook.iminho.me/access.log;
location / {
try_files /_not_exists_ @backend;
}
# 这里为具体的服务代理配置
location @backend {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
#此处配置 MinDoc 程序的地址和端口号
proxy_pass http://127.0.0.1:8181;
}
}
}
启动程序
nohup ./mindoc_linux_amd64 &
3、演示 登录 admin 123456