【鼎革‧革鼎】︰ Raspbian Stretch 《六之 F.4 》

將要如何設定酪梨 guacamole 呢?這裡作者不過假借

[TUTORIAL] Jetty and Guacamole

VNC (Virtual Network Computing)

文本,略作補充耳。

【官方佈署文件】

The web application portion of Guacamole is packaged as a fully self-contained .war file. If you downloaded Guacamole from the main project web site, this file will be called guacamole.war. Deploying this involves copying the file into the directory your servlet container uses for .war files. In the case of Tomcat, this will be CATALINA_HOME/webapps/. The location of CATALINA_HOME will vary by how Tomcat was installed, but is commonly /var/lib/tomcat, /var/lib/tomcat7, or similar:

# cp guacamole.war /var/lib/tomcat/webapps
#

 

取得對應之 .war 封裝檔

wget https://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.13-incubating.war

 

將之拷貝至 jetty9 之 webapps 目錄。

sudo cp guacamole-0.9.13-incubating.war /usr/share/jetty9/webapps/

※ 參考

pi@raspberrypi:~ cd /usr/share/jetty9/webapps pi@raspberrypi:/usr/share/jetty9/webapps ls
guacamole.war  root
pi@raspberrypi:/usr/share/jetty9/webapps </pre>   <pre class="lang:default decode:true">pi@raspberrypi:/usr/share/jetty9/webapps cd /var/cache/jetty9/data/jetty-0.0.0.0-8080-guacamole.war-_guacamole-any-5680714153949901226.dir/webapp
pi@raspberrypi:/var/cache/jetty9/data/jetty-0.0.0.0-8080-guacamole.war-_guacamole-any-5680714153949901226.dir/webapp ls app                  guacamole.css      images       META-INF fonts                guacamole.js       index.html   relocateParameters.js generated            guacamole.min.css  layouts      translations guacamole-common-js  guacamole.min.js   license.txt  WEB-INF pi@raspberrypi:/var/cache/jetty9/data/jetty-0.0.0.0-8080-guacamole.war-_guacamole-any-5680714153949901226.dir/webapp

 

【官方組構文件】

After installing Guacamole, you need to configure users and connections before Guacamole will work. This chapter covers general configuration of Guacamole and the use of its default authentication method.

Guacamole’s default authentication method reads all users and connections from a single file called user-mapping.xml. This authentication method is intended to be:

  1. Sufficient for small deployments of Guacamole.
  2. A relatively-easy means of verifying that Guacamole has been properly set up.

Other, more complex authentication methods which use backend databases, LDAP, etc. are discussed in a separate, dedicated chapters.

Regardless of the authentication method you use, Guacamole’s configuration always consists of two main pieces: a directory referred to as GUACAMOLE_HOME, which is the primary search location for configuration files, and guacamole.properties, the main configuration file used by Guacamole and its extensions.

 

樹莓派 realvnc 伺服器簡易設定檔︰

建立 /usr/share/jetty9/.guacamole 目錄

pi@raspberrypi:~ cd /usr/share/jetty9/.guacamole/ pi@raspberrypi:/usr/share/jetty9/.guacamole ls
guacamole.properties  user-mapping.xml

 

創建 guacamole.properties 文字檔

pi@raspberrypi:/usr/share/jetty9/.guacamole more guacamole.properties  # Hostname and port of guacamole proxy guacd-hostname: localhost guacd-port:     4822  # Location to read extra .jar's from lib-directory:  /usr/share/jetty9/.guacamole  # Authentication provider class auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvid er  # Properties used by BasicFileAuthenticationProvider  # Properties used by BasicFileAuthenticationProvider basic-user-mapping: /usr/share/jetty9/.guacamole/user-mapping.xml pi@raspberrypi:/usr/share/jetty9/.guacamole

 

創建 user-mapping.xml 文字檔

pi@raspberrypi:/usr/share/jetty9/.guacamole more user-mapping.xml  <user-mapping>      <authorize username="pi" password="raspberry">         <connection name="VNC-Connection">              <protocol>vnc</protocol>              <param name="hostname">localhost</param>              <param name="port">5900</param>              <param name="password">raspberry</param>        </connection>     </authorize>  </user-mapping>  pi@raspberrypi:/usr/share/jetty9/.guacamole 

 

啟用 VNC 伺服器

 

打開 VNC 伺服器對話窗,選擇使用 VNC password ,此處作者並未顧慮安全將之任意設定為 raspberry 。

 

實測者應會發現 guacd 服務在重新開機後起不來也?

pi@raspberrypi:~ service guacd status ● guacd.service - LSB: Guacamole proxy daemon    Loaded: loaded (/etc/init.d/guacd; generated; vendor preset: enabled)    Active: inactive (dead)      Docs: man:systemd-sysv-generator(8) pi@raspberrypi:~

 

雖說可以 rc.local 拗救!

pi@raspberrypi:~ more /etc/rc.local  #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing.  # Print the IP address _IP=(hostname -I) || true
if [ "_IP" ]; then   printf "My IP address is %s\n" "_IP"
fi

sudo service guacd restart

exit 0
pi@raspberrypi:~ </pre>    <span style="color: #666699;">何不就嘗試利用 systemd-sysv 相容產生器呢?!</span>  <span style="color: #ff9900;">sudo systemctl enable guacd</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ cd /run/systemd/generator.late/
pi@raspberrypi:/run/systemd/generator.late ls dphys-swapfile.service  guacd.service   multi-user.target.wants graphical.target.wants  jetty9.service  raspi-config.service pi@raspberrypi:/run/systemd/generator.late 
pi@raspberrypi:/run/systemd/generator.late more guacd.service  # Automatically generated by systemd-sysv-generator  [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/etc/init.d/guacd Description=LSB: Guacamole proxy daemon Before=multi-user.target Before=multi-user.target Before=multi-user.target Before=graphical.target After=network-online.target Wants=network-online.target  [Service] Type=forking Restart=no TimeoutSec=5min IgnoreSIGPIPE=no KillMode=process GuessMainPID=no RemainAfterExit=yes SuccessExitStatus=5 6 ExecStart=/etc/init.d/guacd start ExecStop=/etc/init.d/guacd stop pi@raspberrypi:/run/systemd/generator.late 

 

畢竟 rc-local.service 也是這麼來的!?

pi@raspberrypi:~ cd /run/systemd/generator/multi-user.target.wants/ pi@raspberrypi:/run/systemd/generator/multi-user.target.wants ls
rc-local.service
pi@raspberrypi:/run/systemd/generator/multi-user.target.wants pi@raspberrypi:/run/systemd/generator/multi-user.target.wants more rc-local.service 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
pi@raspberrypi:/run/systemd/generator/multi-user.target.wants </pre>    <span style="color: #666699;">無怪乎正常耶☆</span> <pre class="lang:default decode:true">pi@raspberrypi:~ systemctl status guacd
● guacd.service - LSB: Guacamole proxy daemon
   Loaded: loaded (/etc/init.d/guacd; generated; vendor preset: enabled)
   Active: active (running) since Wed 2017-11-08 20:04:57 CST; 1 day 20h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 420 ExecStart=/etc/init.d/guacd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/guacd.service
           ├─ 454 /usr/local/sbin/guacd -p /var/run/guacd.pid
           └─2793 /usr/local/sbin/guacd -p /var/run/guacd.pid

Warning: Journal has been rotated since unit was started. Log output is incomple
pi@raspberrypi:~ $

 

 

至於怎樣玩轉酪梨,還請讀者自讀

【官方使用文件】

Guacamole provides access to much of the functionality of a desktop from within your web browser. Although most people use remote desktop tools only when absolutely necessary, we believe that Guacamole must be aimed at becoming a primary means of accessing desktops, and the interface is thus intended to be as seamless and unobtrusive as possible.

 

哩◎