systemctl stop firewalld.service setenforce 0
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
yum -y install wget libselinux-python sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
python
cd /usr/local 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
cd /opt/ python3 -m venv py3 source /opt/py3/bin/activate
除了在github上下載外,還能夠到百度雲盤上下載:https://pan.baidu.com/s/1BVYRF7M-akKjUOoYZPBi7Q (提取密碼:v5rs)mysql
安裝rar unrar
wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gzlinux
解壓到/usr/local: tar -xzvf rarlinux-x64-5.3.0.tar.gz
git
而後執行如下命令github
ln -s /usr/local/rar/rar /usr/local/bin/rar ln -s /usr/local/rar/unrar /usr/local/bin/unrar
此時,/usr/local/rar下就會有rar命令和unrar命令。能夠在/usr/local/bin下建立鏈接
redis
用rar解壓後放到/optrar x jumpserver.rar
sql
mv jumpserver/ /opt
數據庫
cd jumpserver/requirements yum -y install epel-release yum -y install $(cat rpm_requirements.txt)
若是發生報錯:某包與某包發生衝突,那就幹掉其中一包,正所謂一山不容二虎vim
rpm -qa |grep 某包(查看是否有某包) rpm -e 某包全名
安裝python庫依賴pip install -r requirements.txt
安裝Redis, Jumpserver 使用 Redis 作 cache 和 celery brokecentos
yum -y install redis systemctl start redis
安裝MySQL
yum -y install mariadb mariadb-devel mariadb-server systemctl enable mariadb systemctl start mariadb systemctl status mariadb
設置mysql密碼,好比密碼設置爲123456
mysql_secure_installation
建立數據庫Jumpserver並受權
mysql -p123456 create database jumpserver default charset 'utf8'; grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'jumpserver@123'; flush privileges; show databases;
安裝 python3 mysql驅動: mysqlclientpip install mysqlclient
修改jumpserver配置文件
cd /opt/jumpserver cp config_example.py config.py
vim config.py
(無需修改,直接保存退出)
生成數據庫表結構和初始化數據
cd /opt/jumpserver/utils bash make_migrations.sh
出現如上信息,即表示操做成功
運行Jumpserver
cd /opt/jumpserver python run_server.py &
瀏覽器中訪問本身IP+80端口 。
默認帳號: admin 密碼: admin