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
- pip install -r requirements.txt (安装Python库依赖)
- 安装Redis, Jumpserver 使用 Redis 作 cache 和 celery broke
yum -y install redis
systemctl start redis
lsof -i:6379
-
安装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
- 建立数据库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
- 安装Python3 mysql 驱动:mysqlclient
在jumpserver/requirements下 pip install mysqlclient
- 修改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' //一直添加到这一行
- 生成数据库表结构和初始化数据
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 显示这个,表示成功
- 运行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