1.在测试环境中安装软件。
setenforce 0
systemctl stop firewalld
2.添加依赖库
yum install -y cairo-devel libjpeg-devel libpng-devel uuid-devel ffmpeg-devel freerdp-devel freerdp-plugins pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel
3.guacamole-server必须编译之后,才能安装
wget http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/source/guacamole-server-1.0.0.tar.gz
tar -zxvf guacamole-server-1.0.0.tar.gz
cd guacamole-server-1.0.0
./configure --with-init-dir=/etc/init.d
make && make install
ldconfig
4.配置环境变量
export GUACAMOLE_HOME=/etc/guacamole
5.配置guacamole
mkdir -p /etc/guacamole/
mkdir -p /etc/guacamole/extensions
mkdir -p /etc/guacamole/lib
vi /etc/guacamole/guacamole.properties
guacamole.properties的内容如下所示:
guacd-hostname: localhost
guacd-port: 4822
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole
mysql-password: guacamole
将guacamole-auth-jdbc-mysql-1.0.0.jar放置在/etc/guacamole/extensions中
和mysql-connector-java-5.1.46-bin.jar放置在/etc/guacamole/lib中
7.在mysql中创建数据库
mysql -u root -p
CREATE DATABASE guacamole_db;
CREATE USER 'guacamole'@'localhost' IDENTIFIED BY 'guacamole';
CREATE USER 'guacamole'@'127.0.0.1' IDENTIFIED BY 'guacamole';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole'@'localhost';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole'@'127.0.0.1';
FLUSH PRIVILEGES;
quit
cat /root/guacamole-auth-jdbc-1.0.0/mysql/schema/*.sql | mysql -u root -p guacamole_db
8.安装、启动tomcat,下载guacamole.war并将其发布在tomcat中
yum install -y tomcat
systemctl start tomcat
ln -s /etc/guacamole/guacamole.properties /var/lib/tomcat/.guacamole/
wget http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/binary/guacamole-1.0.0.war
cp guacamole-1.0.0.war /var/lib/webapps/guacamole.war
9.重启tomcat,用默认账号“guacadmin”和“guacadmin”访问“http://IP:8080/guacamole”。
在此说明两点:
第一,Guacamole需要配置数据库认证,否则无法使用全部的功能。
第二,之前遇到一个错误,在登录时,遇到“Unexpected Internal Error”,未找到原因,可能是没有正确设置环境变量。