next up previous contents
Next: 安全機制 Up: NOVNC Previous: NOVNC 簡介   Contents

NOVNC 安裝與啟動

  1. 安裝 novnc python-websockify 套件
    [root@dyw219 ~]# yum install novnc python-websockify
    
  2. 切換工作目錄到 novnc。
    [root@dyw219 ~]# cd /usr/share/novnc/
    
  3. 執行 websockify,出現錯誤訊息。
    [root@dyw219 novnc]# websockify --web /usr/share/novnc 6080 163.17.27.219:5902 
    Warning: could not find self.pem
    Starting webserver and WebSockets proxy on port 6080
    Traceback (most recent call last):
      File "/usr/bin/websockify", line 5, in <module>
        from pkg_resources import load_entry_point
    ImportError: No module named pkg_resources
    Failed to start WebSockets proxy
    
  4. 下載 ez_setup.py 程式。
    [root@dyw219 novnc]# curl -O https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 10478  100 10478    0     0   4955      0  0:00:02  0:00:02 --:--:-- 37555
    
  5. 執行 ez_setup.py 程式,出現錯誤訊息。
    [root@dyw219 novnc]# python ez_setup.py
    .......
    ipython-2.2.0/egg-dist-tmp-37I8UE
    ERROR: IPython requires Python version 2.7 or 3.3 or above.
    error: Setup script exited with 1
    
  6. 執行 easy_install-2.6,升級 pip。若使用 python2.7,則執行 easy_install
    [root@dyw219 novnc]# easy_install-2.6 --upgrade pip
    
  7. 再執行 websockify 程式,雖已啟動,但有缺 numpy 模組的警告訊息。
    [root@dyw219 novnc]# websockify --web /usr/share/novnc 6080 163.17.27.219:5902
    WARNING: no 'numpy' module, HyBi protocol is slower or disabled
    WebSocket server settings:
      - Listen on :6080
      - Flash security policy server
      - Web server. Web root: /usr/share/novnc
      - No SSL/TLS support (no cert file)
      - proxying from :6080 to 163.17.27.219:5902
    
  8. 安裝 numpy 模組。
    [root@dyw219 novnc]# yum install numpy
    
  9. 再執行 websockify 程式,缺 numpy 模組的警告訊息已不見。
    [root@dyw219 novnc]# websockify --web /usr/share/novnc 6080 163.17.27.219:5902
    WebSocket server settings:
      - Listen on :6080
      - Flash security policy server
      - Web server. Web root: /usr/share/novnc
      - No SSL/TLS support (no cert file)
      - proxying from :6080 to 163.17.27.219:5902
    



2018-04-25