说明
# 开头的行表示注释
> 开头的行表示需要在 mysql 中执行
$ 开头的行表示需要执行的命令
云服务器快速部署参考 极速安装
安装过程中遇到问题可参考 FAQ 文档
环境
系统: CentOS 7
IP: 192.168.244.144
目录: /opt
数据库: mariadb
代理: nginx
开始安装
$ yum update -y
# 防火墙 与 selinux 设置说明, 如果已经关闭了 防火墙 和 Selinux 的用户请跳过设置
$ systemctl start firewalld
$ firewall-cmd --zone=public --add-port=80/tcp --permanent # nginx 端口
$ firewall-cmd --zone=public --add-port=2222/tcp --permanent # 用户SSH登录端口 koko
--permanent 永久生效, 没有此参数重启后失效
$ firewall-cmd --reload # 重新载入规则
$ setenforce 0
$ sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config #sed 语法:替换作用
# 安装依赖包
$ yum -y install wget gcc epel-release git
# 安装 Redis, JumpServer 使用 Redis 做 cache 和 celery broke
$ yum -y install redis
$ systemctl enable redis
$ systemctl start redis
# 安装 MySQL, 如果不使用 Mysql 可以跳过相关 Mysql 安装和配置, 支持sqlite3, mysql, postgres等
$ yum -y install mariadb mariadb-devel mariadb-server MariaDB-shared # centos7下叫mariadb, 用法与mysql一致
$ systemctl enable mariadb
$ systemctl start mariadb
# 创建数据库 JumpServer 并授权
$ DB_PASSWORD=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 24` # 生成随机数据库密码
$ echo -e "