摘要html
在网上看到一篇Guacamole官方手册的翻译,可是找不到后续,因而想本身也翻译几篇,有时间的话,会尽可能多翻译一些。 原文地址:http://guacamole.incubator.apache.org/doc/gug/index.html
可本人安装配置总结后的步骤:http://www.cnblogs.com/ji-yun/p/4982498.htmlmysql
Guacamole 分为两个部分:一部分是guacamole-server,它提供guacd 代理和关联包;另外一部分是guacamole-client,它经过servlet容器在Tomcat上给客户端提供服务。linux
guacamole-server包含全部Guacamole链接远程桌面所需的本地、服务端组件。它还提供一个通用的C库——libguac、全部其它本地组建的依赖、以及为每一个支持的协议单独的库和Guacamole的核心 guacd。,git
guacd是运行在Guacamole服务端上代理服务的守护进程,接收用户请求Guacamole web应用的隧道链接,而后代替用户链接远程桌面。编译guacd生成可执行文件,它能够手动执行,若是你愿意,也可让它开机自启动。github
为了编译guacamole-server,你须要C编译器(例如:GCC)以及guacamole-server所依赖的库。一些依赖是必需的,还有一些是可选择的。但可选择的那些依赖能够增长一些额外的特性。web
为了编译guacamole-server,你须要这些包:Cairo, libjpeg, libpng, and the OSSP UUID。这些包在任何状况下都是必须安装的,没有它们Guacamole就编译不了。sql
库名shell |
特性apache |
||||||||
Cairo浏览器 |
Cairo 是被libguac 用来绘图的. 没有它Guacamole就实现不了此功能。
|
||||||||
libjpeg-turbo 为libguac 提供 JPEG 的支持. 没有它Guacamole就没法编译。
若是libjpeg-turbo 在你的平台上不可用, 而且你不但愿用源码编译它, libjpeg 也会照常工做,只是速度不会那么快。
|
|||||||||
libpng 被 libguac 用来写PNG 图像, 它是Guacamole 协议使用的核心图像类型. Guacamole 没有libpng就不能正常运转..
|
|||||||||
OSSP UUID 被libguac 用来设计每个Guacamole链接惟一的 ID. 这些惟一的ID是链接分享的基础。
|
可选择性的依赖决定Guacamole哪些支持的协议会被安装,而且决定关于这些协议的额外特性是否可用。
Guacamole目前支持的协议有:VNC、RDP、SSH和telnet。每一种协议对应一个独立的库,若是你安装了它对应的依赖,这些独立的库就会随着guacamole-server被编译。
VNC的支持依赖于libvncclient,它是libVNCServer的一部分,RDP的支持依赖于FreeRDP 1.0或更高的版本,SSH的支持依赖于libssh2,telnet依赖于libtelnet。Pango是一个字体、文本布局库,为SSH和telnet提供支持。
Library name |
Features |
||||
FreeRDP is required for RDP support. If you do not wish to build RDP support, this library is not needed.
|
|||||
Pango is a text layout library which Guacamole's SSH and telnet support uses to render text. If you do not wish to build SSH or telnet support, this library is not needed.
|
|||||
libssh2 is required for SSH support. If you do not wish to build SSH support, this library is not needed.
|
|||||
libtelnet is required for telnet support. If you do not wish to build telnet support, this library is not needed.
|
|||||
libVNCServer provides libvncclient, which is required for VNC support. If you do not wish to build VNC support, this library is not needed.
|
|||||
PulseAudio provides libpulse, which is used by Guacamole's VNC support to provide experimental audio support. If you are not going to be using the experimental audio support for VNC, you do not need this library.
|
|||||
OpenSSL provides support for SSL and TLS - two common encryption schemes that make up the majority of encrypted web traffic. If you have libssl installed, guacd will be built with SSL support, allowing communication between the web application and guacd to be encrypted. This library is also required for SSH support for the sake of manipulating public/private keys. Without SSL support, there will be no option to encrypt communication to guacd, and support for SSH cannot be built.
|
|||||
libvorbis provides support for Ogg Vorbis - a free and open standard for sound compression. If installed, libguac will be built with support for Ogg Vorbis, and protocols supporting audio will use Ogg Vorbis compression when possible. Otherwise, sound will only be encoded as WAV (uncompressed), and will only be available if your browser also supports WAV.
|
|||||
libwebp is used by libguac to write WebP images. Though support for WebP is not mandated by the Guacamole protocol, WebP images will be used if supported by both the browser and by libguac. Lacking WebP support, Guacamole will simply use JPEG in cases that it would have preferred WebP.
|
你能够在Guacamole的项目网站上获取一份guacamole-server 源码。最新的稳定发行版是通过了Guacamole小组的测试,认为适合公众使用的版本。从项目网站上下载的.tar.gz格式压缩包,能够用过下列命令解压:
$ git clone git://github.com/glyptodon/guacamole-server.git
Cloning into 'guacamole-server'... remote: Counting objects: 6769, done. remote: Compressing objects: 100% (2244/2244), done. remote: Total 6769 (delta 3058), reused 6718 (delta 3008) Receiving objects: 100% (6769/6769), 2.32 MiB | 777 KiB/s, done. Resolving deltas: 100% (3058/3058), done. $
若是你想获得最新的代码,而且不关心它没有通过稳定发行版同样严格的测试,你也能够用Guacamole团队在Github上的仓库里克隆一份:
$ git clone git://github.com/glyptodon/guacamole-server.git
Cloning into 'guacamole-server'... remote: Counting objects: 6769, done. remote: Compressing objects: 100% (2244/2244), done. remote: Total 6769 (delta 3058), reused 6718 (delta 3008) Receiving objects: 100% (6769/6769), 2.32 MiB | 777 KiB/s, done. Resolving deltas: 100% (3058/3058), done. $
当你把guacamole-server源码下载下来,而且解压后,就能够运行configure命令。这是一个被GNU Autotools自动触发的shell脚本,GNU Autotools是一种流行的编译系统,也被Guacamole 所使用。正在运行的configure
命令会判断哪些库在你的系统上有效,而且会根据你所安装的依赖选择合适的组件来编译。
注意:若是是直接从git上下载的源码,并不包含configure脚本,所以自动生成源码没有包含在工程仓库中。若是你是从git仓库中直接下载的源码,就须要手动生成configure:
$ cd guacamole-server/ $ autoreconf -fi $
执行上面的命令会安装GNU Autotools。
从项目官网上下载的源代码文档包含configure脚本和全部其它编译所须要的文件,所以在编译的机器上不须要安装GNU Autotools。
一旦你运行了configure
命令,你就能看到已经安装的库的列表,它会决定你哪些功能会被编译:
$ ./configure --with-init-dir=/etc/init.d checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... ------------------------------------------------ guacamole-server version 0.9.9
------------------------------------------------ Library status: freerdp ............. yes pango ............... yes libssh2 ............. yes libssl .............. yes libtelnet ........... yes libVNCServer ........ yes libvorbis ........... yes libpulse ............ yes libwebp ............. yes Protocol support: RDP ....... yes SSH ....... yes Telnet .... yes VNC ....... yes Init scripts: /etc/init.d Type "make" to compile guacamole-server. $
上面显示的--with-init-dir=/etc/init.d命令,为guacd 安装启动脚本到/etc/init.d目录,这样咱们就很容易的在系统启动后自动运行guacd 配置脚本。若是你不但愿guacd 开机自启动,就去掉 --with-init-dir
选项。若是包含你系统发行版的启动脚本不一样于
/etc/init.d目录,就须要用正确的路径代替/etc/init.d。你也许须要查询你发行版的文档,或者对/etc作一个小调查来决定正确的位置。
在这里,configure
命令会找到全部的可选择的依赖包,并根据所安装的依赖包来编译所支持的全部协议,甚至在RDP协议下支持Ogg Vorbis 声音。若是你缺失一些包,上面显示“yes”的结果会变成“no”。若是一个必需包缺失了,脚本将会完全运行失败,而且你须要安装所缺失的依赖。若是在运行configure
命令后,你发现你想要的一些功能没有被支持,你就须要安装相应的依赖而且再运行一次configure
命令。
注意:SSH和telnet的正常支持都须要安装了相应的字体,不然输出到终端的内容将不能呈现出来。所须要的字体没有安装,也照样会编译对SHH和telnet的支持,可是在链接的时候会失败:
Aug 23 14:09:45 my-server guacd[5606]: Unable to get font "monospace"
若是SHH或telnet链接没有正常工做,你会在系统日志里看到这样的信息,安装字体,再次尝试链接。
一旦configure
命令执行完成,只须要键入”make”, guacamole-server就会开始编译:
$ make Making all in src/libguac make[1]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac' ... make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc' make[1]: Entering directory `/home/zhz/guacamole/guacamole-server' make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server' $
在编译全部的组建时,有大量的输出信息滚动屏幕。
当以上全部的都完成时,你只须要输入“make install
”来安装编译好的组建,而后输入“ldconfig
”来更新你系统安装库的缓存:
# make install Making install in src/libguac make[1]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac' make[2]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac' ... ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc' make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc' make[1]: Entering directory `/home/zhz/guacamole/guacamole-server' make[2]: Entering directory `/home/zhz/guacamole/guacamole-server' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/zhz/guacamole/guacamole-server' make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server' # ldconfig #
这时候,全部的都安装好了,但guacd并无运行起来。使用Guacamole 还须要把客户端组建也安装好再运行guacd。
注意在安装guacd和它的自启动脚本后,你可能仍然须要激活服务来运行自启动。自启动的方式因不一样发行版系统而不一样,可是每个发行版都会有它的文档描述如何设置自启动。
注意:通常而言,你不须要编译guacamole-client,由于它是用Java写的交互平台。你能很轻松的在Guacamole项目官网上获取最新版本的guacamole-client,包括全部的支持的扩展,不须要你本身编译。
若是你不想本身用源码编译guacamole-client,就直接从项目官网下载guacamole.war,以及任何所须要的扩展,就能够直接跳到“部署Guacamole”部分。
guacamole-client包含Guacamole的全部Java和JavaScript组建(guacamole、guacamole-common、guacamole-ext、guacamole-common-js)。这些组建最终组成web应用,为用户提供HTML5 Guacamole 客户端服务来链接服务端。该web应用会链接guacamole-server的一部分guacd,来表明用户链接任何远程桌面服务,使用户有权限访问它。
为了编译guacamole-client,你还须要安装Apache Maven和Java JDK。但不是全部人都须要,有的linux发行版已经为你安装可这些包。
你能够从Guacamole项目的官网上获取guacamole-client源码的一个副本。这些发行版是最新代码的稳定的快照,通过了Guacamole小组的测试,认为适合公众使用的版本。从项目网站上下载的.tar.gz格式压缩包,能够用过下列命令解压:
$ tar -xzf guacamole-client-0.9.9.tar.gz $ cd guacamole-client-0.9.9/ $
和guacamole-server同样,若是你想获得最新的代码,而且不关心它没有通过稳定发行版同样严格的测试,你也能够用Guacamole团队在Github上的仓库里克隆一份:
$ git clone git://github.com/glyptodon/guacamole-client.git Cloning into 'guacamole-client'... remote: Counting objects: 12788, done. remote: Compressing objects: 100% (4183/4183), done. remote: Total 12788 (delta 3942), reused 12667 (delta 3822) Receiving objects: 100% (12788/12788), 3.23 MiB | 799 KiB/s, done. Resolving deltas: 100% (3942/3942), done. $
不像guacamole-server的是,即便你从git仓库里获取了源码,你也不须要再编译的时候运行任何程序。在编译以前不须要运行任何脚本,在源码中提供了Maven须要的pom.xml文件。
编译guacamole-client,仅仅须要运行"mvn package
"。它会请求Maven自动编译和打包全部的组建,生成一个简单的.war文件,它包含了web整个应用。
$ mvn package [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] guacamole-common [INFO] guacamole-ext [INFO] guacamole-common-js [INFO] guacamole [INFO] guacamole-auth-jdbc [INFO] guacamole-auth-jdbc-base [INFO] guacamole-auth-jdbc-mysql [INFO] guacamole-auth-jdbc-postgresql [INFO] guacamole-auth-ldap [INFO] guacamole-auth-noauth [INFO] guacamole-client ... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] guacamole-common ................................... SUCCESS [ 7.566 s] [INFO] guacamole-ext ...................................... SUCCESS [ 5.594 s] [INFO] guacamole-common-js ................................ SUCCESS [ 1.249 s] [INFO] guacamole .......................................... SUCCESS [ 8.474 s] [INFO] guacamole-auth-jdbc ................................ SUCCESS [ 0.592 s] [INFO] guacamole-auth-jdbc-base ........................... SUCCESS [ 2.548 s] [INFO] guacamole-auth-jdbc-mysql .......................... SUCCESS [ 2.557 s] [INFO] guacamole-auth-jdbc-postgresql ..................... SUCCESS [ 1.990 s] [INFO] guacamole-auth-ldap ................................ SUCCESS [ 1.314 s] [INFO] guacamole-auth-noauth .............................. SUCCESS [ 0.961 s] [INFO] guacamole-client ................................... SUCCESS [ 1.721 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 34.701 s [INFO] Finished at: 2015-06-08T17:03:15-07:00 [INFO] Final Memory: 34M/340M [INFO] ------------------------------------------------------------------------ $
当Guacamole web应用编译完成,在当前目录(你运行mvn时的目录)的子目录guacamole/target/ 中就会生成一个.war文件,而后能够发布到一个servlet容器中,例如:Tomcat。
Guacamole的web应用部分,是被打包成一个彻底独立的 .war
文件。若是你从项目官网下载
Guacamole
,文件名为
guacamole.war
。部署这个文件到你的
servlet
容器使用
.war
的目录中。在
Tomcat
环境中,这个目录是
CATALINA_HOME
/webapps/。这个路径
CATALINA_HOME
会因你的
Tomcat
是如何装的而变化,但一般是相似于
/var/lib/tomcat
, /var/lib/tomcat7
:
# cp guacamole.war /var/lib/tomcat/webapps #
若是你是从源码编译的guacamole-client,所需的.war就在guacamole/target/目录中,而且它的名字会包含一个额外的版本后缀。如Tomcat会根据.war文件来肯定web应用程序的路径,你能够在复制的时候重命名这个文件为guacamole.war:
#cp guacamole/target/guacamole-0.9.9.war /var/lib/tomcat/webapps/guacamole.war #
另外,若是你用的不一样的servlet容器或者Tomcat安装在不一样的路径中,你就须要去查看servlet容器或系统发行版的文档,或者二者共同决定部署.war文件的路径,例如:guacamole.war。
一旦.war文件放在了正确的路径下,你就须要重启Tomcat来强制Tomcat部署新的web应用程序,而且若是guacd守护进程不是一直保持运行,也必须重启。在不一样的发行版中,重启Tomcat和guacd的命令也会不一样。典型的,你能经过运行相应的初始化脚原本重启:
# /etc/init.d/tomcat7 restart Stopping Tomcat... OK Starting Tomcat... OK # /etc/init.d/guacd start Starting guacd: SUCCESS guacd[6229]: INFO: Guacamole proxy daemon (guacd) version 0.9.9 started #
注意:若是你想要开机启动Guacamole,就须要配置Tomcat和guacd自启动。你的发行版会提供文档来作这个。
在重启Tomcat而且启动guacd以后,Guacamole就成功的安装好了,即便它没有彻底的运行。在目前的状态,它还彻底没有配置,下一步就是至少为添加一个用户,和一些链接。具体请看:Guacamole之配置Guacamole(五)《Chapter 5, Configuring Guacamole.》。
若是你的浏览器和servlet容器支持,Guacamole就会自动使用网络套接字。在Guacamole不能用网络套接字链接时,它会马上向用户透明的回退使用HTTP。
在Guacamole中网络套接字能被Tomcat7.0.37或更高的版本、Jetty8或更高版本支持,而且任何servlet容器都支持JSR 256,这是Java API对网络套接字的标准。