Commit 8af2260e authored by wojiushixiaobai's avatar wojiushixiaobai

[Update]更新文档

parent 77ca79bb
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
&& yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \ && yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \
&& yum makecache fast \ && yum makecache fast \
&& rpm --import https://mirrors.aliyun.com/docker-ce/linux/centos/gpg \ && rpm --import https://mirrors.aliyun.com/docker-ce/linux/centos/gpg \
&& echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/7/\$basearch/\ngpgcheck=0\nenabled=1\n" > /etc/yum.repos.d/nginx.repo \ && echo -e "[nginx-stable]\nname=nginx stable repo\nbaseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/\ngpgcheck=1\nenabled=1\ngpgkey=https://nginx.org/keys/nginx_signing.key" > /etc/yum.repos.d/nginx.repo \
&& rpm --import https://nginx.org/keys/nginx_signing.key \
&& yum -y install redis mariadb mariadb-devel mariadb-server nginx docker-ce \ && yum -y install redis mariadb mariadb-devel mariadb-server nginx docker-ce \
&& systemctl enable redis mariadb nginx docker \ && systemctl enable redis mariadb nginx docker \
&& systemctl start redis mariadb \ && systemctl start redis mariadb \
......
...@@ -54,17 +54,6 @@ ...@@ -54,17 +54,6 @@
# 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行 # 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@localhost py3] (py3) [root@localhost py3]
**1.4 自动载入 Python 虚拟环境配置**
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv
.. code-block:: shell
$ cd /opt
$ git clone https://github.com/kennethreitz/autoenv.git
$ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc
$ source ~/.bashrc
二. 安装 Jumpserver 二. 安装 Jumpserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -76,10 +65,6 @@ ...@@ -76,10 +65,6 @@
$ cd /opt/ $ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git $ git clone https://github.com/jumpserver/jumpserver.git
$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境
# 首次进入 jumpserver 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**2.2 安装依赖包** **2.2 安装依赖包**
...@@ -95,6 +80,10 @@ ...@@ -95,6 +80,10 @@
$ pip install --upgrade pip setuptools $ pip install --upgrade pip setuptools
$ pip install -r requirements.txt $ 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** **2.4 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke**
.. code-block:: shell .. code-block:: shell
...@@ -225,17 +214,11 @@ ...@@ -225,17 +214,11 @@
**3.1 下载或 Clone 项目** **3.1 下载或 Clone 项目**
新开一个终端
.. code-block:: shell .. code-block:: shell
$ cd /opt $ cd /opt
$ source /opt/py3/bin/activate $ source /opt/py3/bin/activate
$ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master $ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境
# 首次进入 coco 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**3.2 安装依赖** **3.2 安装依赖**
...@@ -244,12 +227,14 @@ ...@@ -244,12 +227,14 @@
$ cd /opt/coco/requirements $ cd /opt/coco/requirements
$ pip install -r requirements.txt $ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**3.3 查看配置文件并运行** **3.3 查看配置文件并运行**
.. code-block:: shell .. code-block:: shell
$ cd /opt/coco $ cd /opt/coco
$ mkdir keys logs
$ cp config_example.yml config.yml $ cp config_example.yml config.yml
$ vim config.yml $ vim config.yml
...@@ -318,7 +303,7 @@ ...@@ -318,7 +303,7 @@
.. code-block:: shell .. code-block:: shell
$ ./cocod start # 后台运行使用 -d 参数./cocod start -d $ ./cocod start -d # 后台运行使用 -d 参数./cocod start -d
# 新版本更新了运行脚本,使用方式./cocod start|stop|status|restart 后台运行请添加 -d 参数 # 新版本更新了运行脚本,使用方式./cocod start|stop|status|restart 后台运行请添加 -d 参数
...@@ -424,10 +409,8 @@ Luna 已改为纯前端,需要 Nginx 来运行访问 ...@@ -424,10 +409,8 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ apt-get -y install nginx $ apt-get -y install nginx
$ rm -rf /etc/nginx/site-enabled/default $ rm -rf /etc/nginx/site-enabled/default
**6.2 准备配置文件 修改 /etc/nginx/site-enabled/jumpserver.conf** **6.2 准备配置文件 修改 /etc/nginx/site-enabled/jumpserver.conf**
.. code-block:: nginx .. code-block:: nginx
$ vim /etc/nginx/site-enabled/jumpserver.conf $ vim /etc/nginx/site-enabled/jumpserver.conf
...@@ -499,7 +482,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问 ...@@ -499,7 +482,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ nginx -t # 如果没有报错请继续 $ nginx -t # 如果没有报错请继续
$ nginx -s reload $ nginx -s reload
**6.4 开始使用 Jumpserver** **6.4 开始使用 Jumpserver**
服务全部启动后,访问 http://192.168.244.144 服务全部启动后,访问 http://192.168.244.144
......
...@@ -259,6 +259,7 @@ Ubuntu 18.04 安装文档 ...@@ -259,6 +259,7 @@ Ubuntu 18.04 安装文档
.. code-block:: shell .. code-block:: shell
$ apt-get -y install curl gnupg2 ca-certificates lsb-release
$ add-apt-repository "deb http://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" $ add-apt-repository "deb http://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx"
$ curl -fsSL http://nginx.org/keys/nginx_signing.key | sudo apt-key add - $ curl -fsSL http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
$ apt-get -y install nginx $ apt-get -y install nginx
......
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
$ yum -y install python36 python36-devel $ 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 虚拟环境** **1.3 建立 Python 虚拟环境**
因为 CentOS 7 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境 因为 CentOS 7 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境
...@@ -64,17 +68,6 @@ ...@@ -64,17 +68,6 @@
# 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行 # 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@localhost py3] (py3) [root@localhost py3]
**1.4 自动载入 Python 虚拟环境配置**
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv
.. code-block:: shell
$ cd /opt
$ git clone https://github.com/kennethreitz/autoenv.git
$ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc
$ source ~/.bashrc
二. 安装 Jumpserver 二. 安装 Jumpserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -86,10 +79,6 @@ ...@@ -86,10 +79,6 @@
$ cd /opt/ $ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git $ git clone https://github.com/jumpserver/jumpserver.git
$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境
# 首次进入 jumpserver 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**2.2 安装依赖 RPM 包** **2.2 安装依赖 RPM 包**
...@@ -105,6 +94,10 @@ ...@@ -105,6 +94,10 @@
$ pip install --upgrade pip setuptools $ pip install --upgrade pip setuptools
$ pip install -r requirements.txt $ 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** **2.4 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke**
.. code-block:: shell .. code-block:: shell
...@@ -244,25 +237,23 @@ ...@@ -244,25 +237,23 @@
$ cd /opt $ cd /opt
$ source /opt/py3/bin/activate $ source /opt/py3/bin/activate
$ git clone https://github.com/jumpserver/coco.git $ git clone https://github.com/jumpserver/coco.git
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境
# 首次进入 coco 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**3.2 安装依赖** **3.2 安装依赖**
.. code-block:: shell .. code-block:: shell
$ cd /opt/coco/requirements $ cd /opt/coco/requirements
$ yum -y install $(cat rpm_requirements.txt) $ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt $ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**3.3 修改配置文件并运行** **3.3 修改配置文件并运行**
.. code-block:: shell .. code-block:: shell
$ cd /opt/coco $ cd /opt/coco
$ mkdir keys logs
$ cp config_example.yml config.yml $ cp config_example.yml config.yml
$ sed -i "s/BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/config.yml $ sed -i "s/BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/config.yml
...@@ -357,8 +348,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问 ...@@ -357,8 +348,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
五. 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步) 五. 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Guacamole 需要 Tomcat 来运行
**5.1 安装依赖** **5.1 安装依赖**
.. code-block:: shell .. code-block:: shell
...@@ -441,13 +430,15 @@ Guacamole 需要 Tomcat 来运行 ...@@ -441,13 +430,15 @@ Guacamole 需要 Tomcat 来运行
.. code-block:: shell .. code-block:: shell
$ yum install yum-utils
$ vi /etc/yum.repos.d/nginx.repo $ vi /etc/yum.repos.d/nginx.repo
[nginx] [nginx-stable]
name=nginx repo name=nginx stable repo
baseurl=http://nginx.org/packages/centos/7/$basearch/ baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0 gpgcheck=1
enabled=1 enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
$ yum install -y nginx $ yum install -y nginx
$ rm -rf /etc/nginx/conf.d/default.conf $ rm -rf /etc/nginx/conf.d/default.conf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment