日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

guacamole 源码_部署Guacamole跳板机平台

發(fā)布時間:2023/12/20 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 guacamole 源码_部署Guacamole跳板机平台 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

部署Guacamole跳板機平臺

Apache Guacamole是一個可以通過瀏覽器訪問遠程桌面的應(yīng)用,它無需在訪問者界面部署任何軟件(clientless),且支持主流的VNC,RDP,SSH等協(xié)議。本文主要介紹如何通過華為云stack部署一個Guacamole平臺,支持云外的用戶進行遠程訪問。

部署和架構(gòu)

Guacamole不是一個完全獨立的(self-contained)網(wǎng)絡(luò)應(yīng)用,它由一個簡單輕量的網(wǎng)絡(luò)應(yīng)用搭配主要的底層組件構(gòu)成的。

當用戶通過瀏覽器連接一個Guacamole服務(wù)器時,Guacamole client組件通過內(nèi)置于Guacamole 服務(wù)器的webserver提供給用戶(servered to users by a webserver within the Guacamole server)。繼而這個client使用Guacamole協(xié)議通過HTTP連接回Guacamole服務(wù)器。

部署著Guacamole server的網(wǎng)絡(luò)應(yīng)用(e.g. apache nginx)讀取Guacamole 協(xié)議并轉(zhuǎn)發(fā)給Guacamole原生代理guacd。 這個代理解析請求并代表用戶訪問遠程桌面服務(wù)。

Guacamole協(xié)議結(jié)合guacd服務(wù)共同保證了:無論是Guacamole client還是網(wǎng)絡(luò)應(yīng)用都無需感知遠程桌面的傳輸協(xié)議。

Guacamole協(xié)議

網(wǎng)絡(luò)應(yīng)用并不明白任何的遠程桌面協(xié)議,它只需要理解Guacmole協(xié)議。這個協(xié)議支持遠程顯示的渲染和事件的傳輸工作。

作為一個遠程展示和交互的協(xié)議,Guacmole整合了當前很多的遠程桌面協(xié)議。向Guacmole添加一個遠程桌面協(xié)議可以理解為在遠程桌面協(xié)議(如RDP)和Guacmole協(xié)議直接寫入一個中介傳輸層。操作這個中間層和直接操作本地服務(wù)并無太大區(qū)別。

這個中介層就是guacd

guacd

guacd是Guacamole的核心,它動態(tài)的載入對遠程桌面協(xié)議的支持,并且接受網(wǎng)絡(luò)應(yīng)用的指示連接遠程桌面。

guacd是一個守護進程,它與Guacmole一起安裝并在后臺運行并監(jiān)聽網(wǎng)絡(luò)應(yīng)用的TCP連接請求。guacd同樣不理解具體的遠程桌面協(xié)議,但是它通過Guacamole協(xié)議知道需要調(diào)用并且加載相應(yīng)的協(xié)議插件,當客戶端插件(client plugin)被加載,它就可以獨立于guacd運行并擁有全部的控制權(quán)限直到被關(guān)閉。

guacd以及所有的客戶端插件都依賴于一個公共包libguac,它使得通過Guacamole協(xié)議的交流更加的普適化(abstract)。

網(wǎng)絡(luò)應(yīng)用

在Guacamole中,用戶直接進行交互的部分是網(wǎng)絡(luò)應(yīng)用。它依賴于guacd且僅僅提供認證和網(wǎng)絡(luò)轉(zhuǎn)發(fā)等。

安裝Guacamole

Guacamole主要分為2個部分:

guacamole-server提供guacd代理以及相關(guān)的依賴。

guacamole-client提供servlent容器(通常為Tomcat)需要的client。

安裝guacamole-server

guacamole-server包含所有Guacamole所需的原生的,服務(wù)器端的組件。libguac是其中一個公共的C包,它包含了所有基礎(chǔ)組件的依賴。

安裝guacd會創(chuàng)建一個guacd的守護進程,一般推薦設(shè)置為開機自動啟動。

在安裝之前確保預裝了C編譯器(e.g. gcc)。

這里我們以CentOS7.6來安裝部署一個Guacmole服務(wù)。

安裝依賴

a. 必選依賴

依賴包名稱

說明

Cairo是用語圖形化渲染的

libguac依賴它來寫PNG圖片

安裝過程中創(chuàng)建編譯包

yum?install?-y?cairo-devel?libjpeg-turbo-devel?libpng-devel?libtool??uuid-devel

b. 可選依賴

主要是遠程桌面協(xié)議的一些依賴包

Library name

Features

操作錄屏等功能依賴這個包,如果不需要可以跳過

支持RDP連接,一般這個必選

支持文字布局的包,SSH, telnet,kubernetes必選

支持SSH連接

支持telnet連接

支持kubernetes必選

VNC的語音支持,對于云上服務(wù)器非必要

ssh,kubernetes必選,加密guacd的通信,支撐ssh的密鑰管理

支持WebP,處理圖像的擴展

yum install -y ffmpeg-devel freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel libwebsockets-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel

# 有些linux版本可能沒有相應(yīng)的包,可以選擇跳過

下載源代碼

安裝Guacamole-server

從下載1.1.0或以上版本。解壓

$ tar -xzf guacamole-server-1.2.0.tar.gz

$ cd guacamole-server-1.2.0/

$./configure --with-init-dir=/etc/init.d

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

...

------------------------------------------------

guacamole-server version 1.2.0

------------------------------------------------

Library status:

freerdp2 ............ yes

pango ............... yes

libavcodec .......... yes

libavformat ......... yes

libavutil ........... yes

libssh2 ............. yes

libssl .............. yes

libswscale .......... yes

libtelnet ........... yes

libVNCServer ........ yes

libvorbis ........... yes

libpulse ............ yes

libwebsockets ....... yes

libwebp ............. yes

wsock32 ............. no

Protocol support:

Kubernetes .... yes

RDP ........... yes

SSH ........... yes

Telnet ........ yes

VNC ........... yes

Services / tools:

guacd ...... yes

guacenc .... yes

guaclog .... yes

Init scripts: /etc/init.d

Systemd units: no

Type "make" to compile guacamole-server.

$ make ?# 使用make進行編譯

Making all in src/libguac

make[1]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac'

...

make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc'

make[1]: Entering directory `/home/zhz/guacamole/guacamole-server'

make[1]: Nothing to be done for `all-am'.

make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server'

$ make install ? # 安裝

Making install in src/libguac

make[1]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac'

make[2]: Entering directory `/home/zhz/guacamole/guacamole-server/src/libguac'

...

----------------------------------------------------------------------

Libraries have been installed in:

/usr/local/lib

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH' environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH' environment variable

during linking

- use the `-Wl,-rpath -Wl,LIBDIR' linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

make[2]: Nothing to be done for `install-data-am'.

make[2]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc'

make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server/src/protocols/vnc'

make[1]: Entering directory `/home/zhz/guacamole/guacamole-server'

make[2]: Entering directory `/home/zhz/guacamole/guacamole-server'

make[2]: Nothing to be done for `install-exec-am'.

make[2]: Nothing to be done for `install-data-am'.

make[2]: Leaving directory `/home/zhz/guacamole/guacamole-server'

make[1]: Leaving directory `/home/zhz/guacamole/guacamole-server'

$ ldconfig # 更新系統(tǒng)緩存

到此安裝結(jié)束,但是guacd還沒有運行,我們需要在Guacamole client安裝后運行g(shù)uacd。

部署Guacamole

直接從下載guacamole.war包,將war包拷貝到/var/lib/tomcat/webapps, 并重啟guacd和tomcat服務(wù)。

# cp guacamole/target/guacamole-1.2.0.war /var/lib/tomcat/webapps/guacamole.war

#

# /etc/init.d/tomcat7 restart

Stopping Tomcat... OK

Starting Tomcat... OK

# /etc/init.d/guacd start

Starting guacd: SUCCESS

guacd[6229]: INFO: ?Guacamole proxy daemon (guacd) version 1.2.0 started

Guacamole配置

Guacamole服務(wù)的位置(GUACAMOLE_HOME)一般在/etc/guacamole下,這里包含了所有的配置文件和擴展包。

guacamole.properties

主要的Guacamole服務(wù)的配置文件,有關(guān)Guacamole服務(wù)認證、連接等的配置都在這個文件定義。

logback.xml

日志配置,可以選擇日志等級。

extensions/

放置Guacamole擴展.jar包的位置

lib/

有些Guacamole擴展.jar包的依賴包的放置位置

數(shù)據(jù)庫認證的配置

首先要在系統(tǒng)預裝數(shù)據(jù)庫,Guacamole支持MariaDB,MySQL,PostgreSQL,SQL Server這里以mysql來舉例。

同樣的到下載guacamole-auth-jdbc-1.2.0.tar.gz包。其中g(shù)uacamole-auth-jdbc-mysql-1.2.0.jar需要放在extensions/下。訪問MySQL官網(wǎng)下載JDBC driver(mysql-connector-java-5.1.47-bin.jar)并放入lib下。

創(chuàng)建Guacamole數(shù)據(jù)庫

首先在mysql中創(chuàng)建數(shù)據(jù)庫

$ mysql -u root -p

Enter password:

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

Your MySQL connection id is 11

Server version: 5.7.20

Copyright (c) 2000, 2017, 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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_root_password';

Query OK, 0 rows affected (0.00 sec)

mysql> CREATE DATABASE guacamole_db;

Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'guacamole_user_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.00 sec)

mysql> quit

Bye

# 使用初始化腳本為數(shù)據(jù)庫創(chuàng)建數(shù)據(jù)表

$ ls schema/

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

$ cat schema/*.sql | mysql -u root -p guacamole_db

Enter password: new_root_password

接下來配置數(shù)據(jù)庫認證文件

vim guacamole.properties

# 貼入下面幾行

# MySQL properties

mysql-hostname: localhost

mysql-port: 3306

mysql-database: guacamole_db

mysql-username: guacamole_user

mysql-password: some_password

到此安裝配置結(jié)束,之后就可以通過guacamole平臺進行管理了,默認用戶密碼為guacadmin/guacadmin.

總結(jié)

以上是生活随笔為你收集整理的guacamole 源码_部署Guacamole跳板机平台的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。