$ yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
$ 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
$ 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
$ ls / usr / bin / python *
$ vim / usr / bin / yum
$ cd / opt /
$ git clone --depth = 1 https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master
$ cd / opt
$ unzip jumpserver-master
$ mv jumpserver-master jumpserver
$ cd jumpserver
$ cd / opt / jumpserver / requirements
$ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt
$ yum -y安装redis
$ /etc/init.d/redis start
$ yum -y安装mysql mysql-devel mysql-server
$ /etc/init.d/mysqld start
$ mysql
>创建数据库跳转服务器默认字符集'utf8';
>全部授予jumpserver。*跳转到'123456'标识的'localhost';
$ cd / opt / jumpserver
$ cp config_example.py config.py
$ vi config.py
##注意:配置文件是Python格式,不要用TAB,而要用空格
class DevelopmentConfig(Config):
DEBUG = True
DB_ENGINE ='mysql'
DB_HOST ='localhost'
DB_PORT = 3306
DB_USER ='jumpserver'
DB_PASSWORD ='123456'
DB_NAME ='jumpserver'
$ cd / opt / jumpserver / utils
$ bash make_migrations.sh
$ cd / opt / jumpserver
$ ./jms start all#后台运行使用-d参数./jms start all -d
#新版本更新了运行脚本,使用方式./jms start | stop | status | restart所有后台运行请添加-d参数
$ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master
$ cd / opt / coco / requirements
$ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt -i https://pypi.org/simple
$ cd / opt / coco
$ cp conf_example.py conf.py#如果coco与jumpserver分开部署,请手动修改conf.py
$ ./cocod start#后台运行使用-d参数./cocod start -d
$ cd / opt
$ wget https://github.com/jumpserver/luna/releases/download/1.3.0/dist.tar.gz(下不下来的话手动去github上下)
$ tar xf dist.tar.gz
$ mv dist luna
$ yum -y安装nginx
$ vim /etc/nginx/nginx.conf
...省略
#把默认服务器配置块改成这样
服务器{
听80;
proxy_set_header X-Real-IP $ remote_addr;
proxy_set_header主机$主机;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
位置/卢纳/ {
try_files $ uri / /index.html;
别名/ opt / luna /;
}
location / media / {
add_header内容编码gzip;
root / opt / jumpserver / data /;
}
位置/静态/ {
root / opt / jumpserver / data /;
}
位置/socket.io/ {
proxy_pass http:// localhost:5000 / socket.io /; #如果coco安装在别的服务器上,请填写它的ip
proxy_buffering关闭;
proxy_http_version 1.1;
proxy_set_header升级$ http_upgrade;
proxy_set_header连接“升级”;
}
位置/鳄梨酱/ {
proxy_pass http:// localhost:8081 /; #如果guacamole安装在别的服务器上,请填写它的ip
proxy_buffering关闭;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header升级$ http_upgrade;
proxy_set_header连接$ http_connection;
access_log off;
}
位置 / {
proxy_pass http:// localhost:8080; #如果jumpserver安装在别的服务器上,请填写它的ip
}
}
...省略
$ nginx -t#确保配置没有问题,有问题请先解决
$ /etc/init.d/nginx start
$ cd / opt / jumpserver
$ ./jms status#确定jumpserver已经运行,如果没有运行请重新启动jumpserver
$ cd / opt / coco
$ ./cocod status#确定jumpserver已经运行,如果没有运行请重新启动coco
有关jumpserver使用介绍请关注我的这篇博客