CentOS 7 安装 mindoc

1.安装centos7 mini方式安装

2.关闭防火墙,selinux
systemctl stop firewalld
systemctl disable firewalld
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config

3.配置阿里云centos和epel源
mv /etc/yum.repos.d/* /tmp
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
rm -rf /var/cache/yum
yum makecache
yum update -y

4.安装mariadb等,初始化mysql,配置时区同步
yum install -y ntpdate vim wget mariadb mariadb-server golang unzip -y
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ntpdate times.aliyun.com
systemctl start mariadb
mysql_secure_installation

设置数据库root密码123456
登陆mysql,创建数据库:
CREATE DATABASE mindoc_db DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;

7.下载mindoc :到https://github.com/lifei6671/mindoc/releases下载mindoc_linux_amd64.zip

8.解压mindoc_linux_amd64.zip:unzip mindoc_linux_amd64.zip -d mindoc_linux

9.请将刚才解压目录下 conf/app.conf.example 重名为 app.conf:
cp conf/app.conf.example conf/app.conf
做如下配置:

数据库配置

db_adapter=mysql

mysql数据库的IP

db_host=127.0.0.1

mysql数据库的端口号一般为3306

db_port=3306

刚才创建的数据库的名称

db_database=mindoc_db

访问数据库的账号和密码

db_username=root
db_password=123456

10.安装mindoc,
./mindoc_linux_amd64 install
稍等一分钟,程序会自动初始化数据库,并创建一个超级管理员账号:admin 密码:123456
11.安装mindoc为服务,服务器名问mindocd:
./mindoc_linux_amd64 service install mindocd

12.启动mindocd,并设置开机自启动

systemctl start mindocd
systemctl enable mindocd

你可能感兴趣的:(CentOS 7 安装 mindoc)