每年进入3-4月所有的高等院校开始了一年一度的毕业生答辩准备阶段,现如今毕业论文或者毕业设计也更加的贴近了互联发展的趋势,很多学校开始做最热话题云计算openstack架构的实现以及云计算环境搭建,先不说这个毕业设计的切入点是否正确,就说选择该题目后你如何下手?下面给大家分享千锋讲师给学员准备的 云计算毕业设计论文内容:关于jumpserver安装文档。
⼀步⼀步安装 (CentOS)
本⽂档旨在帮助⽤户了解各组件之间的关系, ⽣产环境部署建议参考 进阶安装⽂
档
云服务器快速部署参考 极速安装
安装过程中遇到问题可参考 安装过程中常⻅的问题
测试推荐环境
CPU: 64位双核处理器
内存: 4G DDR3
数据库:mysql 版本⼤于等于 5.6 mariadb 版本⼤于等于 5.5.6
环境
系统: CentOS 7
IP: 192.168.244.144
设置 selinux 和防⽕墙
$ fifirewall-cmd --zone=public --add-port=80/tcp --permanent # nginx 端⼝
$ fifirewall-cmd --zone=public --add-port=2222/tcp --permanent # ⽤户SSH登录
端⼝ coco
$ fifirewall-cmd --reload # 重新载⼊规则
$ setenforce 0
$ sed -i “s/SELINUX=enforcing/SELINUX=disabled/g” /etc/selinux/confifig
⼀. 准备 Python3 和 Python 虚拟环境
1.1 安装依赖包
$ yum -y install wget gcc epel-release git
1.2 安装 Python3.6
$ yum -y install python36 python36-devel
$ wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
$ yum -y install python36 python36-devel
1.3 建⽴ Python 虚拟环境
因为 CentOS 7 ⾃带的是 Python2, ⽽ Yum 等⼯具依赖原来的 Python, 为了不扰
乱原来的环境我们来使⽤ Python 虚拟环境$ cd /opt
$ python3.6 -m venv py3
$ source /opt/py3/bin/activate
令, 以下所有命令均在该虚拟环境中运⾏
(py3) [root@localhost py3]
⼆. 安装 Jumpserver
2.1 下载或 Clone 项⽬
项⽬提交较多 git clone 时较⼤, 你可以选择去 Github 项⽬⻚⾯直接下载zip包。
$ cd /opt/
$ git clone --depth=1 https://github.com/jumpserver/jumpserver.git
2.2 安装依赖 RPM 包
$ cd /opt/jumpserver/requirements
$ yum -y install $(cat rpm_requirements.txt) # 如果没有任何报错请继续
2.3 安装 Python 库依赖
$ pip install --upgrade pip setuptools
$ pip install -r requirements.txt
$ pip install --upgrade pip setuptools -i https://mirrors.aliyun.com/pypi/simple/
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
2.4 安装 Redis, Jumpserver 使⽤ Redis 做 cache 和 celery broke
$ yum -y install redis
$ systemctl enable redis
$ systemctl start redis
2.5 安装 MySQL
本教程使⽤ Mysql 作为数据库, 如果不使⽤ Mysql 可以跳过相关 Mysql 安装和配
置
$ yum -y install mariadb mariadb-devel mariadb-server mariadb-shared #
centos7下安装的是mariadb
$ systemctl enable mariadb
$ systemctl start mariadb
2.6 创建数据库 Jumpserver 并授权$ DB_PASSWORD=cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 24
# ⽣成随
机数据库密码
$ echo -e “\033[31m 你的数据库密码是 $DB_PASSWORD \033[0m”
$ mysql -uroot -e "create database jumpserver default charset ‘utf8’; grant all on
jumpserver.* to ‘jumpserver’@‘127.0.0.1’ identifified by ‘$DB_PASSWORD’; flflush
privileges;"
2.7 修改 Jumpserver 配置⽂件
$ cd /opt/jumpserver
$ cp confifig_example.yml confifig.yml
$ SECRET_KEY=cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50
# ⽣成随机
SECRET_KEY
$ echo “SECRET_KEY=$SECRET_KEY” >> ~/.bashrc
$ BOOTSTRAP_TOKEN=cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
#
⽣成随机BOOTSTRAP_TOKEN
$ echo “BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN” >> ~/.bashrc
$ sed -i “s/SECRET_KEY:/SECRET_KEY: $SECRET_KEY/g” /opt/jumpserver/
confifig.yml
$ sed -i "s/BOOTSTRAP_TOKEN:/BOOTSTRAP_TOKEN:
$BOOTSTRAP_TOKEN/g" /opt/jumpserver/confifig.yml
$ sed -i “s/# DEBUG: true/DEBUG: false/g” /opt/jumpserver/confifig.yml
$ sed -i “s/# LOG_LEVEL: DEBUG/LOG_LEVEL: ERROR/g” /opt/jumpserver/
confifig.yml
$ sed -i "s/# SESSION_EXPIRE_AT_BROWSER_CLOSE: false/
SESSION_EXPIRE_AT_BROWSER_CLOSE: true/g" /opt/jumpserver/
confifig.yml
$ sed -i “s/DB_PASSWORD: /DB_PASSWORD: $DB_PASSWORD/g” /opt/
jumpserver/confifig.yml
$ echo -e “\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m”
$ echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN
\033[0m"
$ vi confifig.yml # 确认内容有没有错误
SECRET_KEY:
BOOTSTRAP_TOKEN:
Production disable it
DEBUG: false
docs.djangoproject.com/en/1.10/topics/logging/
LOG_LEVEL: ERROR
close
SESSION_EXPIRE_AT_BROWSER_CLOSE: true
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD:
DB_NAME: jumpserver
HTTP_BIND_HOST: 0.0.0.0HTTP_LISTEN_PORT: 8080
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
2.8 运⾏ Jumpserver
$ cd /opt/jumpserver
$ ./jms start all -d # 后台运⾏使⽤ -d 参数./jms start all -d
参数
运⾏不报错, 请继续往下操作
三. 安装 SSH Server 和 WebSocket Server: Coco
3.1 下载或 Clone 项⽬
$ cd /opt
$ source /opt/py3/bin/activate
$ git clone --depth=1 https://github.com/jumpserver/coco.git
3.2 安装依赖
$ cd /opt/coco/requirements
$ yum -y install ( c a t r p m r e q u i r e m e n t s . t x t ) (cat rpm_requirements.txt) (catrpmrequirements.txt) pip install -r requirements.txt
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
3.3 修改配置⽂件并运⾏
$ cd /opt/coco
$ cp confifig_example.yml confifig.yml
$ sed -i "s/BOOTSTRAP_TOKEN: /
BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/confifig.yml
$ sed -i “s/# LOG_LEVEL: INFO/LOG_LEVEL: ERROR/g” /opt/coco/confifig.yml
$ vi confifig.yml
CORE_HOST: http://127.0.0.1:8080
BOOTSTRAP_TOKEN:
LOG_LEVEL: ERROR
$ ./cocod start -d # 后台运⾏使⽤ -d 参数./cocod start -d
参数
四. 安装 Web Terminal 前端: Luna
Luna 已改为纯前端, 需要 Nginx 来运⾏访问访问(https://github.com/jumpserver/luna/releases)下载对应版本的 release 包, 直
接解压不需要编译
4.1 解压 Luna
$ cd /opt
$ wget https://github.com/jumpserver/luna/releases/download/1.5.0/luna.tar.gz
$ wget https://demo.jumpserver.org/download/luna/1.5.0/luna.tar.gz
$ tar xf luna.tar.gz
$ chown -R root:root luna
五. 安装 Windows ⽀持组件(如果不需要管理 windows 资产, 可以直接跳过这⼀
步)
5.1 安装依赖
$ rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop
release-0-5.el7.nux.noarch.rpm
$ 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
$ yum install -y java-1.8.0-openjdk libtool
$ yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
$ yum install -y ffmpeg-devel freerdp-devel freerdp-plugins pango-devel libssh2-
devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel
libvorbis-devel libwebp-devel ghostscript
5.2 编译安装 guacamole 服务
$ cd /opt
$ git clone --depth=1 https://github.com/jumpserver/docker-guacamole.git
$ cd /opt/docker-guacamole/
$ tar -xf guacamole-server-0.9.14.tar.gz
$ cd guacamole-server-0.9.14
$ autoreconf -fifi
$ ./confifigure --with-init-dir=/etc/init.d
$ make && make install
$ ln -s /usr/local/lib/freerdp/*.so /usr/lib64/freerdp/
$ cd …
$ rm -rf guacamole-server-0.9.14$ ldconfifig
5.3 配置 Tomcat
$ mkdir -p /confifig/guacamole /confifig/guacamole/lib /confifig/guacamole/
extensions # 创建 guacamole ⽬录
$ ln -sf /opt/docker-guacamole/guacamole-auth-jumpserver-0.9.14.jar /confifig/
guacamole/extensions/guacamole-auth-jumpserver-0.9.14.jar
$ ln -sf /opt/docker-guacamole/root/app/guacamole/guacamole.properties /
confifig/guacamole/guacamole.properties # guacamole 配置⽂件
$ cd /confifig
$ wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.40/bin/
apache-tomcat-8.5.40.tar.gz
$ tar xf apache-tomcat-8.5.40.tar.gz
$ rm -rf apache-tomcat-8.5.40.tar.gz
$ mv apache-tomcat-8.5.40 tomcat8
$ rm -rf /confifig/tomcat8/webapps/*
$ ln -sf /opt/docker-guacamole/guacamole-0.9.14.war /confifig/tomcat8/webapps/
ROOT.war # guacamole client
$ sed -i ‘s/Connector port=“8080”/Connector port=“8081”/g’ /confifig/tomcat8/
conf/server.xml # 修改默认端⼝为 8081
$ sed -i ‘s/FINE/WARNING/g’ /confifig/tomcat8/conf/logging.properties # 修改 log
等级为 WARNING
$ cd /confifig
$ wget https://github.com/ibuler/ssh-forward/releases/download/v0.0.5/linux
amd64.tar.gz
$ wget https://demo.jumpserver.org/download/ssh-forward/v0.0.5/linux
amd64.tar.gz
$ tar xf linux-amd64.tar.gz -C /bin/
$ chmod +x /bin/ssh-forward
5.4 配置环境变量
$ export JUMPSERVER_SERVER=http://127.0.0.1:8080 # http://
127.0.0.1:8080 指 jumpserver 访问地址
$ echo “export JUMPSERVER_SERVER=http://127.0.0.1:8080” >> ~/.bashrc
$ export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN
$ echo “export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN” >> ~/.bashrc
$ export JUMPSERVER_KEY_DIR=/confifig/guacamole/keys
$ echo “export JUMPSERVER_KEY_DIR=/confifig/guacamole/keys” >>
~/.bashrc
$ export GUACAMOLE_HOME=/confifig/guacamole
$ echo “export GUACAMOLE_HOME=/confifig/guacamole” >> ~/.bashrc
5.5 启动 Guacamole
$ /etc/init.d/guacd start
$ sh /confifig/tomcat8/bin/startup.sh
六. 配置 Nginx 整合各组件
6.1 安装 Nginx
$ yum install yum-utils
$ vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/ r e l e a s e v e r / releasever/ releasever/basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
$ yum makecache fast
$ yum install -y nginx
$ rm -rf /etc/nginx/conf.d/default.conf
$ systemctl enable nginx
6.3 准备配置⽂件 修改 /etc/nginx/conf.d/jumpserver.conf
$ vi /etc/nginx/conf.d/jumpserver.conf
server {
listen 80; # 代理端⼝, 以后将通过此端⼝进⾏访问, 不再通过8080端⼝
client_max_body_size 100m; # 录像及⽂件上传⼤⼩限制
location /luna/ {
try_fifiles $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;
}
}
6.3 运⾏ Nginx
nginx -t # 确保配置没有问题, 有问题请先解决
$ systemctl start nginx
$ systemctl enable nginx
6.4 开始使⽤ Jumpserver
检查应⽤是否已经正常运⾏
服务全部启动后, 访问 http://192.168.244.144, 访问nginx代理的端⼝, 不要再通过
8080端⼝访问
默认账号: admin 密码: admin
到Jumpserver 会话管理-终端管理 检查 Coco Guacamole 等应⽤的注册。
测试连接
如果登录客户端是 macOS 或 Linux, 登录语法如下
$ ssh -p2222 [email protected]
$ sftp -P2222 [email protected]
密码: admin
如果登录客户端是 Windows, Xshell Terminal 登录语法如下
$ ssh [email protected] 2222
$ sftp [email protected] 2222
密码: admin如果能登陆代表部署成功
后续的使⽤请参考 快速⼊⻔ 如遇到问题可参考 FAQ