一步一步安装jumpserver

系统: CentOS7html

IP:192.168.170.12前端

设置防火墙和selinuxjava

[root@localhost ~]# systemctl  enable firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/basic.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
[root@localhost ~]# systemctl  start  firewalld
[root@localhost ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
[root@localhost ~]# firewall-cmd --zone=public --add-port=2222/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# setenforce 0
setenforce: SELinux is disabled
[root@localhost ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/configpython

TIM截图20190325162750

1、准备python3和Python虚拟环境mysql

1.1安装依赖包linux

[root@localhost ~]#  yum -y install wget gcc epel-release git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
  * base: mirror.jdcloud.com
  * extras: mirrors.huaweicloud.com
  * updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
---> Package gcc.x86_64 0:4.8.5-36.el7_6.1 will be installed
--> Processing Dependency: libgomp = 4.8.5-36.el7_6.1 for package: gcc-4.8.5-36.el7_6.1.x86_64
--> Processing Dependency: cpp = 4.8.5-36.el7_6.1 for package: gcc-4.8.5-36.el7_6.1.x86_64
--> Processing Dependency: libgcc >= 4.8.5-36.el7_6.1 for package: gcc-4.8.5-36.el7_6.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-36.el7_6.1.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-36.el7_6.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-36.el7_6.1.x86_64
---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-20.el7.x86_64
---> Package wget.x86_64 0:1.14-18.el7 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-36.el7_6.1 will be installed
---> Package glibc-devel.x86_64 0:2.17-260.el7_6.3 will be installed
--> Processing Dependency: glibc-headers = 2.17-260.el7_6.3 for package: glibc-devel-2.17-260.el7_6.3.x86_64
--> Processing Dependency: glibc = 2.17-260.el7_6.3 for package: glibc-devel-2.17-260.el7_6.3.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-260.el7_6.3.x86_64
---> Package libgcc.x86_64 0:4.8.5-11.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-36.el7_6.1 will be an update
---> Package libgomp.x86_64 0:4.8.5-11.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-36.el7_6.1 will be an update
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package rsync.x86_64 0:3.1.2-4.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-157.el7 will be updated
--> Processing Dependency: glibc = 2.17-157.el7 for package: glibc-common-2.17-157.el7.x86_64
---> Package glibc.x86_64 0:2.17-260.el7_6.3 will be an update
---> Package glibc-headers.x86_64 0:2.17-260.el7_6.3 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-260.el7_6.3.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-260.el7_6.3.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-157.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-260.el7_6.3 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-957.10.1.el7 will be installed
--> Finished Dependency Resolutionnginx

Dependencies Resolvedgit

=============================================================================================================================================================================================================================================
  Package                                                      Arch                                               Version                                                           Repository                                           Size
=============================================================================================================================================================================================================================================
Installing:
  epel-release                                                 noarch                                             7-11                                                              extras                                               15 k
  gcc                                                          x86_64                                             4.8.5-36.el7_6.1                                                  updates                                              16 M
  git                                                          x86_64                                             1.8.3.1-20.el7                                                    updates                                             4.4 M
  wget                                                         x86_64                                             1.14-18.el7                                                       base                                                547 k
Installing for dependencies:
  cpp                                                          x86_64                                             4.8.5-36.el7_6.1                                                  updates                                             5.9 M
  glibc-devel                                                  x86_64                                             2.17-260.el7_6.3                                                  updates                                             1.1 M
  glibc-headers                                                x86_64                                             2.17-260.el7_6.3                                                  updates                                             683 k
  kernel-headers                                               x86_64                                             3.10.0-957.10.1.el7                                               updates                                             8.0 M
  libmpc                                                       x86_64                                             1.0.1-3.el7                                                       base                                                 51 k
  mpfr                                                         x86_64                                             3.1.1-4.el7                                                       base                                                203 k
  perl-Error                                                   noarch                                             1:0.17020-2.el7                                                   base                                                 32 k
  perl-Git                                                     noarch                                             1.8.3.1-20.el7                                                    updates                                              55 k
  perl-TermReadKey                                             x86_64                                             2.30-20.el7                                                       base                                                 31 k
  rsync                                                        x86_64                                             3.1.2-4.el7                                                       base                                                403 k
Updating for dependencies:
  glibc                                                        x86_64                                             2.17-260.el7_6.3                                                  updates                                             3.7 M
  glibc-common                                                 x86_64                                             2.17-260.el7_6.3                                                  updates                                              12 M
  libgcc                                                       x86_64                                             4.8.5-36.el7_6.1                                                  updates                                             102 k
  libgomp                                                      x86_64                                             4.8.5-36.el7_6.1                                                  updates                                             157 kgithub

Transaction Summary
=============================================================================================================================================================================================================================================
Install  4 Packages (+10 Dependent packages)
Upgrade             (  4 Dependent packages)web

Total download size: 53 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/18): epel-release-7-11.noarch.rpm                                                                                                                                                                                  |  15 kB  00:00:05
(2/18): gcc-4.8.5-36.el7_6.1.x86_64.rpm                                                                                                                                                                               |  16 MB  00:00:13
(3/18): glibc-devel-2.17-260.el7_6.3.x86_64.rpm                                                                                                                                                                       | 1.1 MB  00:00:00
(4/18): glibc-headers-2.17-260.el7_6.3.x86_64.rpm                                                                                                                                                                     | 683 kB  00:00:00
(5/18): kernel-headers-3.10.0-957.10.1.el7.x86_64.rpm                                                                                                                                                                 | 8.0 MB  00:00:06
(6/18): libgcc-4.8.5-36.el7_6.1.x86_64.rpm                                                                                                                                                                            | 102 kB  00:00:00
(7/18): libgomp-4.8.5-36.el7_6.1.x86_64.rpm                                                                                                                                                                           | 157 kB  00:00:00
(8/18): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                                                                                                                 |  51 kB  00:00:00
(9/18): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                                                                                                                   | 203 kB  00:00:00
(10/18): perl-Error-0.17020-2.el7.noarch.rpm                                                                                                                                                                          |  32 kB  00:00:00
(11/18): perl-Git-1.8.3.1-20.el7.noarch.rpm                                                                                                                                                                           |  55 kB  00:00:00
(12/18): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                                                                                                                                                      |  31 kB  00:00:00
(13/18): rsync-3.1.2-4.el7.x86_64.rpm                                                                                                                                                                                 | 403 kB  00:00:00
(14/18): wget-1.14-18.el7.x86_64.rpm                                                                                                                                                                                  | 547 kB  00:00:00
(15/18): glibc-2.17-260.el7_6.3.x86_64.rpm                                                                                                                                                                            | 3.7 MB  00:00:34
(16/18): cpp-4.8.5-36.el7_6.1.x86_64.rpm                                                                                                                                                                              | 5.9 MB  00:00:38
(17/18): glibc-common-2.17-260.el7_6.3.x86_64.rpm                                                                                                                                                                     |  12 MB  00:00:33
(18/18): git-1.8.3.1-20.el7.x86_64.rpm                                                                                                                                                                                | 4.4 MB  00:01:56
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        465 kB/s |  53 MB  00:01:56
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
   Updating   : libgcc-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                           1/22
   Updating   : glibc-common-2.17-260.el7_6.3.x86_64                                                                                                                                                                                     2/22
   Updating   : glibc-2.17-260.el7_6.3.x86_64                                                                                                                                                                                            3/22
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
   Installing : mpfr-3.1.1-4.el7.x86_64                                                                                                                                                                                                  4/22
   Installing : libmpc-1.0.1-3.el7.x86_64                                                                                                                                                                                                5/22
   Installing : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                                        6/22
   Installing : cpp-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                              7/22
   Updating   : libgomp-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                          8/22
   Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                                                      9/22
   Installing : rsync-3.1.2-4.el7.x86_64                                                                                                                                                                                                10/22
   Installing : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                                          11/22
   Installing : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                                               12/22
   Installing : kernel-headers-3.10.0-957.10.1.el7.x86_64                                                                                                                                                                               13/22
   Installing : glibc-headers-2.17-260.el7_6.3.x86_64                                                                                                                                                                                   14/22
   Installing : glibc-devel-2.17-260.el7_6.3.x86_64                                                                                                                                                                                     15/22
   Installing : gcc-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                             16/22
   Installing : wget-1.14-18.el7.x86_64                                                                                                                                                                                                 17/22
   Installing : epel-release-7-11.noarch                                                                                                                                                                                                18/22
   Cleanup    : libgomp-4.8.5-11.el7.x86_64                                                                                                                                                                                             19/22
   Cleanup    : glibc-common-2.17-157.el7.x86_64                                                                                                                                                                                        20/22
   Cleanup    : glibc-2.17-157.el7.x86_64                                                                                                                                                                                               21/22
   Cleanup    : libgcc-4.8.5-11.el7.x86_64                                                                                                                                                                                              22/22
   Verifying  : libgomp-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                          1/22
   Verifying  : cpp-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                              2/22
   Verifying  : epel-release-7-11.noarch                                                                                                                                                                                                 3/22
   Verifying  : glibc-2.17-260.el7_6.3.x86_64                                                                                                                                                                                            4/22
   Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                                                      5/22
   Verifying  : kernel-headers-3.10.0-957.10.1.el7.x86_64                                                                                                                                                                                6/22
   Verifying  : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                                           7/22
   Verifying  : glibc-devel-2.17-260.el7_6.3.x86_64                                                                                                                                                                                      8/22
   Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                                        9/22
   Verifying  : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                                               10/22
   Verifying  : wget-1.14-18.el7.x86_64                                                                                                                                                                                                 11/22
   Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                                                                                                                               12/22
   Verifying  : rsync-3.1.2-4.el7.x86_64                                                                                                                                                                                                13/22
   Verifying  : libgcc-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                          14/22
   Verifying  : glibc-headers-2.17-260.el7_6.3.x86_64                                                                                                                                                                                   15/22
   Verifying  : gcc-4.8.5-36.el7_6.1.x86_64                                                                                                                                                                                             16/22
   Verifying  : glibc-common-2.17-260.el7_6.3.x86_64                                                                                                                                                                                    17/22
   Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                                                                                                                                                 18/22
   Verifying  : libgcc-4.8.5-11.el7.x86_64                                                                                                                                                                                              19/22
   Verifying  : glibc-2.17-157.el7.x86_64                                                                                                                                                                                               20/22
   Verifying  : libgomp-4.8.5-11.el7.x86_64                                                                                                                                                                                             21/22
   Verifying  : glibc-common-2.17-157.el7.x86_64                                                                                                                                                                                        22/22

Installed:
   epel-release.noarch 0:7-11                                gcc.x86_64 0:4.8.5-36.el7_6.1                                git.x86_64 0:1.8.3.1-20.el7                                wget.x86_64 0:1.14-18.el7

Dependency Installed:
   cpp.x86_64 0:4.8.5-36.el7_6.1         glibc-devel.x86_64 0:2.17-260.el7_6.3     glibc-headers.x86_64 0:2.17-260.el7_6.3     kernel-headers.x86_64 0:3.10.0-957.10.1.el7     libmpc.x86_64 0:1.0.1-3.el7     mpfr.x86_64 0:3.1.1-4.el7
   perl-Error.noarch 1:0.17020-2.el7     perl-Git.noarch 0:1.8.3.1-20.el7          perl-TermReadKey.x86_64 0:2.30-20.el7       rsync.x86_64 0:3.1.2-4.el7

Dependency Updated:
   glibc.x86_64 0:2.17-260.el7_6.3                         glibc-common.x86_64 0:2.17-260.el7_6.3                         libgcc.x86_64 0:4.8.5-36.el7_6.1                         libgomp.x86_64 0:4.8.5-36.el7_6.1

Complete!

1.2安装python3.6
[root@localhost ~]#yum -y install python36 python36-devel
Loaded plugins: fastestmirror
epel/x86_64/metalink                                                                                                                                                                                                         | 7.1 kB  00:00:00
epel                                                                                                                                                                                                                                          | 4.7 kB  00:00:00
(1/3): epel/x86_64/group_gz                                                                                                                                                                                              |  88 kB  00:00:00
(2/3): epel/x86_64/updateinfo                                                                                                                                                                                           | 1.0 MB  00:00:07
(3/3): epel/x86_64/primary_db                                                                                                                                                                                          | 6.6 MB  00:01:24
Loading mirror speeds from cached hostfile
  * base: mirror.jdcloud.com
  * epel: mirrors.yun-idc.com
  * extras: mirrors.huaweicloud.com
  * updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package python36.x86_64 0:3.6.6-2.el7 will be installed
--> Processing Dependency: python36-libs(x86-64) = 3.6.6-2.el7 for package: python36-3.6.6-2.el7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python36-3.6.6-2.el7.x86_64
---> Package python36-devel.x86_64 0:3.6.6-2.el7 will be installed
--> Processing Dependency: python-rpm-macros for package: python36-devel-3.6.6-2.el7.x86_64
--> Processing Dependency: python3-rpm-macros for package: python36-devel-3.6.6-2.el7.x86_64
--> Processing Dependency: redhat-rpm-config for package: python36-devel-3.6.6-2.el7.x86_64
--> Running transaction check
---> Package python-rpm-macros.noarch 0:3-22.el7 will be installed
--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-22.el7.noarch
---> Package python3-rpm-macros.noarch 0:3-22.el7 will be installed
---> Package python36-libs.x86_64 0:3.6.6-2.el7 will be installed
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: python36-libs-3.6.6-2.el7.x86_64
---> Package redhat-rpm-config.noarch 0:9.1.0-87.el7.centos will be installed
--> Processing Dependency: dwz >= 0.4 for package: redhat-rpm-config-9.1.0-87.el7.centos.noarch
--> Processing Dependency: zip for package: redhat-rpm-config-9.1.0-87.el7.centos.noarch
--> Processing Dependency: perl-srpm-macros for package: redhat-rpm-config-9.1.0-87.el7.centos.noarch
--> Running transaction check
---> Package dwz.x86_64 0:0.11-3.el7 will be installed
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-60.el7 for package: 1:openssl-1.0.1e-60.el7.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-16.el7_6.1 will be an update
---> Package perl-srpm-macros.noarch 0:1-8.el7 will be installed
---> Package python-srpm-macros.noarch 0:3-22.el7 will be installed
---> Package zip.x86_64 0:3.0-11.el7 will be installed
--> Running transaction check
---> Package openssl.x86_64 1:1.0.1e-60.el7 will be updated
---> Package openssl.x86_64 1:1.0.2k-16.el7_6.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
  Package                                                        Arch                                               Version                                                         Repository                                           Size
=============================================================================================================================================================================================================================================
Installing:
  python36                                                       x86_64                                             3.6.6-2.el7                                                     epel                                                  66 k
  python36-devel                                            x86_64                                             3.6.6-2.el7                                                     epel                                                  849 k
Installing for dependencies:
  dwz                                                                 x86_64                                             0.11-3.el7                                                      base                                                 99 k
  perl-srpm-macros                                        noarch                                             1-8.el7                                                            base                                                 4.6 k
  python-rpm-macros                                    noarch                                             3-22.el7                                                          epel                                                  7.5 k
  python-srpm-macros                                  noarch                                             3-22.el7                                                          epel                                                  7.0 k
  python3-rpm-macros                                  noarch                                             3-22.el7                                                         epel                                                  6.6 k
  python36-libs                                                x86_64                                            3.6.6-2.el7                                                    epel                                                  8.6 M
  redhat-rpm-config                                       noarch                                             9.1.0-87.el7.centos                                     base                                                  81 k
  zip                                                                   x86_64                                             3.0-11.el7                                                     base                                                 260 k
Updating for dependencies:
  openssl                                                          x86_64                                             1:1.0.2k-16.el7_6.1                                    updates                                            493 k
  openssl-libs                                                   x86_64                                             1:1.0.2k-16.el7_6.1                                    updates                                            1.2 M

Transaction Summary
=============================================================================================================================================================================================================================================
Install  2 Packages (+8 Dependent packages)
Upgrade             ( 2 Dependent packages)

Total download size: 12 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/12): dwz-0.11-3.el7.x86_64.rpm                                                                                                                                                                                     |  99 kB  00:00:00
(2/12): perl-srpm-macros-1-8.el7.noarch.rpm                                                                                                                                                                           | 4.6 kB  00:00:00
(3/12): openssl-libs-1.0.2k-16.el7_6.1.x86_64.rpm                                                                                                                                                                     | 1.2 MB  00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/python-rpm-macros-3-22.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY                                                               ]  0.0 B/s | 1.8 MB  --:--:-- ETA
Public key for python-rpm-macros-3-22.el7.noarch.rpm is not installed
(4/12): python-rpm-macros-3-22.el7.noarch.rpm                                                                                                                                                                         | 7.5 kB  00:00:01
(5/12): python3-rpm-macros-3-22.el7.noarch.rpm                                                                                                                                                                        | 6.6 kB  00:00:01
(6/12): python-srpm-macros-3-22.el7.noarch.rpm                                                                                                                                                                        | 7.0 kB  00:00:01
(7/12): redhat-rpm-config-9.1.0-87.el7.centos.noarch.rpm                                                                                                                                                              |  81 kB  00:00:00
(8/12): zip-3.0-11.el7.x86_64.rpm                                                                                                                                                                                     | 260 kB  00:00:00
(9/12): python36-3.6.6-2.el7.x86_64.rpm                                                                                                                                                                               |  66 kB  00:00:02
(10/12): openssl-1.0.2k-16.el7_6.1.x86_64.rpm                                                                                                                                                                         | 493 kB  00:00:03
(11/12): python36-devel-3.6.6-2.el7.x86_64.rpm                                                                                                                                                                        | 849 kB  00:00:02
(12/12): python36-libs-3.6.6-2.el7.x86_64.rpm                                                                                                                                                                         | 8.6 MB  00:00:18
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        607 kB/s |  12 MB  00:00:19
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
  Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
  Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
  Package    : epel-release-7-11.noarch (@extras)
  From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
   Updating   : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                                                  1/14
   Installing : python36-3.6.6-2.el7.x86_64                                                                                                                                                                                                        2/14
   Installing : python36-libs-3.6.6-2.el7.x86_64                                                                                                                                                                                                3/14
   Installing : dwz-0.11-3.el7.x86_64                                                                                                                                                                                                                   4/14
   Installing : python-srpm-macros-3-22.el7.noarch                                                                                                                                                                                         5/14
   Installing : python-rpm-macros-3-22.el7.noarch                                                                                                                                                                                          6/14
   Installing : zip-3.0-11.el7.x86_64                                                                                                                                                                                                                     7/14
   Installing : perl-srpm-macros-1-8.el7.noarch                                                                                                                                                                                                 8/14
   Installing : redhat-rpm-config-9.1.0-87.el7.centos.noarch                                                                                                                                                                          9/14
   Installing : python3-rpm-macros-3-22.el7.noarch                                                                                                                                                                                       10/14
   Installing : python36-devel-3.6.6-2.el7.x86_64                                                                                                                                                                                            11/14
   Updating   : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                                                         12/14
   Cleanup    : 1:openssl-1.0.1e-60.el7.x86_64                                                                                                                                                                                                  13/14
   Cleanup    : 1:openssl-libs-1.0.1e-60.el7.x86_64                                                                                                                                                                                           14/14
   Verifying  : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                                                              1/14
   Verifying  : python36-libs-3.6.6-2.el7.x86_64                                                                                                                                                                                                   2/14
   Verifying  : python3-rpm-macros-3-22.el7.noarch                                                                                                                                                                                           3/14
   Verifying  : perl-srpm-macros-1-8.el7.noarch                                                                                                                                                                                                   4/14
   Verifying  : python-rpm-macros-3-22.el7.noarch                                                                                                                                                                                             5/14
   Verifying  : zip-3.0-11.el7.x86_64                                                                                                                                                                                                                        6/14
   Verifying  : python-srpm-macros-3-22.el7.noarch                                                                                                                                                                                           7/14
   Verifying  : python36-devel-3.6.6-2.el7.x86_64                                                                                                                                                                                               8/14
   Verifying  : dwz-0.11-3.el7.x86_64                                                                                                                                                                                                                     9/14
   Verifying  : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                                                     10/14
   Verifying  : python36-3.6.6-2.el7.x86_64                                                                                                                                                                                                         11/14
   Verifying  : redhat-rpm-config-9.1.0-87.el7.centos.noarch                                                                                                                                                                           12/14
   Verifying  : 1:openssl-libs-1.0.1e-60.el7.x86_64                                                                                                                                                                                              13/14
   Verifying  : 1:openssl-1.0.1e-60.el7.x86_64                                                                                                                                                                                                     14/14

Installed:
   python36.x86_64 0:3.6.6-2.el7                                                                                      python36-devel.x86_64 0:3.6.6-2.el7

Dependency Installed:
   dwz.x86_64 0:0.11-3.el7                         perl-srpm-macros.noarch 0:1-8.el7  python-rpm-macros.noarch 0:3-22.el7  python-srpm-macros.noarch 0:3-22.el7  python3-rpm-macros.noarch 0:3-22.el7  python36-libs.x86_64 0:3.6.6-2.el7
   redhat-rpm-config.noarch 0:9.1.0-87.el7.centos  zip.x86_64 0:3.0-11.el7

Dependency Updated:
   openssl.x86_64 1:1.0.2k-16.el7_6.1                                                                                 openssl-libs.x86_64 1:1.0.2k-16.el7_6.1

Complete!

1.3创建python虚拟环境


[root@localhost ~]# cd /opt/

[root@localhost opt]# python3.6 -m venv py3
[root@localhost opt]# source /opt/py3/bin/activate

# 看到下面的提示符表明成功, 之后运行 Jumpserver 都要先运行以上 source 命令, 如下全部命令均在该虚拟环境中运行
(py3) [root@localhost opt]#

2、安装jumpserver

2.1下载或clone项目

[root@localhost ~]# cd /opt/
[root@localhost opt]# git clone https://github.com/jumpserver/jumpserver.git
Cloning into 'jumpserver'...
remote: Enumerating objects: 37124, done.
remote: Total 37124 (delta 0), reused 0 (delta 0), pack-reused 37124
Receiving objects: 100% (37124/37124), 46.39 MiB | 276.00 KiB/s, done.
Resolving deltas: 100% (25380/25380), done.

TIM截图20190325170532

2.2安装依赖rpm包

(py3) [root@localhost opt]# cd /opt/jumpserver/requirements/
(py3) [root@localhost requirements]# yum -y install $(cat rpm_requirements.txt)

TIM截图20190325171445

2.3 安装 Python 库依赖

(py3) [root@localhost requirements]# pip install --upgrade pip setuptools

TIM截图20190325171844

(py3) [root@localhost requirements]# pip install -r requirements.txt

image

2.4安装redis,jumpserver使用redis作cache和celery broke

image

设置redis开机自启动

(py3) [root@localhost requirements]# systemctl enable redis

image

启动redis服务并检查运行状态

(py3) [root@localhost requirements]# systemctl start redis
(py3) [root@localhost requirements]# systemctl status redis

image

2.5安装mariadb

(py3) [root@localhost opt]# yum -y install mariadb mariadb-devel mariadb-server

image

设置开机自启动

(py3) [root@localhost opt]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

image

启动服务

(py3) [root@localhost opt]# systemctl start mariadb
(py3) [root@localhost opt]# systemctl status mariadb
● mariadb.service - MariaDB database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
    Active: active (running) since Tue 2019-03-26 16:45:01 CST; 5s ago
   Process: 37005 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
   Process: 36923 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
  Main PID: 37004 (mysqld_safe)
    CGroup: /system.slice/mariadb.service
            ├─37004 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
            └─37165 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: 190326 16:44:59 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 36996 ...
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: To do so, start the server, then issue the following commands:
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: '/usr/bin/mysqladmin' -u root password 'new-password'
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: '/usr/bin/mysqladmin' -u root -h localhost.localdomain password 'new-password'
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: Alternatively you can run:
Mar 26 16:44:59 localhost.localdomain mariadb-prepare-db-dir[36923]: '/usr/bin/mysql_secure_installation'
Mar 26 16:44:59 localhost.localdomain mysqld_safe[37004]: 190326 16:44:59 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Mar 26 16:44:59 localhost.localdomain mysqld_safe[37004]: 190326 16:44:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Mar 26 16:45:01 localhost.localdomain systemd[1]: Started MariaDB database server.

image

2.6建立数据库jumpserver并受权

(py3) [root@localhost opt]# DB_PASSWORD=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 24`
(py3) [root@localhost opt]# echo -e "\033[31m 你的数据库密码是 $DB_PASSWORD \033[0m"
  你的数据库密码是 OBN1KITm3yiXnt37yp7mEMGd
(py3) [root@localhost opt]# mysql -uroot -e "create database jumpserver default charset 'utf8'; grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by '$DB_PASSWORD'; flush privileges;"

image

验证数据库是否建立成功

(py3) [root@localhost opt]# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| jumpserver         |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

image

2.7 修改 Jumpserver 配置文件

(py3) [root@localhost opt]# cd /opt/jumpserver/
(py3) [root@localhost jumpserver]# cp config_example.yml  config.yml
(py3) [root@localhost jumpserver]# SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`
(py3) [root@localhost jumpserver]# echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc
(py3) [root@localhost jumpserver]# BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`
(py3) [root@localhost jumpserver]# echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc
(py3) [root@localhost jumpserver]# sed -i "s/SECRET_KEY:/SECRET_KEY: $SECRET_KEY/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# sed -i "s/BOOTSTRAP_TOKEN:/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# sed -i "s/# DEBUG: true/DEBUG: false/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# sed -i "s/# LOG_LEVEL: DEBUG/LOG_LEVEL: ERROR/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# sed -i "s/# SESSION_EXPIRE_AT_BROWSER_CLOSE: false/SESSION_EXPIRE_AT_BROWSER_CLOSE: true/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# sed -i "s/DB_PASSWORD: /DB_PASSWORD: $DB_PASSWORD/g" /opt/jumpserver/config.yml
(py3) [root@localhost jumpserver]# echo -e "\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m"
  你的SECRET_KEY是 mueso6eQEmsdW5SQmLljOI39JHS89zM0pYmeNbsYZ7jL89WF7x
(py3) [root@localhost jumpserver]# echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
  你的BOOTSTRAP_TOKEN是 Uudid4MLWEuPOeq0
image

确认配置

image

2.8 运行jumpserver

(py3) [root@localhost jumpserver]# cd /opt/jumpserver/
(py3) [root@localhost jumpserver]# ./jms  start all -d

image

三. 安装 SSH Server 和 WebSocket Server: Coco

3.1下载或clone项目

(py3) [root@localhost jumpserver]# cd /opt/
(py3) [root@localhost opt]# git clone https://github.com/jumpserver/coco.git
Cloning into 'coco'...
remote: Enumerating objects: 168, done.
remote: Counting objects: 100% (168/168), done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 3353 (delta 90), reused 147 (delta 76), pack-reused 3185
Receiving objects: 100% (3353/3353), 1.68 MiB | 267.00 KiB/s, done.
Resolving deltas: 100% (2159/2159), done.

image

3.2 安装依赖

(py3) [root@localhost opt]# cd /opt/coco/requirements/
(py3) [root@localhost requirements]# yum -y install $(cat rpm_requirements.txt)

image

(py3) [root@localhost requirements]# pip install -r requirements.txt

image

3.3 修改配置文件并运行

(py3) [root@localhost requirements]# cd /opt/coco/
(py3) [root@localhost coco]# cp config_example.yml  config.yml
(py3) [root@localhost coco]# sed -i "s/BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/config.yml
(py3) [root@localhost coco]# sed -i "s/# LOG_LEVEL: INFO/LOG_LEVEL: ERROR/g" /opt/coco/config.yml

image

检查无误后,启动coco服务

(py3) [root@localhost coco]# ./cocod start -d
Use eventlet dispatch
Start coco process
image

四. 安装 Web Terminal 前端: Luna

4.1解压Luna

(py3) [root@localhost coco]# cd /opt/

(py3) [root@localhost opt]# wget https://demo.jumpserver.org/download/luna/1.4.9/luna.tar.gz
--2019-03-26 17:31:19--  https://demo.jumpserver.org/download/luna/1.4.9/luna.tar.gz
Resolving demo.jumpserver.org (demo.jumpserver.org)... 134.175.107.119
Connecting to demo.jumpserver.org (demo.jumpserver.org)|134.175.107.119|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://jumpserver-download.oss-cn-hangzhou.aliyuncs.com/download/luna/1.4.9/luna.tar.gz [following]
--2019-03-26 17:31:19--  https://jumpserver-download.oss-cn-hangzhou.aliyuncs.com/download/luna/1.4.9/luna.tar.gz
Resolving jumpserver-download.oss-cn-hangzhou.aliyuncs.com (jumpserver-download.oss-cn-hangzhou.aliyuncs.com)... 47.110.177.89
Connecting to jumpserver-download.oss-cn-hangzhou.aliyuncs.com (jumpserver-download.oss-cn-hangzhou.aliyuncs.com)|47.110.177.89|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5398780 (5.1M) [application/gzip]
Saving to: ‘luna.tar.gz’

100%[===================================================================================================================================================================================================>] 5,398,780   1.41MB/s   in 3.6s

2019-03-26 17:31:23 (1.41 MB/s) - ‘luna.tar.gz’ saved [5398780/5398780]

image

五. 安装 Windows 支持组件

5.1安装依赖包

(py3) [root@localhost opt]# mkdir /usr/local/lib/freerdp/
(py3) [root@localhost opt]# ln -s /usr/local/lib/freerdp /usr/lib64/freerdp
(py3) [root@localhost opt]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

(py3) [root@localhost opt]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Retrieving http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
    1:nux-dextop-release-0-5.el7.nux   ################################# [100%]
(py3) [root@localhost opt]# yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
Loaded plugins: fastestmirror
rpmfusion-free-release-7.noarch.rpm                                                                                                                                                                                   | 6.3 kB  00:00:00
Examining /var/tmp/yum-root-FaaS7f/rpmfusion-free-release-7.noarch.rpm: rpmfusion-free-release-7-4.noarch
Marking /var/tmp/yum-root-FaaS7f/rpmfusion-free-release-7.noarch.rpm to be installed
rpmfusion-nonfree-release-7.noarch.rpm                                                                                                                                                                                | 6.4 kB  00:00:00
Examining /var/tmp/yum-root-FaaS7f/rpmfusion-nonfree-release-7.noarch.rpm: rpmfusion-nonfree-release-7-4.noarch
Marking /var/tmp/yum-root-FaaS7f/rpmfusion-nonfree-release-7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rpmfusion-free-release.noarch 0:7-4 will be installed
---> Package rpmfusion-nonfree-release.noarch 0:7-4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
  Package                                                          Arch                                          Version                                     Repository                                                                  Size
=============================================================================================================================================================================================================================================
Installing:
  rpmfusion-free-release                                           noarch                                        7-4                                         /rpmfusion-free-release-7.noarch                                           3.6 k
  rpmfusion-nonfree-release                                        noarch                                        7-4                                         /rpmfusion-nonfree-release-7.noarch                                        3.7 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install  2 Packages

Total size: 7.4 k
Installed size: 7.4 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
   Installing : rpmfusion-free-release-7-4.noarch                                                                                                                                                                                         1/2
   Installing : rpmfusion-nonfree-release-7-4.noarch                                                                                                                                                                                      2/2
   Verifying  : rpmfusion-nonfree-release-7-4.noarch                                                                                                                                                                                      1/2
   Verifying  : rpmfusion-free-release-7-4.noarch                                                                                                                                                                                         2/2

Installed:
   rpmfusion-free-release.noarch 0:7-4                                                                                 rpmfusion-nonfree-release.noarch 0:7-4

Complete!

image


(py3) [root@localhost opt]# yum install -y java-1.8.0-openjdk libtool cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel ffmpeg-devel freerdp-devel freerdp-plugins pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel ghostscript

image

5.2 编译安装 guacamole 服务

(py3) [root@localhost opt]# pwd
/opt
(py3) [root@localhost opt]# git clone https://github.com/jumpserver/docker-guacamole.git
Cloning into 'docker-guacamole'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 453 (delta 8), reused 11 (delta 4), pack-reused 437
Receiving objects: 100% (453/453), 32.98 MiB | 78.00 KiB/s, done.
Resolving deltas: 100% (250/250), done.
(py3) [root@localhost opt]# cd /opt/docker-guacamole/
(py3) [root@localhost docker-guacamole]# tar -xf guacamole-server-0.9.14.tar.gz
(py3) [root@localhost docker-guacamole]# cd guacamole-server-0.9.14
(py3) [root@localhost guacamole-server-0.9.14]# autoreconf -fi
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'

image

image

image

image

5.3 配置 Tomcat

(py3) [root@localhost opt]# mkdir -p /config/guacamole /config/guacamole/lib /config/guacamole/extensions
(py3) [root@localhost opt]# ln -sf /opt/docker-guacamole/guacamole-auth-jumpserver-0.9.14.jar /config/guacamole/extensions/guacamole-auth-jumpserver-0.9.14.jar
(py3) [root@localhost opt]#  ln -sf /opt/docker-guacamole/root/app/guacamole/guacamole.properties /config/guacamole/guacamole.properties
(py3) [root@localhost opt]# cd /config
(py3) [root@localhost config]# wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.39/bin/apache-tomcat-8.5.39.tar.gz
--2019-03-27 15:39:47--  http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.39/bin/apache-tomcat-8.5.39.tar.gz
Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 114.247.56.117
Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|114.247.56.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9672485 (9.2M) [application/octet-stream]
Saving to: ‘apache-tomcat-8.5.39.tar.gz’

100%[===================================================================================================================================================================================================>] 9,672,485    233KB/s   in 40s

2019-03-27 15:40:28 (233 KB/s) - ‘apache-tomcat-8.5.39.tar.gz’ saved [9672485/9672485]

(py3) [root@localhost config]# tar xf apache-tomcat-8.5.39.tar.gz
(py3) [root@localhost config]# rm -rf apache-tomcat-8.5.39.tar.gz
(py3) [root@localhost config]# mv apache-tomcat-8.5.39 tomcat8
(py3) [root@localhost config]# rm -rf /config/tomcat8/webapps/*
(py3) [root@localhost config]# ln -sf /opt/docker-guacamole/guacamole-0.9.14.war /config/tomcat8/webapps/ROOT.war
(py3) [root@localhost config]# sed -i 's/Connector port="8080"/Connector port="8081"/g' /config/tomcat8/conf/server.xml
(py3) [root@localhost config]# sed -i 's/FINE/WARNING/g' /config/tomcat8/conf/logging.properties
(py3) [root@localhost config]# cd /config
(py3) [root@localhost config]# wget https://github.com/ibuler/ssh-forward/releases/download/v0.0.5/linux-amd64.tar.gz
--2019-03-27 15:41:47--  https://github.com/ibuler/ssh-forward/releases/download/v0.0.5/linux-amd64.tar.gz
Resolving github.com (github.com)... 13.229.188.59, 52.74.223.119, 13.250.177.223
Connecting to github.com (github.com)|13.229.188.59|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/152689893/71532e00-e740-11e8-9fca-c157d77c0c2f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190327%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190327T074148Z&X-Amz-Expires=300&X-Amz-Signature=38a8baef3e42faee4e9fe5bc3f6be29be4afcf23753da978786652b1761cc005&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dlinux-amd64.tar.gz&response-content-type=application%2Foctet-stream [following]
--2019-03-27 15:41:48--  https://github-production-release-asset-2e65be.s3.amazonaws.com/152689893/71532e00-e740-11e8-9fca-c157d77c0c2f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190327%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190327T074148Z&X-Amz-Expires=300&X-Amz-Signature=38a8baef3e42faee4e9fe5bc3f6be29be4afcf23753da978786652b1761cc005&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dlinux-amd64.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.86.187
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.86.187|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1826756 (1.7M) [application/octet-stream]
Saving to: ‘linux-amd64.tar.gz’

100%[===================================================================================================================================================================================================>] 1,826,756   9.18KB/s   in 3m 17s

2019-03-27 15:45:07 (9.04 KB/s) - ‘linux-amd64.tar.gz’ saved [1826756/1826756]

(py3) [root@localhost config]# tar xf linux-amd64.tar.gz -C /bin/
(py3) [root@localhost config]# chmod +x /bin/ssh-forward

image

5.4 配置环境变量

(py3) [root@localhost config]# export JUMPSERVER_SERVER=http://127.0.0.1:8080 #http://127.0.0.1:8080指jumpserver访问地址
(py3) [root@localhost config]# echo "export JUMPSERVER_SERVER=http://127.0.0.1:8080" >> ~/.bashrc
(py3) [root@localhost config]# export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN
(py3) [root@localhost config]# echo "export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc
(py3) [root@localhost config]# export JUMPSERVER_KEY_DIR=/config/guacamole/keys
(py3) [root@localhost config]# echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc
(py3) [root@localhost config]# export GUACAMOLE_HOME=/config/guacamole
(py3) [root@localhost config]#  echo "export GUACAMOLE_HOME=/config/guacamole" >> ~/.bashrc

image

5.5启动Guacamole

(py3) [root@localhost config]# /etc/init.d/guacd start
Starting guacd: guacd[59832]: INFO:     Guacamole proxy daemon (guacd) version 0.9.14 started
SUCCESS
(py3) [root@localhost config]# sh /config/tomcat8/bin/startup.sh
Using CATALINA_BASE:   /config/tomcat8
Using CATALINA_HOME:   /config/tomcat8
Using CATALINA_TMPDIR: /config/tomcat8/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /config/tomcat8/bin/bootstrap.jar:/config/tomcat8/bin/tomcat-juli.jar
Tomcat started.

image

六. 配置 Nginx 整合各组件

6.1 安装 Nginx

(py3) [root@localhost config]# yum install yum-utils

image

配置nginx源

(py3) [root@localhost config]# cat /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

image

安装nginx软件包

(py3) [root@localhost config]# yum install -y nginx

(py3) [root@localhost conf.d]# rm -rf /etc/nginx/conf.d/default.conf

image

设置开机自启动

(py3) [root@localhost config]# systemctl  enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.

image

6.3 准备配置文件 修改 /etc/nginx/conf.d/jumpserver.conf

server {
     listen 80;  # 代理端口, 之后将经过此端口进行访问, 再也不经过8080端口
     # server_name demo.jumpserver.org;  # 修改为你的域名或者注释掉

    client_max_body_size 100m;  # 录像及文件上传大小限制

    location /luna/ {
         try_files $uri / /index.html;
         alias /opt/luna/;  # luna 路径, 若是修改安装目录, 此处须要修改
     }

    location /media/ {
         add_header Content-Encoding gzip;
         root /opt/jumpserver/data/;  # 录像位置, 若是修改安装目录, 此处须要修改
     }

    location /static/ {
         root /opt/jumpserver/data/;  # 静态资源, 若是修改安装目录, 此处须要修改
     }

    location /socket.io/ {
         proxy_pass       http://localhost:5000/socket.io/;  # 若是coco安装在别的服务器, 请填写它的ip
         proxy_buffering off;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         access_log off;
     }

    location /coco/ {
         proxy_pass       http://localhost:5000/coco/;  # 若是coco安装在别的服务器, 请填写它的ip
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         access_log off;
     }

    location /guacamole/ {
         proxy_pass       http://localhost:8081/;  # 若是guacamole安装在别的服务器, 请填写它的ip
         proxy_buffering off;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection $http_connection;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         access_log off;
     }

    location / {
         proxy_pass http://localhost:8080;  # 若是jumpserver安装在别的服务器, 请填写它的ip
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
}

image

6.3运行nginx

(py3) [root@localhost config]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
(py3) [root@localhost config]# systemctl start nginx
(py3) [root@localhost config]# systemctl enable nginx

image

6.4 开始使用 Jumpserver

检查应用是否已经正常运行

服务所有启动后, 访问 http://192.168.170.12, 访问nginx代理的端口, 不要再经过8080端口访问

image

默认帐号: admin 密码: admin

到Jumpserver 会话管理-终端管理 检查 Coco Guacamole 等应用的注册。

image

Linux机器执行以下操做验证测试链接

image