摘要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對網絡套接字的標準。