http://docs.jumpserver.org/zh/docs/introduce.html
启动脚本
#!/bin/bash set -e export LANG=zh_CN.UTF- # 项目安装位置,默认是/opt Project=/data1/jumpserver pid=`ps -ef | grep -v grep | egrep '(gunicorn|celery|beat|cocod)' | awk '{print $2}'` if [ "$pid" != "" ]; then echo -e "\033[31m 检测到 Jumpserver 进程未退出,结束中 \033[0m" cd $Project && sh stop_jms.sh sleep 5s pid1=`ps -ef | grep -v grep | egrep '(gunicorn|celery|beat|cocod)' | awk '{print $2}'` if [ "$pid1" != "" ]; then echo -e "\033[31m 检测到 Jumpserver 进程任未退出,强制结束中 \033[0m" ${pid1} fi fi echo -e "\033[31m 正常启动 Jumpserver ... \033[0m" # jumpserver source $Project/py3/bin/activate cd $Project/ && ./jms start all -d # coco cd $Project/coco && ./cocod start -d exit
停止脚本
#!/bin/bash set -e # 项目安装位置,默认是/opt Project=/usr/local/Jumpserver source $Project/py3/bin/activate cd $Project/coco && ./cocod stop cd $Project/ && ./jms stop exit
nginx配置
server { listen ; server_name jumpserver.xxx.com; # 修改成你的域名或者注释掉 client_max_body_size 100m; # 录像及文件上传大小限制 location ~ /luna/.*\.(svg|eot|ico|woff|woff2|ttf|js|css|png|json|txt)$ { #try_files $uri / /index.html; #alias /data1/Jumpserver/jumpserver/luna/; # luna 路径,如果修改安装目录,此处需要修改 rewrite ^/luna/(.*)$ http://jumpserver.oss-cn-hangzhou.aliyuncs.com/luna/$1 permanent; add_header Access-Control-Allow-Origin 'http://jumpserver.oss-cn-hangzhou.aliyuncs.com'; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; access_log off; } location /luna/ { try_files $uri / /index.html; alias /usr/local/Jumpserver/luna/; # luna 路径,如果修改安装目录,此处需要修改 } location /media/ { add_header Content-Encoding gzip; root /usr/local/Jumpserver/data/; # 录像位置,如果修改安装目录,此处需要修改 } location /static/ { #root /usr/local/Jumpserver/data/; # 静态资源,如果修改安装目录,此处需要修改 rewrite ^/static/(.*)$ http://jumpserver.oss-cn-hangzhou.aliyuncs.com/data/static/$1 permanent; add_header Access-Control-Allow-Origin 'http://jumpserver.oss-cn-hangzhou.aliyuncs.com'; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; access_log off; } location /socket.io/ { proxy_pass http://127.0.0.1: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://127.0.0.1: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://127.0.0.1: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://127.0.0.1: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; } }
阿里云oss客户端工具
https://help.aliyun.com/document_detail/61872.html?spm=a2c4g.11186623.6.1370.497f65d30E4SWw