Changes

From Amahi Wiki
Jump to: navigation, search
3,670 bytes added ,  05:31, 19 May 2013
=== Setting up MySQL Authentication ===
==== Making the Directory ====
As root, create the "classpath" directory
{{Code|
Code = mkdir /var/lib/guacamole/classpath
}}
 
==== Installing MySQL Authentication Module ====
Download the MySQL Authentication Module
http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-mysql-0.8.0.tar.gz/download
 
Move to the directory containing the download and unpack the download
 
{{Code|Code = # tar -xzf guacamole-auth-mysql-0.8.0.tar.gz}}
*Be aware that you may have to adjust the above code to match the file name you downloaded.
 
Copy all of the ".jar" files in the /lib of the downloaded file to the classpath directory you created.
{{Code|
Code = cp -r /whereever/you/downloaded/it/guacamole-auth-mysql-0.8.0/lib/*.jar /var/lib/guacamole/classpath
}}
 
You need one more ".jar" file that is not included (MySQL Connector-J). You can get it here: http://dev.mysql.com/downloads/connector/j/
 
Move to the directory containing the download and unpack the download
 
{{Code|Code = # tar -xzf mysql-connector-java-5.1.25.tar.gz}}
*Be aware that you may have to adjust the above code to match the file name you downloaded.
 
 
Copy mysql-connector-java-5.1.23-bin.jar to the classpath directory you created.
{{Code|
Code = cp -r /whereever/you/downloaded/it/mysql-connector-java-5.1.25/mysql-connector-java-5.1.23-bin.jar /var/lib/guacamole/classpath
}}
 
==== Making the MySQL Tables ====
Now we need to create a MySQL Table that Guacamole can use
{{Code|
Code = $ mysql -u root -p
Enter password: default for Amahi is hda
mysql> CREATE DATABASE guacamole;
Query OK, 1 row affected (0.00 sec)
 
mysql> CREATE USER 'guacamole'@'localhost' IDENTIFIED BY 'some_password';
Query OK, 0 rows affected (0.00 sec)
 
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole.* TO 'guacamole'@'localhost';
Query OK, 0 rows affected (0.00 sec)
 
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
 
mysql> quit
Bye
}}
The database and user can be named whatever you like, but these instructions will refer to both as "guacamole". Naturally, you should choose a real password for your user rather than the string "some_password" shown above.
 
==== Running the SQL scripts ====
 
The SQL scripts that create the database schema and default administrator user are included in the guacamole-auth-mysql-0.8.0 archive you downloaded within the schema/ directory. Change directories to the guacamole-auth-mysql-0.8.0 archive.
{{Code|
Code = cd /whereever/you/downloaded/it/guacamole-auth-mysql-0.8.0/schema
}}
 
The scripts are named such that they can be run in order with one command:
{{Code|
Code = $ cat schema/*.sql | mysql -u root -p guacamole
Enter password: default for Amahi is hda
$
}}
 
==== Configuring Guacamole to Use MySQL Authentication ====
You will need to edit /etc/guacamole/guacamole.properties
 
Start at the line "# Hostname and port of guacamole proxy" and replace everything below it with this:
 
guacd-hostname: localhost
guacd-port: 4822
# Auth provider class (authenticates user/pass combination, needed if using the provided login screen)
auth-provider: net.sourceforge.guacamole.net.auth.mysql.MySQLAuthenticationProvider
basic-user-mapping: /etc/guacamole/user-mapping.xml
# Location to read extra .jar's from
lib-directory: /var/lib/guacamole/classpath
# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole
mysql-username: guacamole
mysql-password: some_password
 
Use the real password you chose when creating the MySQL database for the Guacamole database in place of the string "some_password" as shown above.
 
Restart Tomcat service
{{Code|Code = service tomcat6 restart}}
 
The default user is "guacadmin", with the default password of "guacadmin". You can change your password by editing your own user in the administration screen.
=== Deploying Guacamole ===
128

edits