Commit 8a3bcb28 authored by wojiushixiaobai's avatar wojiushixiaobai

修复自启

parent a6c33fd5
...@@ -403,7 +403,7 @@ Luna 已改为纯前端,需要 Nginx 来运行访问 ...@@ -403,7 +403,7 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ ./configure --with-init-dir=/etc/init.d $ ./configure --with-init-dir=/etc/init.d
$ make && make install $ make && make install
$ cd .. $ cd ..
$ rm -rf guacamole-server-0.9.14.tar.gz guacamole-server-0.9.14 \ $ rm -rf guacamole-server-0.9.14 \
$ ldconfig $ ldconfig
$ mkdir -p /config/guacamole /config/guacamole/lib /config/guacamole/extensions # 创建 guacamole 目录 $ mkdir -p /config/guacamole /config/guacamole/lib /config/guacamole/extensions # 创建 guacamole 目录
...@@ -430,8 +430,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问 ...@@ -430,8 +430,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ export JUMPSERVER_SERVER=http://127.0.0.1:8080 # http://127.0.0.1:8080 指 jumpserver 访问地址 $ 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 $ echo "export JUMPSERVER_SERVER=http://127.0.0.1:8080" >> ~/.bashrc
$ export JUMPSERVER_ENABLE_DRIVE=true
$ echo "export JUMPSERVER_ENABLE_DRIVE=true " >> ~/.bashrc
$ export JUMPSERVER_KEY_DIR=/config/guacamole/keys $ export JUMPSERVER_KEY_DIR=/config/guacamole/keys
$ echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc $ echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc
$ export GUACAMOLE_HOME=/config/guacamole $ export GUACAMOLE_HOME=/config/guacamole
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:: ::
# 启动 # 启动
$ vim /opt/start_jms.sh $ vi /opt/start_jms.sh
#!/bin/bash #!/bin/bash
set -e set -e
...@@ -28,10 +28,19 @@ ...@@ -28,10 +28,19 @@
fi fi
echo -e "\033[31m 正常启动 Jumpserver ... \033[0m" echo -e "\033[31m 正常启动 Jumpserver ... \033[0m"
# jumpserver
source $Project/py3/bin/activate source $Project/py3/bin/activate
cd $Project/jumpserver && ./jms start -d cd $Project/jumpserver && ./jms start -d
# guacamole
export GUACAMOLE_HOME=/config/guacamole
export JUMPSERVER_KEY_DIR=/config/guacamole/keys
export JUMPSERVER_SERVER=http://127.0.0.1:8080
/etc/init.d/guacd start /etc/init.d/guacd start
cd /config/tomcat8/bin && ./startup.sh cd /config/tomcat8/bin && ./startup.sh
# coco
cd $Project/coco && ./cocod start -d cd $Project/coco && ./cocod start -d
exit 0 exit 0
...@@ -39,7 +48,7 @@ ...@@ -39,7 +48,7 @@
:: ::
# 停止 # 停止
$ vim /opt/stop_jms.sh $ vi /opt/stop_jms.sh
#!/bin/bash #!/bin/bash
set -e set -e
...@@ -68,7 +77,7 @@ Docker 组件部署设置自启 ...@@ -68,7 +77,7 @@ Docker 组件部署设置自启
:: ::
# 启动 # 启动
$ vim /opt/start_jms.sh $ vi /opt/start_jms.sh
#!/bin/bash #!/bin/bash
set -e set -e
...@@ -99,7 +108,7 @@ Docker 组件部署设置自启 ...@@ -99,7 +108,7 @@ Docker 组件部署设置自启
:: ::
# 停止 # 停止
$ vim /opt/stop_jms.sh $ vi /opt/stop_jms.sh
#!/bin/bash #!/bin/bash
set -e set -e
......
...@@ -17,13 +17,18 @@ ...@@ -17,13 +17,18 @@
- 系统: CentOS 7 - 系统: CentOS 7
- IP: 192.168.244.144 - IP: 192.168.244.144
- 关闭 selinux 和防火墙 - 设置 selinux 和防火墙
:: ::
# CentOS 7 # CentOS 7
$ setenforce 0 # 临时关闭,重启后失效 $ firewall-cmd --zone=public --add-port=80/tcp --permanent # nginx 端口
$ systemctl stop firewalld.service # 临时关闭,重启后失效 $ firewall-cmd --zone=public --add-port=2222/tcp --permanent # 用户SSH登录端口 coco
$ firewall-cmd --reload # 重新载入规则
$ setenforce 0
$ sed -i "s/enforcing/disabled/g" `grep enforcing -rl /etc/selinux/config`
# 修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文 # 修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文
$ localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8 $ localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
...@@ -88,7 +93,7 @@ ...@@ -88,7 +93,7 @@
:: ::
$ cd /opt/ $ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master $ git clone https://github.com/jumpserver/jumpserver.git
$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境 $ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境
# 首次进入 jumpserver 文件夹会有提示,按 y 即可 # 首次进入 jumpserver 文件夹会有提示,按 y 即可
...@@ -138,10 +143,11 @@ ...@@ -138,10 +143,11 @@
:: ::
$ mysql $ mysql -uroot
> create database jumpserver default charset 'utf8'; > create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'weakPassword'; > grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'weakPassword';
> flush privileges; > flush privileges;
> quit
**2.7 修改 Jumpserver 配置文件** **2.7 修改 Jumpserver 配置文件**
...@@ -243,7 +249,7 @@ ...@@ -243,7 +249,7 @@
:: ::
$ cd /opt/jumpserver/utils $ cd /opt/jumpserver/utils
$ bash make_migrations.sh $ sh make_migrations.sh
**2.9 运行 Jumpserver** **2.9 运行 Jumpserver**
...@@ -267,7 +273,7 @@ ...@@ -267,7 +273,7 @@
$ 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
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境 $ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境
# 首次进入 coco 文件夹会有提示,按 y 即可 # 首次进入 coco 文件夹会有提示,按 y 即可
...@@ -415,11 +421,11 @@ Guacamole 需要 Tomcat 来运行 ...@@ -415,11 +421,11 @@ Guacamole 需要 Tomcat 来运行
:: ::
$ 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
$ rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro $ 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 $ 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 git gcc java-1.8.0-openjdk libtool $ yum install -y java-1.8.0-openjdk libtool
$ yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel $ yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
$ yum install -y ffmpeg-devel freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel ghostscript $ yum install -y ffmpeg-devel freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel ghostscript
...@@ -441,7 +447,7 @@ Guacamole 需要 Tomcat 来运行 ...@@ -441,7 +447,7 @@ Guacamole 需要 Tomcat 来运行
$ ./configure --with-init-dir=/etc/init.d $ ./configure --with-init-dir=/etc/init.d
$ make && make install $ make && make install
$ cd .. $ cd ..
$ rm -rf guacamole-server-0.9.14.tar.gz guacamole-server-0.9.14 $ rm -rf guacamole-server-0.9.14
$ ldconfig $ ldconfig
**5.3 配置 Tomcat** **5.3 配置 Tomcat**
...@@ -468,8 +474,6 @@ Guacamole 需要 Tomcat 来运行 ...@@ -468,8 +474,6 @@ Guacamole 需要 Tomcat 来运行
$ export JUMPSERVER_SERVER=http://127.0.0.1:8080 # http://127.0.0.1:8080 指 jumpserver 访问地址 $ 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 $ echo "export JUMPSERVER_SERVER=http://127.0.0.1:8080" >> ~/.bashrc
$ export JUMPSERVER_ENABLE_DRIVE=true
$ echo "export JUMPSERVER_ENABLE_DRIVE=true " >> ~/.bashrc
$ export JUMPSERVER_KEY_DIR=/config/guacamole/keys $ export JUMPSERVER_KEY_DIR=/config/guacamole/keys
$ echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc $ echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc
$ export GUACAMOLE_HOME=/config/guacamole $ export GUACAMOLE_HOME=/config/guacamole
...@@ -493,7 +497,7 @@ Guacamole 需要 Tomcat 来运行 ...@@ -493,7 +497,7 @@ Guacamole 需要 Tomcat 来运行
$ yum -y install nginx $ yum -y install nginx
$ vim /etc/nginx/nginx.conf $ vi /etc/nginx/nginx.conf
... 原内容 ... 原内容
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
...@@ -525,7 +529,7 @@ Guacamole 需要 Tomcat 来运行 ...@@ -525,7 +529,7 @@ Guacamole 需要 Tomcat 来运行
:: ::
$ vim /etc/nginx/conf.d/jumpserver.conf $ vi /etc/nginx/conf.d/jumpserver.conf
# 注意注释 nginx.conf 里面的 server {} 内容 ,CentOS 6 需要修改文件 /etc/nginx/cond.f/default.conf # 注意注释 nginx.conf 里面的 server {} 内容 ,CentOS 6 需要修改文件 /etc/nginx/cond.f/default.conf
server { server {
......
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