一、编译安装python3

1.准备工作

  1. #关闭防火墙、SELinux
  2. systemctl stop firewalld
  3. setenforce 0
  4. #安装依赖包
  5. yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git

2.编译安装

  1. cd /opt/
  2. wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6rc1.tar.xz
  3. tar xf Python-3.8.6rc1.tar.xz
  4. #配置、编译、安装
  5. cd Python-3.8.6rc1/
  6. ./configure
  7. make
  8. make install

二、安装Jumpserver

1.下载Jumpserver

  1. cd /opt/
  2. git clone --depth=1 https://github.com/jumpserver/jumpserver.git

2.准备工作

  1. #安装依赖包
  2. cd jumpserver/requirements/
  3. yum -y install $(cat rpm_requirements.txt)
  4. #使用pip国内源安装python库依赖
  5. /usr/local/bin/python3.8 -m pip install --upgrade pip -i https://pypi.douban.com/simple/
  6. cd /opt
  7. wget https://pypi.tuna.tsinghua.edu.cn/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22/Twisted-18.7.0.tar.bz2#sha256=95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4
  8. tar xf Twisted-18.7.0.tar.bz2
  9. pip3 install /opt/Twisted-18.7.0
  10. pip3 install -r requirements.txt -i https://pypi.douban.com/simple/
  11. #(安装时报错requirement twisted>=18.7,解决地址:https://blog.csdn.net/weixin_45342712/article/details/95612438)
  12. #安装缓存数据库redis
  13. yum -y install redis
  14. systemctl start redis
  15. #安装MySQL数据库
  16. yum -y install mariadb mariadb-devel mariadb-server
  17. systemctl start mariadb
  18. #创建数据库Jumpserver并授权
  19. mysql -uroot -p
  20. create database jumpserver default charset 'utf8';
  21. grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'zonst';

3.修改配置

  1. #修改jumpserver配置文件
  2. cd /opt/jumpserver
  3. cp config_example.yml config.yml
  4. vim config.yml
  5. KEYabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)
  6. DB_ENGINE: mysql
  7. DB_HOST: 127.0.0.1
  8. DB_PORT: 3306
  9. DB_USER: jumpserver
  10. DB_PASSWORD: zonst
  11. DB_NAME: jumpserver
  12. #生成数据库表结构和初始化数据
  13. cd /opt/jumpserver/utils
  14. bash make_migrations.sh

4.启动Jumpserver

  1. cd /opt/jumpserver
  2. python3 run_server.py all