久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jumpserver CentOS 7 安裝文檔

      CentOS 7 安裝文檔

      說明

      # 開頭的行表示注釋 > 開頭的行表示需要在 mysql 中執(zhí)行 $ 開頭的行表示需要執(zhí)行的命令

      本文檔適用于有一定web運維經(jīng)驗的管理員或者工程師,文中不會對安裝的軟件做過多的解釋,僅對需要執(zhí)行的內(nèi)容注部分注釋,更詳細(xì)的內(nèi)容請參考一步一步安裝。

      安裝過程中遇到問題可參考安裝過程中常見的問題

      環(huán)境

      系統(tǒng): CentOS 7 IP: 192.168.244.144 目錄: /opt 數(shù)據(jù)庫: mariadb 代理: nginx

      開始安裝

        # 防火墻 與 selinux 設(shè)置說明,如果已經(jīng)關(guān)閉了 防火墻 和 Selinux 的用戶請?zhí)^設(shè)置  $ systemctl start firewalld  $ firewall-cmd --zone=public --add-port=80/tcp --permanent  # nginx 端口  $ firewall-cmd --zone=public --add-port=2222/tcp --permanent  # 用戶SSH登錄端口 coco    --permanent  永久生效,沒有此參數(shù)重啟后失效    $ firewall-cmd --reload  # 重新載入規(guī)則    $ setsebool -P httpd_can_network_connect 1  # 設(shè)置 selinux 允許 http 訪問  $ mkdir -p /opt/guacamole/key  $ chcon -Rt svirt_sandbox_file_t /opt/guacamole/key  # 設(shè)置 selinux 允許容器對目錄讀寫    # 修改字符集,否則可能報 input/output error的問題,因為日志里打印了中文  $ localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8  $ export LC_ALL=zh_CN.UTF-8  $ echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf    # 安裝依賴包  $ yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git    # 安裝 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke  $ yum -y install redis  $ systemctl enable redis  $ systemctl start redis    # 安裝 MySQL,如果不使用 Mysql 可以跳過相關(guān) Mysql 安裝和配置,支持sqlite3, mysql, postgres等  $ yum -y install mariadb mariadb-devel mariadb-server # centos7下叫mariadb,用法與mysql一致  $ systemctl enable mariadb  $ systemctl start mariadb  # 創(chuàng)建數(shù)據(jù)庫 Jumpserver 并授權(quán)  $ mysql -uroot  > create database jumpserver default charset 'utf8';  > grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'weakPassword';  > flush privileges;    # 安裝 Nginx ,用作代理服務(wù)器整合 Jumpserver 與各個組件  $ yum -y install nginx  $ systemctl enable nginx    # 下載編譯 Python3.6.1  $ wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz  $ tar xvf Python-3.6.1.tar.xz  && cd Python-3.6.1  $ ./configure && make && make install    # 配置并載入 Python3 虛擬環(huán)境  $ cd /opt  $ python3 -m venv py3  # py3 為虛擬環(huán)境名稱,可自定義  $ source /opt/py3/bin/activate  # 退出虛擬環(huán)境可以使用 deactivate 命令    # 看到下面的提示符代表成功,以后運行 Jumpserver 都要先運行以上 source 命令,載入環(huán)境后默認(rèn)以下所有命令均在該虛擬環(huán)境中運行  (py3) [root@localhost py3]    # 自動載入 Python3 虛擬環(huán)境  $ cd /opt  $ git clone https://github.com/kennethreitz/autoenv.git  $ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc  $ source ~/.bashrc    # 下載 Jumpserver 與 Coco  $ cd /opt/  $ git clone https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master && git pull  $ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env  # 進(jìn)入 jumpserver 目錄時將自動載入 python 虛擬環(huán)境    $ cd /opt/  $ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master && git pull  $ echo "source /opt/py3/bin/activate" > /opt/coco/.env  # 進(jìn)入 coco 目錄時將自動載入 python 虛擬環(huán)境    # 安裝依賴 RPM 包  $ yum -y install $(cat /opt/jumpserver/requirements/rpm_requirements.txt)  $ yum -y install $(cat /opt/coco/requirements/rpm_requirements.txt)    # 安裝 Python 庫依賴  $ pip install --upgrade pip  $ pip install -r /opt/jumpserver/requirements/requirements.txt -i https://pypi.python.org/simple  $ pip install -r /opt/coco/requirements/requirements.txt -i https://pypi.python.org/simple  
        # 修改 Jumpserver 配置文件  $ cd /opt/jumpserver  $ cp config_example.py config.py  $ vi config.py    # 注意對齊,不要直接復(fù)制本文檔的內(nèi)容,實際內(nèi)容以文件為準(zhǔn),本文僅供參考  

      注意: 配置文件是 Python 格式,不要用 TAB,而要用空格

        """      jumpserver.config      ~~~~~~~~~~~~~~~~~        Jumpserver project setting file        :copyright: (c) 2014-2017 by Jumpserver Team      :license: GPL v2, see LICENSE for more details.  """  import os    BASE_DIR = os.path.dirname(os.path.abspath(__file__))      class Config:      # Use it to encrypt or decrypt data        # Jumpserver 使用 SECRET_KEY 進(jìn)行加密,請務(wù)必修改以下設(shè)置      # SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x'      SECRET_KEY = '請隨意輸入隨機(jī)字符串(推薦字符大于等于 50位)'        # Django security setting, if your disable debug model, you should setting that      ALLOWED_HOSTS = ['*']        # DEBUG 模式 True為開啟 False為關(guān)閉,默認(rèn)開啟,生產(chǎn)環(huán)境推薦關(guān)閉      # 注意:如果設(shè)置了DEBUG = False,訪問8080端口頁面會顯示不正常,需要搭建 nginx 代理才可以正常訪問      DEBUG = os.environ.get("DEBUG") or False        # 日志級別,默認(rèn)為DEBUG,可調(diào)整為INFO, WARNING, ERROR, CRITICAL,默認(rèn)INFO      LOG_LEVEL = os.environ.get("LOG_LEVEL") or 'WARNING'      LOG_DIR = os.path.join(BASE_DIR, 'logs')        # 使用的數(shù)據(jù)庫配置,支持sqlite3, mysql, postgres等,默認(rèn)使用sqlite3      # See https://docs.djangoproject.com/en/1.10/ref/settings/#databases        # 默認(rèn)使用SQLite3,如果使用其他數(shù)據(jù)庫請注釋下面兩行      # DB_ENGINE = 'sqlite3'      # DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3')        # 如果需要使用mysql或postgres,請取消下面的注釋并輸入正確的信息,本例使用mysql做演示(mariadb也是mysql)      DB_ENGINE = os.environ.get("DB_ENGINE") or 'mysql'      DB_HOST = os.environ.get("DB_HOST") or '127.0.0.1'      DB_PORT = os.environ.get("DB_PORT") or 3306      DB_USER = os.environ.get("DB_USER") or 'jumpserver'      DB_PASSWORD = os.environ.get("DB_PASSWORD") or 'weakPassword'      DB_NAME = os.environ.get("DB_NAME") or 'jumpserver'        # Django 監(jiān)聽的ip和端口,生產(chǎn)環(huán)境推薦把0.0.0.0修改成127.0.0.1,這里的意思是允許x.x.x.x訪問,127.0.0.1表示僅允許自身訪問      # ./manage.py runserver 127.0.0.1:8080      HTTP_BIND_HOST = '127.0.0.1'      HTTP_LISTEN_PORT = 8080        # Redis 相關(guān)設(shè)置      REDIS_HOST = os.environ.get("REDIS_HOST") or '127.0.0.1'      REDIS_PORT = os.environ.get("REDIS_PORT") or 6379      REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD") or ''      REDIS_DB_CELERY = os.environ.get('REDIS_DB') or 3      REDIS_DB_CACHE = os.environ.get('REDIS_DB') or 4        def __init__(self):          pass        def __getattr__(self, item):          return None      class DevelopmentConfig(Config):      pass      class TestConfig(Config):      pass      class ProductionConfig(Config):      pass      # Default using Config settings, you can write if/else for different env  config = DevelopmentConfig()  
        # 修改 Coco 配置文件  $ cd /opt/coco  $ cp conf_example.py conf.py  $ vi conf.py    # 注意對齊,不要直接復(fù)制本文檔的內(nèi)容  

      注意: 配置文件是 Python 格式,不要用 TAB,而要用空格

        #!/usr/bin/env python3  # -*- coding: utf-8 -*-  #    import os    BASE_DIR = os.path.dirname(__file__)      class Config:      """      Coco config file, coco also load config from server update setting below      """      # 項目名稱, 會用來向Jumpserver注冊, 識別而已, 不能重復(fù)      # NAME = "localhost"      NAME = "coco"        # Jumpserver項目的url, api請求注冊會使用, 如果Jumpserver沒有運行在127.0.0.1:8080,請修改此處      # CORE_HOST = os.environ.get("CORE_HOST") or 'http://127.0.0.1:8080'      CORE_HOST = 'http://127.0.0.1:8080'        # 啟動時綁定的ip, 默認(rèn) 0.0.0.0      # BIND_HOST = '0.0.0.0'        # 監(jiān)聽的SSH端口號, 默認(rèn)2222      # SSHD_PORT = 2222        # 監(jiān)聽的HTTP/WS端口號,默認(rèn)5000      # HTTPD_PORT = 5000        # 項目使用的ACCESS KEY, 默認(rèn)會注冊,并保存到 ACCESS_KEY_STORE中,      # 如果有需求, 可以寫到配置文件中, 格式 access_key_id:access_key_secret      # ACCESS_KEY = None        # ACCESS KEY 保存的地址, 默認(rèn)注冊后會保存到該文件中      # ACCESS_KEY_STORE = os.path.join(BASE_DIR, 'keys', '.access_key')        # 加密密鑰      # SECRET_KEY = None        # 設(shè)置日志級別 ['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'CRITICAL']      # LOG_LEVEL = 'INFO'      LOG_LEVEL = 'WARN'        # 日志存放的目錄      # LOG_DIR = os.path.join(BASE_DIR, 'logs')        # Session錄像存放目錄      # SESSION_DIR = os.path.join(BASE_DIR, 'sessions')        # 資產(chǎn)顯示排序方式, ['ip', 'hostname']      # ASSET_LIST_SORT_BY = 'ip'        # 登錄是否支持密碼認(rèn)證      # PASSWORD_AUTH = True        # 登錄是否支持秘鑰認(rèn)證      # PUBLIC_KEY_AUTH = True        # SSH白名單      # ALLOW_SSH_USER = 'all'  # ['test', 'test2']        # SSH黑名單, 如果用戶同時在白名單和黑名單,黑名單優(yōu)先生效      # BLOCK_SSH_USER = []        # 和Jumpserver 保持心跳時間間隔      # HEARTBEAT_INTERVAL = 5        # Admin的名字,出問題會提示給用戶      # ADMINS = ''      COMMAND_STORAGE = {          "TYPE": "server"      }      REPLAY_STORAGE = {          "TYPE": "server"      }        # SSH連接超時時間 (default 15 seconds)      # SSH_TIMEOUT = 15        # 語言 = en      LANGUAGE_CODE = 'zh'      config = Config()  
        # 安裝 Web Terminal 前端: Luna  需要 Nginx 來運行訪問 訪問(https://github.com/jumpserver/luna/releases)下載對應(yīng)版本的 release 包,直接解壓,不需要編譯  $ cd /opt  $ wget https://github.com/jumpserver/luna/releases/download/1.4.1/luna.tar.gz  $ tar xvf luna.tar.gz  $ chown -R root:root luna    # 安裝 Windows 支持組件(如果不需要管理 windows 資產(chǎn),可以直接跳過這一步)  $ yum remove docker-latest-logrotate docker-logrotate docker-selinux dockdocker-engine  $ yum install -y yum-utils device-mapper-persistent-data lvm2  $ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo  $ yum makecache fast  $ yum install docker-ce  $ systemctl start docker  $ docker pull jumpserver/guacamole:latest  
        # 配置 Nginx 整合各組件  $ vim /etc/nginx/conf.d/jumpserver.conf    server {      listen 80;        client_max_body_size 100m;  # 錄像上傳大小限制        location /luna/ {          try_files $uri / /index.html;          alias /opt/luna/;  # luna 路徑,如果修改安裝目錄,此處需要修改      }        location /media/ {          add_header Content-Encoding gzip;          root /opt/jumpserver/data/;  # 錄像位置,如果修改安裝目錄,此處需要修改      }        location /static/ {          root /opt/jumpserver/data/;  # 靜態(tài)資源,如果修改安裝目錄,此處需要修改      }        location /socket.io/ {          proxy_pass       http://localhost:5000/socket.io/;  # 如果coco安裝在別的服務(wù)器, 請?zhí)顚懰膇p          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 /guacamole/ {          proxy_pass       http://localhost:8081/;  # 如果docker安裝在別的服務(wù)器, 請?zhí)顚懰膇p          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安裝在別的服務(wù)器, 請?zhí)顚懰膇p          proxy_set_header X-Real-IP $remote_addr;          proxy_set_header Host $host;          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;      }  }  
        # 生成數(shù)據(jù)庫表結(jié)構(gòu)和初始化數(shù)據(jù)  $ cd /opt/jumpserver/utils  $ bash make_migrations.sh    # 運行 Jumpserver  $ cd /opt/jumpserver  $ ./jms start all  # 后臺運行使用 -d 參數(shù)./jms start all -d  # 新版本更新了運行腳本,使用方式./jms start|stop|status|restart all  后臺運行請?zhí)砑?-d 參數(shù)    # 運行 Coco  $ cd /opt/coco  $ ./cocod start  # 后臺運行使用 -d 參數(shù)./cocod start -d  # 新版本更新了運行腳本,使用方式./cocod start|stop|status|restart  后臺運行請?zhí)砑?-d 參數(shù)    # 運行 Guacamole  # 注意:這里需要修改下 http://<填寫jumpserver的url地址> 例: http://192.168.244.144 不能使用 127.0.0.1  $ docker run --name jms_guacamole -d       -p 8081:8080 -v /opt/guacamole/key:/config/guacamole/key       -e JUMPSERVER_KEY_DIR=/config/guacamole/key       -e JUMPSERVER_SERVER=http://<填寫jumpserver的url地址>       jumpserver/guacamole:latest  # docker 重啟容器的方法docker restart jms_guacamole    # 運行 Nginx  $ nginx -t   # 確保配置沒有問題, 有問題請先解決  $ systemctl start nginx    # 訪問 http://192.168.244.144 (注意,沒有 :8080,通過 nginx 代理端口進(jìn)行訪問)  # 默認(rèn)賬號: admin 密碼: admin  到會話管理-終端管理 接受 Coco Guacamole 等應(yīng)用的注冊  # 測試連接  $ ssh -p2222 admin@192.168.244.144  $ sftp -P2222 admin@192.168.244.144    密碼: admin    # 如果是用在 Windows 下,Xshell Terminal 登錄語法如下  $ ssh admin@192.168.244.144 2222  $ sftp admin@192.168.244.144 2222    密碼: admin    如果能登陸代表部署成功    # sftp默認(rèn)上傳的位置在資產(chǎn)的 /tmp 目錄下  # windows拖拽上傳的位置在資產(chǎn)的 Guacamole RDP上的 G 目錄下    # 其他的ssh及sftp客戶端這里就不多做說明,自行搜索使用  

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號