jumpserver server set up

[root@jumpserver-server ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

关闭防火墙和selinux
[root@jumpserver-server ~]# systemctl stop firewalld.service
[root@jumpserver-server ~]# systemctl disable firewalld.service
[root@jumpserver-server ~]# setenforce 0
[root@jumpserver-server ~]# getenforce
[root@jumpserver-server ~]# cat /etc/sysconfig/selinux
........
SELINUX=disabled

Modify the character set, or it may report input / output error problem because the Chinese print log
[root @ jumpserver-Server ~] # the localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
[root @ jumpserver- ~ Server] # = zh_CN.UTF the LC_ALL-Export. 8
[jumpserver the root-Server @ ~] # echo '. 8-zh_CN.UTF the LANG ='> / etc / sysconfig / the i18n

1) Preparation Python3 and Python virtual environment

1.1) installation dependencies
[root @ jumpserver-server ~] # yum -y install wget libselinux-python sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git

1.2) compile and install (there must compile installed, otherwise there will be trouble when installing Python library dependencies)
[root @ jumpserver-Server ~] # cd / usr / local / src /
[root @ jumpserver-Server src] # wget HTTPS : //www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
[root @ jumpserver-Server src] # tar xvf Python-3.6.1.tar.xz
[root @ jumpserver src -server] # cd Python-3.6.1
[root @ jumpserver-Server Python-3.6.1] # ./configure && && the make the make install

1.3) to establish a virtual Python environment
because CentOS 6/7 comes with a Python2, while Yum and other tools rely on the original Python, in order not to disturb the original environment we use Python virtual environment
[root @ jumpserver-server ~] # cd / opt /
[the root @ jumpserver Server-opt] -m Venv Py3 to python3 #
[@ jumpserver the root-Server opt] # Source / opt / Py3 / bin / the activate
(Py3) [the root @ jumpserver Server-opt] #
see above tips and stand for success, they have to run after Jumpserver run over source command, all of the following commands are run in the virtual environment!

2) Installation 1.0.0 Jumpserver
Linux CentOS install rar unrar under 7.0
Download: wget http://www.rarlab.com/rar/rarlinux-x64-5.3.0.tar.gz

Decompression: tar -xzvf rarlinux-x64-5.3.0.tar.gz

rar need to install software, to directly extract the / usr / local, the following operations need to be root.

Then execute the following command

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

At this time, / and the command will be rar unrar command local / under usr / rar. You can create connections under / usr / local / bin


Author: wanda3086
Source: CSDN
Original: https://blog.csdn.net/wanda3086/article/details/50571417
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!

++++++++++++++++++++++++++++++++++++++++++++++++++++++
(py3) [root@jumpserver-server ~]# cd /opt/
(py3) [root@jumpserver-server opt]# git clone https://github.com/jumpserver/jumpserver.git

2.2) mounted reliance rpm package
(Py3) [the root @ jumpserver-Server opt] # CD / opt /
(Py3) [the root @ jumpserver-Server opt] # CD jumpserver / requirements
(Py3) [the root @ jumpserver-Server requirements] # EPEL-Release -y install yum
(Py3) [root @ jumpserver-Server requirements] # yum -y install $ (CAT rpm_requirements.txt) // If there is no error, please continue

2.3) install python library dependencies
(py3) [root @ jumpserver- server requirements] # pip install -r requirements.txt // If there is no error, please continue

2.4)安装Redis, Jumpserver 使用 Redis 做 cache 和 celery broke
(py3) [root@jumpserver-server requirements]# yum -y install redis
(py3) [root@jumpserver-server requirements]# systemctl start redis
(py3) [root@jumpserver-server requirements]# lsof -i:6379
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
redis-ser 11281 redis 4u IPv4 90233 0t0 TCP localhost:6379 (LISTEN)

2.5)安装MySQL
(py3) [root@jumpserver-server requirements]# yum -y install mariadb mariadb-devel mariadb-server
(py3) [root@jumpserver-server requirements]# systemctl enable mariadb
(py3) [root@jumpserver-server requirements]# systemctl start mariadb
(py3) [root@jumpserver-server requirements]# systemctl status mariadb
(py3) [root@jumpserver-server requirements]# lsof -i:3306

Mysql password settings, such as password is set to 123456
(Py3) [root @ jumpserver-Server requirements] # mysql_secure_installation
......
the Set root password [the Y-/ the n-] the y-?
New password: // such as a password is 123456
Re-the Enter password new new:
...... // all other items Enter default

创建数据库Jumpserver并授权
(py3) [root@jumpserver-server requirements]# 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;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jumpserver |
| mysql |
| performance_schema |
| test |
+--------------------+

2.6) mounted python3 mysql driver: mysqlclient
since MySQLdb library does not support python3.5 +, so as to select the drive mysqlclient, pymysql written in python, slower
(py3) [root @ jumpserver- server requirements] # pip install mysqlclient

2.7) modify the configuration file jumpserver
plans to amend DevelopmentConfig configuration, since the default jumpserver using this configuration, it inherited from the Config.
(Py3) [the root @ jumpserver Server-opt] # CD / opt / jumpserver
(Py3) [@ jumpserver the root-Server jumpserver] CP # config_example.py the config.py
(Py3) [@ jumpserver the root-Server jumpserver] # Vim config .py
.....
class ProductionConfig (Config):
Pass

class DevelopmentConfig (Config): // add this line begins with
the DEBUG = True
DISPLAY_PER_PAGE = 20 is
DB_ENGINE = 'MySQL'
DB_HOST = '127.0.0.1'
DB_PORT = 3306
DB_USER = 'jumpserver'
DB_PASSWORD = '@ 123 jumpserver'
the DB_NAME = 'jumpserver '
EMAIL_HOST =' smtp.kevin.com '
EMAIL_PORT = 465
EMAIL_HOST_USER =' [email protected] '
EMAIL_HOST_PASSWORD =' @ 123 Monit '
EMAIL_USE_SSL = True
EMAIL_USE_TLS = False
EMAIL_SUBJECT_PREFIX =' [Jumpserver] '
SITE_URL =' HTTP: //192.168 .10.210: 8080 '// has been added to this line

1`# Default using Config settings, you can write if/else for different env
config = DevelopmentConfig()

2.8) generates a database table structure and initialization data
(Py3) [@ jumpserver the root-Server jumpserver] # CD / opt / jumpserver / utils
(Py3) [the root-Server @ jumpserver utils] # LS
clean_migrations.sh export_fake_data.sh load_fake_data.sh redis.conf make_migrations.sh
(Py3) [root @ jumpserver-utils Server] # bash make_migrations.sh
.....
"" "
jumpserver.config



    Jumpserver project setting file
........
  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

出现如上信息,即表示操作成功!

2.9)运行Jumpserver
(py3) [root@jumpserver-server utils]# cd /opt/jumpserver
(py3) [root@jumpserver-server jumpserver]# python run_server.py &          //按键ctrl+c结束
(py3) [root@jumpserver-server jumpserver]# 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 密码: admin

Guess you like

Origin blog.51cto.com/14375805/2421040