centos7.3配置guacamole 1 安装guacamole所需要的依赖库 2 安装配置tomcat,架设服务 3 配置guacamole 4 重启tomcat,并启动guacd服务 参考资料

必需安装的库有

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的登陆认证

登陆成功

参考资料

http://www.jianshu.com/p/aa63006b2edb