阿帕奇链接mysql_apache guacamole 使用mysql 连接

端木元青
2023-12-01

1.创建一个临时文件夹,用来存放mysql-java连接器

mkdir tempauth

2.下载相关文件

cd tempauth

wget https://jaist.dl.sourceforge.net/project/guacamole/current/extensions/guacamole-auth-jdbc-0.9.14.tar.gz

wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz

点击这里下载 要注意这个版本只适用于0.9.14的guacamole-server

3.安装/解压

tar -zxf mysql-connector-java-5.1.46.tar.gz

tar -zxf guacamole-auth-jdbc-0.9.14.tar.gz

4.将guacamole-auth复制到GUACAMOLE_HOME的extensions文件下,若无则创建.GUACAMOLE_HOME一般为/etc/guacamole/

cp /etc/guacamole/tmpauth/guacamole-auth-jdbc-0.9.14/mysql/guacamole-auth-jdbc-mysql-0.9.14.jar /etc/guacamole/extensions/

cp /etc/guacamole/tmpauth/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar /etc/guacamole/lib/

5.创建Guacamole数据库

$ mysql -u root -p

Enter password: password

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 233

Server version: 5.5.29-0ubuntu0.12.10.1 (Ubuntu)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE guacamole_db;

Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'some_password';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';

Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.02 sec)

mysql> quit

Bye

6.进入到/etc/guacamole/sqlauth/guacamole-auth-jdbc-0.9.14/mysql/schema下,执行sql脚本

root@ubuntu:/etc/guacamole/sqlauth/guacamole-auth-jdbc-0.9.14/mysql/schema# ls

001-create-schema.sql 002-create-admin-user.sql upgrade

root@ubuntu:/etc/guacamole/sqlauth/guacamole-auth-jdbc-0.9.14/mysql/schema# cat ./*.sql | mysql -u root -p guacamole_db

Enter password:

root@ubuntu:/etc/guacamole/sqlauth/guacamole-auth-jdbc-0.9.14/mysql/schema#

7.配置guacamole.properites相关信息

# MySQL properties

mysql-hostname: localhost

mysql-port: 3306

mysql-database: guacamole_db

mysql-username: guacamole_user

mysql-password: some_password

注意,如果没有配置数据库信息,使用user-mapping.xml 没有类似历史访问记录,sftp等功能

注意 guacamole-auth-jdbc 一定要和guancd 的版本号对应,否则会出现登陆失败的情况

可以按照下面的方法查看版本号:

root@ubuntu:/etc/guacamole# /etc/init.d/guacd restart

Stopping guacd: SUCCESS

Starting guacd: guacd[4497]: INFO: Guacamole proxy daemon (guacd) version 0.9.13-incubating started

SUCCESS

#

这里显示的版本号为 0.9.23-incubating 下载时一定要注意下载对应版本

日志记录在/var/log/tomcat8下面 注意为catalina.out文件,有问题及时查看方便解决

 类似资料: