安裝jumpserver

1.cat /etc/redhat-release
2.關閉防火牆和selinux systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
getenforce
cat /etc/sysconfig/selinux
3.修改字符集,不然可能報 input/output error的問題,由於日誌裏打印了中文
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
4.yum -y install wget libselinux-python sqlite-devel xz gcc
automake zlib-devel openssl-devel epel-release git(安裝依賴包)
5.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
6.cd /opt
python3 -m venv py3
source /opt/py3/bin/activate( (py3) [root@localhost]#顯示py3提示)
7.安裝jumpserver1.0.0
https://pan.baidu.com/s/1BVYRF7M-akKjUOoYZPBi7Q  (提取密碼:v5rs)(解壓包 移動到opt下)
cd /usr/local
wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gz(安裝rar)
tar -xzvf rarlinux-x64-5.3.0.tar.gz (解壓到/use/local下)
ln -s /usr/local/rar/rar /usr/local/bin/rar
ln -s /usr/local/rar/unrar /usr/local/bin/unrar
cd /opt
rar x jumpserver.rar (解壓jumserver.rar)
8.cd /jumpserver/requirements(安裝依賴包)
yum -y install epel-release
yum -y install $(cat rpm_requirements.txt)python

  1. pip install -r requirements.txt (安裝Python庫依賴)
  2. 安裝Redis, Jumpserver 使用 Redis 作 cache 和 celery broke
    yum -y install redis
    systemctl start redis
    lsof -i:6379
  3. 安裝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
    ......
    Set root password? [Y/n] y
    New password: //好比密碼是123456
    Re-enter new password:
    ...... //其餘項所有回車默認mysql

  4. 建立數據庫jumpserver並受權
    mysql -p123456
    MariaDB [(none)]> create database jumpserver default charset 'utf8';
    MariaDB [(none)]> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'jumpserver@123';
    MariaDB [(none)]> flush privileges;
    MariaDB [(none)]> show databases;
    MariaDB [(none)]>exit
  5. 安裝Python3 mysql 驅動:mysqlclient
    在jumpserver/requirements下 pip install mysqlclient
  6. 修改jumpserver
    cd /opt/jumperserver
    cp config_example.py config.py
    vim config.py
    class DevelopmentConfig(Config): //從這一行開始添加
    DEBUG = True
    DISPLAY_PER_PAGE = 20
    DB_ENGINE = 'mysql'
    DB_HOST = '127.0.0.1'
    DB_PORT = 3306
    DB_USER = 'jumpserver'
    DB_PASSWORD = 'jumpserver@123'
    DB_NAME = 'jumpserver'
    EMAIL_HOST = 'smtp.kevin.com'
    EMAIL_PORT = 465
    EMAIL_HOST_USER = 'monit@kevin.com'
    EMAIL_HOST_PASSWORD = 'monit@123'
    EMAIL_USE_SSL = True
    EMAIL_USE_TLS = False
    EMAIL_SUBJECT_PREFIX = '[Jumpserver] '
    SITE_URL = 'http://192.168.10.210:8080' //一直添加到這一行
  7. 生成數據庫表結構和初始化數據
    cd /opt/jumpserver/utils
    ls
    bash make_migrations.sh
    ........
    Applying django_celery_beat.0002_auto_20161118_0346... OK
    Applying django_celery_beat.0003_auto_20161209_0049... OK
    Applying django_celery_beat.0004_auto_20170221_0000... OK
    Applying terminal.0002_auto_20180318_2330... OK 顯示這個,表示成功
  8. 運行jumpserver
    cd /opt/jumpserver
    python run_server.py & //按鍵ctrl+c結束
    lsof -i:8080
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    gunicorn 17338 root 5u IPv4 204937 0t0 TCP :webcache (LISTEN)
    gunicorn 28888 root 5u IPv4 204937 0t0 TCP
    :webcache (LISTEN)
    gunicorn 28890 root 5u IPv4 204937 0t0 TCP :webcache (LISTEN)
    gunicorn 28894 root 5u IPv4 204937 0t0 TCP
    :webcache (LISTEN)
    gunicorn 28896 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)

運行不報錯,請瀏覽器訪問 http://192.168.10.210:8080/ 帳號: admin 密碼: adminlinux

相關文章
相關標籤/搜索