0)系统环境
cat /etc/redhat-release
关闭防火墙和selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
getenforce
cat /etc/sysconfig/selinux
修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文
localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
echo ‘LANG=zh_CN.UTF-8‘ > /etc/sysconfig/i18n
1) 准备Python3和Python虚拟环境
1.安装依赖包
yum -y install wget libselinux-python sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
2.编译安装(这里必须执行编译安装,否则在安装 Python 库依赖时会有麻烦)
cd /usr/local/src/
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar xvf Python-3.6.1.tar.xz
cd Python-3.6.1
./configure && make && make install
3.建立Python虚拟环境
cd /opt/
python3 -m venv py3
source /opt/py3/bin/activate
(py3) [[email protected] opt]#
看到上面的提示符代表成功,以后运行Jumpserver都要先运行以上source命令,以下所有命令均在该虚拟环境中运行!
2) 安装Jumpserver
1.下载或clone项目
先到百度云盘上下载:https://pan.baidu.com/s/1BVYRF7M-akKjUOoYZPBi7Q (提取密码:v5rs)
下载完成之后再把压缩包移到桌面上(如果没有MobaXterm先下载,下载完成之后ssh连接)
在点stop -----> 上面有一个上传的标识符 --------> 就可以上传下载了
!
下载wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gz
解压 tar -xzvf rarlinux-x64-5.3.0.tar.gz 到/usr/local
然后执行以下命令
ln -s /usr/local/rar/rar /usr/local/bin/rar
ln -s /usr/local/rar/unrar /usr/local/bin/unrar
cd到家目录
ls看一下
rar x jumpserver.rar
ls查看一下
移动到mv jumpserver/ /opt/
进入cd /opt/
ls
2.安装依赖rpm包
cd /opt/
cd jumpserver/requirements
yum -y install epel-release
yum -y install $(cat rpm_requirements.txt)
3.安装python库依赖
pip install -r requirements.txt
4.安装Redis, Jumpserver 使用 Redis 做 cache 和 celery broke
yum -y install redis
systemctl start redis
lsof -i:6379
5.安装MySQL
yum -y install mariadb mariadb-devel mariadb-server
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb
lsof -i:3306
设置mysql密码
mysql_secure_installation
创建数据库Jumpserver并授权
mysql -p123456
create database jumpserver default charset ‘utf8‘;
grant all on jumpserver.* to ‘jumpserver‘@‘127.0.0.1‘ identified by ‘[email protected]‘;
flush privileges;show databases;
exit退出
6.安装 python3 mysql驱动
pip install mysqlclient
7.修改jumpserver配置文件
计划修改 DevelopmentConfig中的配置,因为默认jumpserver是使用该配置,它继承自Config。
cd /opt/jumpserver
cp config_example.py config.py
8.生成数据库表结构和初始化数据
cd /opt/jumpserver/utils
ls
bash make_migrations.sh
9.运行Jumpserver
cd /opt/jumpserver
python run_server.py &
10.启动python run_server.py &
时候浏览
11.在浏览器上输入ip地址:8080
原文地址:https://blog.51cto.com/14259161/2420834