前言
一段时间前,腾讯云推出的轻量应用服务器的活动,性价比较高,我身边就有很多大佬购买了腾讯云轻量应用服务器,今天,博主继续给大家带来腾讯云轻量应用服务器的玩法,很多时候大家连接国外的服务器,会因为线路的原因,感觉到卡顿的出现,特别是线路不好的小鸡(,很多大佬都选择U家的GS,或者嘿呀终端,那么,我们自己也可以自建一个类似嘿呀终端的服务!
准备工作
一台腾讯云轻量应用服务器(HK
最佳
腾讯云轻量应用服务器最近的几天都有活动大家可以关注一下,前面的文章有详细论述,本文就不赘述了,我们这次的重点依然是玩法!
腾讯云轻量应用服务器购买地址:/XqKjWCYA
Guacamole 简介
Guacamole
是一个提供了基于HTML5
Web
应用程序的远程桌面代理服务器。通过使用Guacamole
服务器,可以很轻松地在浏览器上远程访问Guacamole
代理的主机。
Guacamole 官网
/
界面演示
注意
本文软件基于腾讯云轻量应用服务器安装,使用,教程使用的腾讯云轻量应用服务器系统为CentOS7.6
!理论上腾讯云轻量应用服务器为CentOS7.6
的服务器操作应与本文一致(包括过程与报错,其他服务器应与本文大同小异!
1. 环境准备
1. 安装依赖包
yum -y install cairo-devel libjpeg-devel libpng-devel uuid-develyum -y install ffmpeg-devel freerdp-devel pango-devel libssh2-develyum -y install libtelnet-devel libvncserver-devel pulseaudio-libs-develyum -y install openssl-devel libvorbis-devel libwebp-devel
到这里,我们就已经安装好依赖了!
2. 安装 JDK
yum install java-1.8.0-openjdk -y
到这里,我们就已经安装好 JDK 了!
3. 安装 Tomcat
下载 Tomcat 软件包至 /usr/local/src 目录
wget /tomcat/tomcat-10/v10.0.2/bin/apache-tomcat-10.0.2.tar.gz -P /usr/local/src
进入 Tomcat 软件包目录 解压 Tomcat 软件包
cd /usr/local/srctar -xvf apache-tomcat-10.0.2.tar.gz
运行 Tomcat
sh /usr/local/src/apache-tomcat-10.0.2/bin/startup.sh
到这里,我们就已经安装和运行好 Tomcat 了!
4. 安装 MYSQL
下载 MySQL 的 repo 源并安装
wget /mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpm
安装 MariaDB/MYSQL
yum install mysql-server
启动 MariaDB/MYSQL
service mysqld.service start
初始化 MariaDB/MYSQL
mysql_secure_installation
设置过程:
Enter current password for root (enter for none):回车Set root password? [Y/n] YNew password: 设置你的 MariaDB/MYSQL 数据库root密码Re-enter new password: 重复输入一次密码Remove anonymous users? [Y/n] YDisallow root login remotely? [Y/n] YRemove test database and access to it? [Y/n] YReload privilege tables now? [Y/n] Y
到这里,我们就已经安装好 MariaDB/MYSQL 了!
5. 安装 MYSQL 扩展
mkdir /usr/local/src/guacamolemysqlauth;mkdir /etc/guacamole;mkdir /etc/guacamole/extensions;mkdir /etc/guacamole/libcd /usr/local/src/guacamolemysqlauthwget https://mirrors.tuna./apache/guacamole/1.3.0/binary/guacamole-auth-jdbc-1.3.0.tar.gzwget /Downloads/Connector-J/mysql-connector-java-8.0.23.tar.gztar -xzvf guacamole-auth-jdbc-1.3.0.tar.gztar -xzvf mysql-connector-java-8.0.23.tar.gzcp /usr/local/src/guacamolemysqlauth/guacamole-auth-jdbc-1.3.0/mysql/guacamole-auth-jdbc-mysql-1.3.0.jar /etc/guacamole/extensionscp /usr/local/src/guacamolemysqlauth/mysql-connector-java-8.0.23/mysql-connector-java-8.0.23.jar /etc/guacamole/lib
到这里,我们就已经安装好 MYSQL 扩展了!
2. 安装 Guacamole
1. 下载 Guacamole 服务端软件包和客户端代码至 /usr/local/src 目录
wget https://mirrors.tuna./apache/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz -P /usr/local/srcwget https://mirrors.tuna./apache/guacamole/1.3.0/binary/guacamole-1.3.0.war -P /usr/local/src
2. 解压服务端软件包
进入 Guacamole 服务端软件包目录 解压 Guacamole 服务端软件包
cd /usr/local/src;tar -zxvf guacamole-server-1.3.0.tar.gz
3. 编译服务端
进入目录,生成 makefile 文件
cd guacamole-server-1.3.0./configure --with--dir=/etc/init.d
编译
make make installldconfig
到这里,我们就已经编译好 Guacamole 了!
4. 将客户端代码移动到目录
mv /usr/local/src/guacamole-1.3.0.war /usr/local/src/apache-tomcat-10.0.2/webapps
5. 添加数据库
登录到MySQL
命令行
mysql -u root -p
创建数据库、创建用户、授权用户:
CREATE DATABASE guacamole CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'guacamole'@'localhost' IDENTIFIED BY '设置你的数据库用户密码';GRANT ALL PRIVILEGES ON guacamole.* TO 'guacamole'@'localhost';FLUSH PRIVILEGES;quit
6. 进入 guacamole 的配置目录并创建 guacamole.properties 和 user-mapping.xml 文件
cd /etc/guacamolevi guacamole.properties
guacamole.properties
文件内容如下:
guacd-hostname: localhostguacd-port:4822mysql-hostname: localhostmysql-port: 3306mysql-database: guacamolemysql-username: guacamoleadminmysql-password: 你的数据库用户密码
7. 配置 GUACAMOLE_HOME 环境变量
echo "export GUACAMOLE_HOME=/etc/guacamole" >> /etc/profilesource /etc/profile
8. 导入数据库
cd /usr/local/src/guacamolemysqlauth/guacamole-auth-jdbc-1.3.0/mysqlcat schema/*.sql | mysql -u root -p guacamole
然后输入数据库root账号密码
8. 重启 Tomcat
sh /usr/local/src/apache-tomcat-10.0.2/bin/shutdown.sh
sh /usr/local/src/apache-tomcat-10.0.2/bin/startup.sh
9. 启动 Guacd
service guacd start
访问浏览器 ip:8080/guacamole-1.3.0 即可访问!
Ps:需要在腾讯云轻量应用服务器的后台防火墙开放8080端口!
【教程】使用腾讯云轻量应用服务器搭建 Guacamole 远程桌面代理服务器 让境外小鸡远程不再卡顿!!