文档管理系统mindoc安装

本次搭建根据centos7实验模板机部署搭建虚拟机。

1、基本网络设置

HOSTNAME=mindoc
hostnamectl set-hostname "$HOSTNAME"
echo "$HOSTNAME">/etc/hostname
echo "$(grep -E '127|::1' /etc/hosts)">/etc/hosts
echo "$(ip a|grep "inet "|grep -v 127|awk -F'[ /]' '{print $6}') $HOSTNAME">>/etc/hosts

2、安装redis

cd /tmp
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all && yum makecache faster
yum -y install redis
sed -i 's/bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf
systemctl restart redis
systemctl enable redis
echo ping|redis-cli

3、安装mysql并建库

cd /tmp
yum -y install mariadb-server mariadb
sed -i 's/\[mysqld\]/&\ncollation-server=utf8mb4_general_ci/g' /etc/my.cnf
sed -i 's/\[mysqld\]/&\ncharacter-set-server=utf8mb4/g' /etc/my.cnf
systemctl restart mariadb
systemctl enable mariadb
echo -e "select user()\G\nexit"|mysql
mysql
CREATE DATABASE mindoc DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;
grant all privileges on mindoc.* to mindoc@localhost   identified by 'mindoc';
grant all privileges on mindoc.* to mindoc@'127.0.0.1' identified by 'mindoc';
-- grant all privileges on mindoc.* to mindoc@'%' identified by 'mindoc';
flush privileges;
exit

4、下载安装mindoc

cd /tmp
wget https://github.com/lifei6671/mindoc/releases/download/v1.0.1/mindoc_linux_amd64.zip
mkdir /opt/mindoc
cd /opt/mindoc
unzip /tmp/mindoc_linux_amd64.zip

# 设置环境变量
echo 'export ZONEINFO=/opt/mindoc/lib/time/zoneinfo.zip'>>/etc/profile
source /etc/profile

# 配置mindoc
cd /opt/mindoc/conf
cat >app.conf<<EOF
appname = mindoc
httpaddr="0.0.0.0"
httpport = "80"
runmode = "dev"
sessionon = true
sessionname = mindoc_id
copyrequestbody = true
baseurl="http://$(hostname -i)"
highlight_style="github"
config_auto_delay="60"
beegoserversessionkey=NY1B$28pms12JM&c
sessionprovider="redis"
sessionproviderconfig="127.0.0.1:6379"
sessiongcmaxlifetime="3600"
timezone = Asia/Shanghai
db_adapter="mysql"
db_host="127.0.0.1"
db_port="3306"
db_database="mindoc"
db_username="mindoc"
db_password="mindoc"
cover=./static/images/book.jpg
avatar=./static/images/headimgurl.jpg
token_size=12
# upload_file_ext=txt|doc|docx|xls|xlsx|ppt|pptx|pdf|7z|rar|jpg|jpeg|png|gif
upload_file_ext=*
upload_file_size=50MB
enable_mail="false"
mail_number="5"
smtp_user_name="[email protected]"
smtp_host="smtp.163.com"
smtp_password="..."
smtp_port="25"
form_user_name="[email protected]"
mail_expired="30"
secure="LOGIN"
enable_export="true"
export_process_num="5"
export_limit_num="5"
export_queue_limit_num="100"
export_output_path="./runtime/cache"
baidumapkey=
ldap_enable=false
ldap_host=ad.example.com
ldap_port=3268
ldap_attribute=sAMAccountName
ldap_base=DC=example,DC=com
ldap_user=CN=ldap helper,OU=example.com,DC=example,DC=com
ldap_password=superSecret
ldap_user_role=2
ldap_filter=objectClass=posixAccount
# cdn="MINDOC_CDN_URL"
# cdnjs="MINDOC_CDN_JS_URL"
# cdncss="MINDOC_CDN_CSS_URL"
# cdnimg="MINDOC_CDN_IMG_URL"
cache="true"
cache_provider="redis"
cache_redis_host="127.0.0.1:6379"
cache_redis_db="0"
cache_redis_password=""
cache_redis_prefix="mindoc::cache"
log_path="./runtime/logs"
log_maxlines="1000000"
log_maxsize="50 MB"
log_daily="true"
log_maxdays="30"
# Emergency/Alert/Critical/Error/Warning/Notice/Informational/Debug/Trace
log_level="Informational"
log_is_async="TRUE"
EOF
# 配置文件可以参见app.conf.example和官当

# 数据初始化并配置开机启动
cd /opt/mindoc
chmod +x mindoc_linux_amd64
./mindoc_linux_amd64 install
./mindoc_linux_amd64 service install
# ./mindoc_linux_amd64 service remove
echo '/usr/bin/sleep 30 && /usr/bin/systemctl restart mindocd'>>/etc/rc.local
# CentOS7的mindoc早于mysql启动,导致mindoc无法连接到库,启动失败
# 因此不能使用systemctl添加开机启动项
reboot

# 浏览器访问 http://IP
# 超级管理员默认账号和密码:admin 密码:123456

参考博客:https://blog.csdn.net/zwjzqqb/article/details/83055899

猜你喜欢

转载自blog.csdn.net/qq_43316775/article/details/111726903