安装jumpserver

Centos7.5 安装jumpserver
同步服务器时间

#下载
[root@jumpserver ~]# yum install ntpdate -y
#同步时间
[root@jumpserver ~]# ntpdate ntp1.aliyun.com
#设置成定时任务
[root@jumpserver ~]# crontab -e
*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null

安装docker

#下载docker
[root@jumpserver ~]# yum install docker -y
#启动docker
[root@jumpserver ~]# systemctl start docker
[root@jumpserver ~]# systemctl enable docker

下载jumpserver镜像

#没有镜像的下载镜像
[root@jumpserver ~]# docker search jumpserver
#有镜像的导入镜像
[root@jumpserver ~]# ll
-rw-r--r--  1 root root 1342440960 Mar  7 15:26 jumpserver.tar.gz
[root@jumpserver ~]# docker load -i jumpserver.tar.gz 

启动容器

#启动容器
[root@jumpserver ~]# docker run --name Jumpserver -d -p 80:80 -p 2222:2222 docker.io/jumpserver/jms_all:latest
73fa6fce1aa7bc7d4d821a508246970444d7dc0862f09a2de0e7f960f74b8761
#查看是否启动,Up 状态表示容器是启动成功的
[root@jumpserver ~]# docker ps -a
CONTAINER ID        IMAGE                                 COMMAND             CREATED             STATUS              PORTS                                        NAMES
73fa6fce1aa7        docker.io/jumpserver/jms_all:latest   "entrypoint.sh"     56 seconds ago      Up 54 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:2222->2222/tcp   Jumpserver

配置jumpserver的容器

#进入容器
[root@jumpserver ~]# docker exec -it Jumpserver /bin/bash
#修改nginx主配置文件,进行定义域名并添加一些参数
[root@73fa6fce1aa7 opt]# vi /etc/nginx/nginx.conf
    include /etc/nginx/conf.d/*.conf;
    fastcgi_connect_timeout 600;         #设置连接超时时间
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;
    fastcgi_buffering on;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 128k;
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  www.lvhanzhi.xyz;    #定义域名
[root@73fa6fce1aa7 opt]# vi   /etc/nginx/scgi_params
scgi_param  SCGI               10;   #将原来的值改为10.
#配置文件语法检查
[root@73fa6fce1aa7 opt]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
#退出容器
[root@73fa6fce1aa7 opt]# exit
exit

本地host文件解析 10.0.0.62 www.lvhanzhi.xyz

posted @ 2019-03-07 15:41  吕涵之  阅读(337)  评论(1编辑  收藏  举报