栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

手把手教你腾讯云搭建RUOYI系统

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

手把手教你腾讯云搭建RUOYI系统

手把手教你腾讯云搭建RUOYI系统
  • 前置准备
    • 腾讯云配置
      • 1 服务器准备
        • 1.1 腾讯云购买地址:
        • 1.2 配置
        • 开放端口
    • 2 软件安装
      • 2.1 MySQL在线安装
      • 2.2 Redis 安装
      • 2.3 ngnix 安装
      • 2.4 jdk安装
      • 2.5 maven
    • 3 软件运行
      • 3.1 打包 java
      • 3.1 打包 vue
    • 4 成功
    • 常用命令汇总
    • 问题汇总
    • 如果问题还是解决不了请联系我

前置准备

1 腾讯云服务器
2 连接liunx工具(mobexterm 地址. change free version)
3 mysql 连接工具 (navicat.exe)
4 RUOYI源码 地址 前后端分离版本
5 IDEA (编译java )
6 Visual Studio Code (编译 vue)

腾讯云配置 1 服务器准备 1.1 腾讯云购买地址:

腾讯云购买地址
买最便宜的就可以 ,2022年1月2日 价格是38¥

1.2 配置

选择通用型就可以

开放端口

1 开放MySQL端口号 3306

2 软件安装

软件统一安装在 /usr/local/* 下

2.1 MySQL在线安装
	cd 到  /usr/local/下执行 
cd /usr/local/
yum update
下载
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
安装
yum install mysql-server
systemctl start mysqld 
运行如下脚本文件
mysql_secure_installation
提示输入root密码,初始为null,回车就可以设置root密码了
之后提示一连串的问题,根据需要自己选择y 或者 n

配置

#1.将my-default.cnf 拷贝到 /etc/my.cnf  根据情况找到自己的目录
cp /usr/share/doc/mysql-community-server-5.6.31/my-default.cnf  /etc/my.cnf
#2.编辑/usr/my.cnf在[client](如果没有就自己加)下增加
default-character-set = utf8
#3.编辑/usr/my.cnf在[mysqld]下增加
character_set_server =  utf8
#4.重启MySql服务  这句代码和之前使用的net start mysql作用应该是一样的 开启服务 centos7使用以下代码
systemctl restart  mysql.service
#5.重现连接mysql并查看编码如下:
mysql -uroot –proot
mysql>show variables like '%character%';

允许远程登录

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root';
FLUSH PRIVILEGES;

安装配置完成
本地nvicat连接

2.2 Redis 安装

进入 cd /usr/local/

cd /usr/local/
下载
wget http://download.redis.io/releases/redis-4.0.7.tar.gz
解压redis
tar -zxvf redis-4.0.7.tar.gz
进入src下
cd /usr/local/redis-4.0.9/src/
执行
make all
进入
/usr/local/redis-4.0.9/src
启动
./redis-server

进入
 ./redis-cli




2.3 ngnix 安装

cd /usr/local/

下载
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
安装
sudo yum install -y nginx

启动停止 
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
查看 
 ps -ef | grep nginx
 [root@VM-24-14-centos src]# ps -ef | grep nginx
root     13190     1  0 11:00 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx    13191 13190  0 11:00 ?        00:00:00 nginx: worker process
root     30401 23553  0 16:39 pts/0    00:00:00 grep --color=auto nginx

配置 
vim /etc/nginx/nginx.conf
将server 整体替换


listen       80;
        server_name  localhost;

        location / {
            root   /usr/local/nginx/html/dist;
            index  index.html index.htm;
        }


        location /prod-api/ {
            proxy_pass http://127.0.0.1:8080/;
        }

     # location
        # root: 将接收到的资源根据/usr/local/nginx/html/dist文件夹去查找资源
        # index: 默认去上述路径中找到index.html或者index.htm
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


2.4 jdk安装

baidu上有很多随便找个安装就行,搜索关键词 《安装 CentOS 下安装JDK》

2.5 maven

baidu上有很多随便找个安装就行,搜索关键词 《安装 CentOS 下安装maven 》

3 软件运行 3.1 打包 java

1 下载 源码 https://gitee.com/y_project/RuoYi-Vue.git
2 idea 打开配置
3 skip test

4 instal

5 package

6 查看包

7 上传服务器
在 、usr/local/ 新建 xjl

cd /usr/local/
mkdir xjl

直接把包拖过来就可以了

8 启动

cd /usr/local/xjl/
nohup java -jar ruoyi-admin.jar &
tail -200f nohup.out

3.1 打包 vue

vscode 打开vue
打包

npm  install 
npm run build:prod


整个文件夹压缩上传到
/usr/local/nginx/html

解压

cd  /usr/local/nginx/html
unzip -o dist.zip
4 成功

常用命令汇总

nginx
systemctl stop nginx
systemctl start nginx
systemctl reload nginx

mysql
service mysqld start
service mysqld stop

问题汇总

安装完写的,问题主要集中在安装linux软件方面
最好都使用在线安装

如果问题还是解决不了请联系我

微信

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/691874.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号