in guacamole Linux ~ read.

guacamole安装与部署

1.首先需要安装guacamole所需要的依赖库

  必需安装的库有: Cairolibjpeg-turbolibpngOSSP UUID

    若在Debian / Ubuntu系统下执行命令:

sudo apt-get -y --force-yes install libcairo2-dev libjpeg62-dev libpng12-dev libossp-uuid-dev libossp-uuid16  
wget http://iweb.dl.sourceforge.net/project/libjpeg-turbo/1.4.2/libjpeg-turbo-official_1.4.2_amd64.deb  
sudo dpkg -i libjpeg-turbo-official_1.4.2_amd64.deb  

    若在Fedora / CentOS / RHEL系统中执行以下命令:

sudo yun -y --force-yes install cairo-devel libjpeg-turbo-devel libjpeg-devel libpng-devel uuid-devel  

  可选择安装的库有: FreeRDPPangolibssh2libtelnetlibVNCServerPulseAudioOpenSSLlibvorbis

    若在Debian / Ubuntu系统下执行命令:

sudo apt-get -y --force-yes install libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev  

    若在Fedora / CentOS / RHEL系统中执行以下命令:

sudo yun -y --force-yes install freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel  

2.安装Maven

 (1).安装JAVA

sudo apt-get install default-jre  
sudo apt-get install default-jdk  

 (2).下载Maven

mkdir /data  
wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz  
tar -xzf apache-maven-3.3.9-bin.tar.gz  

 (3).环境的配置

vi .bashrc

  在文件末尾添加

# set maven environment
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64  
export JRE_HOME=$JAVA_HOME/jre  
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH  
export M2_HOME=/data/apache-maven-3.3.9  
export PATH=$M2_HOME/bin:$PATH  

  验证环境是否配置好

cd  
source .bashrc  
mvn --version  

  若显示如下,则环境配置成功

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)  
Maven home: /data/apache-maven-3.3.9  
Java version: 1.7.0_85, vendor: Oracle Corporation  
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre  
Default locale: en_US, platform encoding: ANSI_X3.4-1968  
OS name: "linux", version: "3.13.0-68-generic", arch: "amd64", family: "unix"  

3.安装guacamole

 请到官网下载最新稳定版本http://guac-dev.org/releases ,这里我以暂时最新的0.9.8为例。

  首先是安装guacamole-server

cd  
wget http://ncu.dl.sourceforge.net/project/guacamole/current/source/guacamole-server-0.9.8.tar.gz  
tar -zxvf guacamole-server-0.9.8.tar.gz  
cd guacamole-server-0.9.8/  
./configure --with-init-dir=/etc/init.d
make  
make install  
ldconfig  

  接下来是guacamole-client

 (1).源码安装

cd  
wget http://jaist.dl.sourceforge.net/project/guacamole/current/source/guacamole-client-0.9.8.tar.gz  
tar -zxvf guacamole-client-0.9.8.tar.gz  
cd guacamole-client-0.9.8/  
mvn package #注意GWF  
cp guacamole/target/guacamole-0.9.8.war /var/lib/tomcat8/webapps/guacamole.war # Debian / Ubuntu系统中  
(或:cp guacamole/target/guacamole-0.9.8.war /usr/share/tomcat8/webapps/guacamole.war #Fedora / CentOS / RHEL系统中)

 (2).直接使用编译包

cd  
wget http://jaist.dl.sourceforge.net/project/guacamole/current/binary/guacamole-0.9.8.war  
cp guacamole-0.9.8.war /var/lib/tomcat8/webapps # Debian / Ubuntu系统中  
(或:cp guacamole-0.9.8.war /usr/share/tomcat8/webapps #Fedora / CentOS / RHEL系统中)

4.安装tomcat和mysql,并配置数据库

 首先安装:

   若在Debian / Ubuntu系统下执行命令:

sudo apt-get -y install mysql-server mysql-client mysql-common mysql-utilities tomcat8  
echo "" >> /etc/default/tomcat8  
echo "# GUACAMOLE EVN VARIABLE" >> /etc/default/tomcat8  
echo "GUACAMOLE_HOME=/etc/guacamole" >> /etc/default/tomcat8  
wget http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.8.tar.gz  
wget http://dev.mysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.36.tar.gz  
tar -xzf guacamole-auth-jdbc-0.9.8.tar.gz  
tar -xzf mysql-connector-java-5.1.36.tar.gz  
cp mysql-connector-java-5.1.36/mysql-connector-java-5.1.36-bin.jar /etc/guacamole/lib/  
cp guacamole-auth-jdbc-0.9.8/mysql/guacamole-auth-jdbc-mysql-0.9.8.jar /etc/guacamole/extensions/  

   若在Fedora / CentOS / RHEL系统中执行以下命令:

yum -y install mariadb mariadb-server  
mkdir -p ~/guacamole/sqlauth && cd ~/guacamole/sqlauth  
wget http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.8.tar.gz  
tar -zxf guacamole-auth-jdbc-0.9.8.tar.gz  
wget http://dev.mysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.32.tar.gz  
tar -zxf mysql-connector-java-5.1.32.tar.gz  
mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}  
mv guacamole-auth-jdbc-0.9.8/mysql/guacamole-auth-jdbc-mysql-0.9.8.jar /usr/share/tomcat/.guacamole/extensions/  
mv mysql-connector-java-5.1.32/mysql-connector-java-5.1.32-bin.jar /usr/share/tomcat/.guacamole/lib/  
systemctl restart mariadb.service  

 配置

mysql -u root -p   # Enter above password  
create database guacamole_db;  
create user 'guacamole_user'@'localhost' identified by 'PASSWORD';  
grant select,insert,update,delete on guacdb.* to 'guacamole_user'@'localhost';  
flush privileges;  
quit  
cat guacamole-auth-jdbc-0.9.8/mysql/schema/*.sql  

5.配置guacamole

mkdir -p /etc/guacamole/ && vim /etc/guacamole/guacamole.properties  

  将文件内容改为下面的

# MySQL properties
mysql-hostname: localhost  
mysql-port: 3306  
mysql-database: guacamole_db  
mysql-username: guacamole_user  
mysql-password: PASSWORD

# Additional settings
mysql-disallow-duplicate-connections: false  

6.链接属性文件

ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat8/.guacamole/  

7.重启tomcat,并启动guacd服务

/etc/init.d/tomcat8 restart
/etc/init.d/guacd start

好了,接下来就可以在浏览器中输入http://localhost:8080 直接访问了。


有两个推荐的帖子:

  ubuntu: http://chasewright.com/guacamole-with-mysql-on-ubuntu/

  centos: https://deviantengineer.com/2015/02/guacamole-centos7/

comments powered by Disqus