0)系統環境python
cat /etc/redhat-release
mysql
關閉防火牆和selinuxlinux
systemctl stop firewalld.servicegit
systemctl disable firewalld.serviceredis
setenforce 0sql
getenforce數據庫
cat /etc/sysconfig/selinux
centos
修改字符集,不然可能報 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
2.編譯安裝(這裏必須執行編譯安裝,不然在安裝 Python 庫依賴時會有麻煩)
cd /usr/local/src/
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
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 -----> 上面有一個上傳的標識符 --------> 就能夠上傳下載了
!
下載wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gz
解壓 tar -xzvf rarlinux-x64-5.3.0.tar.gz 到/usr/local
而後執行如下命令
ln -s /usr/local/rar/rar /usr/local/bin/rar ln -s /usr/local/rar/unrar /usr/local/bin/unrar
cd到家目錄
ls看一下
rar x jumpserver.rar
ls查看一下
移動到mv jumpserver/ /opt/
進入cd /opt/
ls
2.安裝依賴rpm包
cd /opt/
cd jumpserver/requirements
yum -y install epel-release
yum -y install $(cat rpm_requirements.txt)
3.安裝python庫依賴
pip install -r requirements.txt
4.安裝Redis, Jumpserver 使用 Redis 作 cache 和 celery broke
yum -y install redis
systemctl start redis
lsof -i:6379
5.安裝MySQL
yum -y install mariadb mariadb-devel mariadb-server
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb
lsof -i:3306
設置mysql密碼
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;
exit退出
6.安裝 python3 mysql驅動
pip install mysqlclient
7.修改jumpserver配置文件
計劃修改 DevelopmentConfig中的配置,由於默認jumpserver是使用該配置,它繼承自Config。
cd /opt/jumpserver
cp config_example.py config.py
8.生成數據庫表結構和初始化數據
cd /opt/jumpserver/utils
ls
bash make_migrations.sh
9.運行Jumpserver
cd /opt/jumpserver
python run_server.py &
10.啓動python run_server.py &
時候瀏覽
11.在瀏覽器上輸入ip地址:8080