centos 7 安裝jumpserver

0)系統環境python

cat /etc/redhat-release
centos 7 安裝jumpservermysql

關閉防火牆和selinuxlinux

systemctl stop firewalld.servicegit

systemctl disable firewalld.serviceredis

setenforce 0sql

getenforce數據庫

cat /etc/sysconfig/selinux
centos 7 安裝jumpservercentos

修改字符集,不然可能報 input/output error的問題,由於日誌裏打印了中文瀏覽器

localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8bash

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
centos 7 安裝jumpserver

2.編譯安裝(這裏必須執行編譯安裝,不然在安裝 Python 庫依賴時會有麻煩)

cd /usr/local/src/

wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
centos 7 安裝jumpserver

tar xvf Python-3.6.1.tar.xz
centos 7 安裝jumpserver

cd Python-3.6.1

./configure && make && make install

3.創建Python虛擬環境

cd /opt/

python3 -m venv py3

source /opt/py3/bin/activate

(py3) [root@jumpserver-server opt]#
看到上面的提示符表明成功,之後運行Jumpserver都要先運行以上source命令,如下全部命令均在該虛擬環境中運行!

2) 安裝Jumpserver

1.下載或clone項目

先到百度雲盤上下載:https://pan.baidu.com/s/1BVYRF7M-akKjUOoYZPBi7Q (提取密碼:v5rs)
下載完成以後再把壓縮包移到桌面上(若是沒有MobaXterm先下載,下載完成以後ssh鏈接)
在點stop -----> 上面有一個上傳的標識符 --------> 就能夠上傳下載了
centos 7 安裝jumpserver!

下載wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gz
centos 7 安裝jumpserver

解壓 tar -xzvf rarlinux-x64-5.3.0.tar.gz 到/usr/local
centos 7 安裝jumpserver
而後執行如下命令

ln -s /usr/local/rar/rar /usr/local/bin/rar
  ln -s /usr/local/rar/unrar /usr/local/bin/unrar

cd到家目錄
ls看一下
centos 7 安裝jumpserver
rar x jumpserver.rar
centos 7 安裝jumpserver
ls查看一下
centos 7 安裝jumpserver
移動到mv jumpserver/ /opt/
進入cd /opt/
ls
centos 7 安裝jumpserver

2.安裝依賴rpm包
cd /opt/

cd jumpserver/requirements

yum -y install epel-release
centos 7 安裝jumpserver

yum -y install $(cat rpm_requirements.txt)
centos 7 安裝jumpserver

3.安裝python庫依賴

pip install -r requirements.txt
centos 7 安裝jumpserver

4.安裝Redis, Jumpserver 使用 Redis 作 cache 和 celery broke

yum -y install redis
centos 7 安裝jumpserver
systemctl start redis

lsof -i:6379
centos 7 安裝jumpserver

5.安裝MySQL

yum -y install mariadb mariadb-devel mariadb-server
centos 7 安裝jumpserver
systemctl enable mariadb

systemctl start mariadb

systemctl status mariadb
centos 7 安裝jumpserver
lsof -i:3306
centos 7 安裝jumpserver

設置mysql密碼
mysql_secure_installation
centos 7 安裝jumpserver

建立數據庫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;
centos 7 安裝jumpserver
exit退出

6.安裝 python3 mysql驅動

pip install mysqlclient
centos 7 安裝jumpserver

7.修改jumpserver配置文件
計劃修改 DevelopmentConfig中的配置,由於默認jumpserver是使用該配置,它繼承自Config。
cd /opt/jumpserver

cp config_example.py config.py

8.生成數據庫表結構和初始化數據

cd /opt/jumpserver/utils

ls

bash make_migrations.sh
centos 7 安裝jumpserver

9.運行Jumpserver

cd /opt/jumpserver

python run_server.py &
centos 7 安裝jumpserver

10.啓動python run_server.py &
時候瀏覽

11.在瀏覽器上輸入ip地址:8080
centos 7 安裝jumpserver

相關文章
相關標籤/搜索