JumpServerをCentOS7にインストールする手順

環境要件

  • CentOS Linux 7.6.1810 (Core)
  • JumpServer 1.4.8
  • Python 3.6.X
  • MariaDB データベース

Python 3.6のソースインストール

公式サイトからPython 3.6.9のソースコードをダウンロードします。

wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar -xzf Python-3.6.9.tgz

ビルド依存パッケージのインストール

yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make

ビルド設定とインストール

cd Python-3.6.9
./configure --prefix=/usr/local/python369
make && make install

環境変数の設定

echo 'export PATH=/usr/local/python369/bin:$PATH' >> /etc/profile
source /etc/profile

基本サービスのセットアップ

yum install -y epel-release
yum -y install redis mariadb mariadb-server nginx git docker
systemctl enable redis mariadb nginx docker
systemctl start redis mariadb

Python仮想環境の作成

python3.6 -m venv /opt/venv_py3
source /opt/venv_py3/bin/activate

データベースの設定

mysql -u root -e "CREATE DATABASE jumpserver CHARACTER SET utf8;"
mysql -u root -e "GRANT ALL PRIVILEGES ON jumpserver.* TO 'jumpuser'@'localhost' IDENTIFIED BY 'SecurePass123!';"

JumpServerのインストール

cd /opt
git clone -b 1.4.8 https://github.com/jumpserver/jumpserver.git
cd jumpserver/requirements
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

設定ファイルの編集

cp config_example.yml config.yml
vim config.yml  # データベース接続情報とトークンを設定

サービスの起動

./jms start -d

コアコンポーネントのセットアップ

COCOコンポーネント

cd /opt
git clone -b 1.4.8 https://github.com/jumpserver/coco.git
cd coco/requirements
pip install -r requirements.txt
cp config_example.yml config.yml  # トークンをJumpServerと一致させる
./cocod start -d

Guacamoleコンポーネント

cd /opt
git clone https://github.com/jumpserver/docker-guacamole.git
cd docker-guacamole
tar xf guacamole-server-1.0.0.tar.gz

Nginxリバースプロキシの設定

cat > /etc/nginx/conf.d/jumpserver.conf << EOF
server {
    listen 80;
    client_max_body_size 100m;
    
    location /luna/ {
        alias /opt/luna/;
        try_files \$uri /index.html;
    }
    
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host \$host;
        proxy_set_header X-Real-IP \$remote_addr;
    }
}
EOF
systemctl restart nginx

タグ: JumpServer centos7 Python3.6 MariaDB nginx

7月23日 18:22 投稿