1 安裝guacamole所需要的依賴庫
必需安裝的庫有
yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
可選擇安裝的庫
yum install -y freerdp-devel pango-devel libssh2-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel
2 安裝配置tomcat,架設服務
2.1 下載tomcat
yum -y install tomcat
2.2 配置環境變量,使tomcat可以找到guacamole客戶端配置
vim /etc/tomcat/tomcat.conf
加入下面一句
GUACAMOLE_HOME=/etc/guacamole
其中GUACAMOLE_HOME文件夾在后面創建。
注意:
2.3 安裝guacamole
2.3.1 編譯安裝guacamole-server
1.下載服務端壓縮包
http://guacamole.incubator.apache.org/releases/0.9.13-incubating/ 地址中下載guacamole-server-0.9.13-incubating.tar.gz
使用wget命令或者本地下載后使用ftp工具上傳到服務器
2.解壓
tar -xzf guacamole-server-0.9.13-incubating.tar.gz
3.編譯安裝
cd guacamole-server-0.9.13-incubating/
sudo ./configure --with-init-dir=/etc/init.d
make
make install
ldconfig
2.3.2 安裝guacamole-client
1.下載客戶端包
http://guacamole.incubator.apache.org/releases/0.9.13-incubating/ 地址中下載guacamole-0.9.13-incubating.war
使用wget命令或者本地下載后使用ftp工具上傳到服務器
2.將客戶端包部署到Tomcat
cp guacamole-0.9.13.war /var/lib/tomcat/webapps/guacamole.war
3 配置guacamole
創建配置文件夾
mkdir -p /etc/guacamole/
配置用戶映射文件
vim /etc/guacamole/guacamole.properties
將文件內容改為下面的 basic-user-mapping: /etc/guacamole/user-mapping.xml
編寫用戶映射配置文件
vim /etc/guacamole/user-mapping.xml
在配置文件內,按下面的格式輸入信息:
<user-mapping>
<authorize
username="admin"
password="123456">
<!-- First authorized connection -->
<connection name="ssh">
<protocol>ssh</protocol>
<param name="hostname">123.206.xx.xx</param>
<param name="port">22</param>
</connection>
<!-- Second authorized connection -->
<connection name="otherhost">
<protocol>vnc</protocol>
<param name="hostname">otherhost</param>
<param name="port">5900</param>
<param name="password">VNCPASS</param>
</connection>
</authorize>
</user-mapping>
以上只是極簡配置,該文件更改后即時生效,具體參數配置文檔: http://guacamole.incubator.apache.org/doc/gug/configuring-guacamole.html
4 重啟tomcat,並啟動guacd服務
service tomcat start
/etc/init.d/guacd start
在瀏覽器地址欄輸入 http://xxx.xxx.xxx.xxx:8080/guacamole/ ,可以看到登入界面(第一次加載比較慢)
使用admin和密碼123456登陸
點擊ssh進入服務器123.206.xx.xx的登陸認證
登陸成功