華為云計算 云知識 Guacamole是什么
Guacamole是什么

簡介

Guacamole是一個提供了基于HTML5 Web應用程序的遠程桌面代理服務器。通過使用Guacamole服務器,可以很輕松地在瀏覽器上遠程訪問Guacamole代理的主機。

編譯和測試方式

1.配置編譯環(huán)境

1)安裝wget工具。

yum install wget -y

2)安裝依賴包。

yum -y install cairo-devel libjpeg-devel libpng-devel uuid-devel

yum -y install ffmpeg-devel freerdp-devel pango-devel libssh2-devel

yum -y install libtelnet-devel libvncserver-devel pulseaudio-libs-devel

yum -y install openssl-devel libvorbis-devel libwebp-devel

yum -y install freerdp-plugins

3)安裝Open JDK。

yum install java-1.8.0-openjdk

4)安裝Tomcat。

Tomcat安裝請參照鯤鵬社區(qū)的Tomcat使用教程:http://m.cqfng.cn/kunpeng/software/tomcat.html

----結束

2.獲取源碼

1)下載服務端軟件包。

wget https://mirrors.tuna.tsinghua.edu.cn/apache/guacamole/1.0.0/source/guacamole-server-1.0.0.tar.gz

2)獲取客戶端代碼:

wget http://mirror.bit.edu.cn/apache/guacamole/1.0.0/binary/guacamole-1.0.0.war

3)將服務端軟件包和客戶端代碼復制至 云服務器 的“/usr/local/src”目錄。

----結束

3.編譯和安裝

1)解壓軟件包。

tar -zxvf guacamole-server-1.0.0.tar.gz

2)進入“guacamole-server-1.0.0”安裝目錄。

cd guacamole-server-1.0.0

3)生成makefile文件。

./configure --with--dir=/etc/init.d

4)編譯guacamole-server源碼。

make -j4

make install

4.運行和驗證

1)把guacamole客戶端代碼包“guacamole-1.0.0.war”移動到tomcat的“webapps”目錄下。

mv guacamole-1.0.0.war /usr/local/tomcat/webapps

2)創(chuàng)建guacamole的配置目錄。

mkdir /etc/guacamole

3)創(chuàng)建“guacamole.properties”和“user-mapping.xml”文件。

cd /etc/guacamole

vim guacamole.properties

“guacamole.properties”內(nèi)容如下:

guacd-hostname: localhost

guacd-port:4822

user-mapping:/etc/guacamole/user-mapping.xml

vim user-mapping.xml

“user-mapping.xml”內(nèi)容如下:

<user-mapping>

        <authorize username="admin" password="[mypassword]">

            <connection name="mycentos">

                <protocol>ssh</protocol>

                <param name="hostname">localhost</param>

                <param name="port">22</param>

                <param name="username">root</param>

                <param name="password">[password]</param>

            </connection>

        </authorize>

</user-mapping>

其中“[mypassword]”為Guacamole的訪問密碼,“[password]”為節(jié)點的SSH登錄密碼,請結合實際填寫。

4)執(zhí)行以下命令, 配置“GUACAMOLE_HOME”環(huán)境變量。

echo "export GUACAMOLE_HOME=/etc/guacamole" >> /etc/profile

source /etc/profile

5)重啟Tomcat。

sh /usr/local/tomcat/bin/shutdown.sh

sh /usr/local/tomcat/bin/startup.sh

6)啟動guacamole-server。

service guacd start

7)瀏覽器訪問如下網(wǎng)址。

http://[ECS IP]:8080/guacamole-1.0.0

界面顯示如圖6-1所示。

賬號密碼為“user-mapping.xml”中與“authorize”同一行的“username”和“password”的值。

GUACAMOLE界面