一、编译安装python3
1.准备工作
#关闭防火墙、SELinux
systemctl stop firewalld
setenforce 0
#安装依赖包
yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
2.编译安装
cd /opt/
wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6rc1.tar.xz
tar xf Python-3.8.6rc1.tar.xz
#配置、编译、安装
cd Python-3.8.6rc1/
./configure
make
make install
二、安装Jumpserver
1.下载Jumpserver
cd /opt/
git clone --depth=1 https://github.com/jumpserver/jumpserver.git
2.准备工作
#安装依赖包
cd jumpserver/requirements/
yum -y install $(cat rpm_requirements.txt)
#使用pip国内源安装python库依赖
/usr/local/bin/python3.8 -m pip install --upgrade pip -i https://pypi.douban.com/simple/
cd /opt
wget https://pypi.tuna.tsinghua.edu.cn/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22/Twisted-18.7.0.tar.bz2#sha256=95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4
tar xf Twisted-18.7.0.tar.bz2
pip3 install /opt/Twisted-18.7.0
pip3 install -r requirements.txt -i https://pypi.douban.com/simple/
#(安装时报错requirement twisted>=18.7,解决地址:https://blog.csdn.net/weixin_45342712/article/details/95612438)
#安装缓存数据库redis
yum -y install redis
systemctl start redis
#安装MySQL数据库
yum -y install mariadb mariadb-devel mariadb-server
systemctl start mariadb
#创建数据库Jumpserver并授权
mysql -uroot -p
create database jumpserver default charset 'utf8';
grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'zonst';
3.修改配置
#修改jumpserver配置文件
cd /opt/jumpserver
cp config_example.yml config.yml
vim config.yml
KEY:abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD: zonst
DB_NAME: jumpserver
#生成数据库表结构和初始化数据
cd /opt/jumpserver/utils
bash make_migrations.sh
4.启动Jumpserver
cd /opt/jumpserver
python3 run_server.py all