6

最近,我在http://guac-dev.org/的手册中按照 Guacamole 的安装说明进行操作。我的系统是 Ubuntu 14.04。

首先,我安装了基本的必需依赖项:

$ apt-get install -y apache2 libcairo2-dev libjpeg62-dev libpng12-dev libossp-uuid-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libpulse-dev libssl-dev libvorbis-dev maven tomcat7
$ apt-get install -y libvncserver-dev

然后,我按照手册中的说明下载guacamole-server-0.9.8.tar.gz并安装了它们:guacamole-0.9.8.war

$ tar xf guacamole-server-0.9.8.tar.gz
$ cd guacamole-server-0.9.8
$ ./configure
$ make
$ make install
$ cp guacamole-0.9.8.war /var/lib/tomcat7/webapps/guacamole.war
$ mkdir /etc/guacamole

我创建了/etc/guacamole/guacamole.properties,包含以下内容:

guacd-hostname: localhost # although the guide says it should be guacd-host, but the example shown in http://guac-dev.org/doc/gug/configuring-guacamole.html is guacd-hostname
guacd-port: 4822
user-mapping: /etc/guacamole/user-mapping.xml

/etc/guacamole/user-mapping.xml包含以下内容:

<user-mapping>
    <authorize username="USERNAME" password="PASSWORD">
        <protocol>vnc</protocol>
        <param name="hostname">localhost</param>
        <param name="port">5901</param>
        <param name="password">123456</param>
    </authorize>
    <authorize username="wangx" password="wangxiang">
        <protocol>vnc</protocol>
        <param name="hostname">192.168.1.111</param>
        <param name="port">5901</param>
        <param name="password">123456</param>
    </authorize>
</user-mapping>

然后我重新启动了tomcat7和guacd:

$ /etc/init.d/tomcat7 restart
$ /etc/init.d/guacd restart

GUACAMOLE_HOME环境变量为空:

$ echo $GUACAMOLE_HOME

中也没有.guacamole目录。当我访问时,我输入了用户名“wangx”和密码“wangxiang”,它显示无效登录。/home/<user>/var/lib/tomcat7/webapps/guacamolehttp://localhost:8080/guacamole

我该如何解决这个问题?我应该在哪里找到guacamole.propertiesanduser-mapping.xml文件?我做错什么了吗?

感谢您的关注。

4

1 回答 1

12

根据手册中的说明:

...
$ mkdir /etc/guacamole

鳄梨酱不会自动从/etc/guacamole. 它将从 读取GUACAMOLE_HOME,但这不是环境变量- 它是 Guacamole 配置目录的占位符,可以通过同名的环境变量确定,但还有其他可能的位置。根据GUACAMOLE_HOME鳄梨酱手册中的描述

GUACAMOLE_HOME

Guacamole 默认从自己的配置目录中读取文件,只有在找不到该目录时才使用类路径。当定位到这个目录时,Guacamole 会按顺序尝试:

  1. 系统属性中指定的目录guacamole.home
  2. 环境变量中指定的目录GUACAMOLE_HOME
  3. 目录.guacamole,位于运行 servlet 容器的用户的主目录中。

该目录将GUACAMOLE_HOME在文档中的其他地方引用。

鳄梨酱GUACAMOLE_HOME用作配置文件(如guacamole.properties. ...

您的guacamole.propertiesuser-mapping.xml看起来不错,但鳄梨酱将无法找到这些文件,除非它们位于GUACAMOLE_HOME. 解决这个问题的一个非常简单的方法是.guacamole在 Tomcat 用户的主目录中符号链接到/etc/guacamole. 对于 Ubuntu 上的“tomcat7”包,Tomcat 用户的主目录是/usr/share/tomcat7

$ ln -s /etc/guacamole/ /usr/share/tomcat7/.guacamole

或者,您可以创建.guacamole目录,然后创建一个符号链接guacamole.properties。由于 your 的位置已在 youruser-mapping.xml中明确指定guacamole.properties,因此您无需将其放置在GUACAMOLE_HOME

$ mkdir /usr/share/tomcat7/.guacamole
$ ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat7/.guacamole/

进行这些更改后,请务必重新启动 Tomcat,一切都应该开始工作了。

于 2015-11-04T00:47:31.260 回答