1.安裝centos7 mini方式安裝
2.關(guān)閉防火墻,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,配置時(shí)區(qū)同步
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
設(shè)置數(shù)據(jù)庫(kù)root密碼123456
登陸mysql,創(chuàng)建數(shù)據(jù)庫(kù):
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.請(qǐng)將剛才解壓目錄下 conf/app.conf.example 重名為 app.conf:
cp conf/app.conf.example conf/app.conf
做如下配置:
數(shù)據(jù)庫(kù)配置
db_adapter=mysql
mysql數(shù)據(jù)庫(kù)的IP
db_host=127.0.0.1
mysql數(shù)據(jù)庫(kù)的端口號(hào)一般為3306
db_port=3306
剛才創(chuàng)建的數(shù)據(jù)庫(kù)的名稱(chēng)
db_database=mindoc_db
訪問(wèn)數(shù)據(jù)庫(kù)的賬號(hào)和密碼
db_username=root
db_password=123456
10.安裝mindoc,
./mindoc_linux_amd64 install
稍等一分鐘叁扫,程序會(huì)自動(dòng)初始化數(shù)據(jù)庫(kù),并創(chuàng)建一個(gè)超級(jí)管理員賬號(hào):admin 密碼:123456
11.安裝mindoc為服務(wù),服務(wù)器名問(wèn)mindocd:
./mindoc_linux_amd64 service install mindocd
12.啟動(dòng)mindocd,并設(shè)置開(kāi)機(jī)自啟動(dòng)
systemctl start mindocd
systemctl enable mindocd