一、编译安装python3
1.准备工作
#关闭防火墙、SELinuxsystemctl stop firewalldsetenforce 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.xztar xf Python-3.8.6rc1.tar.xz#配置、编译、安装cd Python-3.8.6rc1/./configuremakemake 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 /optwget https://pypi.tuna.tsinghua.edu.cn/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22/Twisted-18.7.0.tar.bz2#sha256=95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4tar xf Twisted-18.7.0.tar.bz2pip3 install /opt/Twisted-18.7.0pip3 install -r requirements.txt -i https://pypi.douban.com/simple/#(安装时报错requirement twisted>=18.7,解决地址:https://blog.csdn.net/weixin_45342712/article/details/95612438)#安装缓存数据库redisyum -y install redissystemctl start redis#安装MySQL数据库yum -y install mariadb mariadb-devel mariadb-serversystemctl start mariadb#创建数据库Jumpserver并授权mysql -uroot -pcreate database jumpserver default charset 'utf8';grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'zonst';
3.修改配置
#修改jumpserver配置文件cd /opt/jumpservercp config_example.yml config.ymlvim 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/utilsbash make_migrations.sh
4.启动Jumpserver
cd /opt/jumpserverpython3 run_server.py all