Appearance
linux 部署 SpringBoot 项目
1 JDK-17 安装
1.1 在 ftp/java/linux/下载microsoft-jdk-17.0.8.1-linux-x64.tar.gz到/root/
1.2 执行解压命令导入指定目录
bash
tar -zxvf /root/microsoft-jdk-17.0.8.1-linux-x64.tar.gz2 MySQL 安装
MySQL 数据库的详细安装步骤请参考 Linux数据库安装
3 Redis 安装
3.1 ftp/java/linux 下载redis-7.2.0.tar.gz
3.2 下一步执行安装操作
4 Nginx 安装
4.1 ftp/java/linux 下载nginx-1.24.0.tar.gz到指定目录,如/root/
4.2 解压文件nginx-1.24.0.tar.gz
bash
tar -zxvf /root/nginx-1.24.0.tar.gz4.3 进入解压后的目录,执行命令
bash
./configure --prefix=/usr/local/nginx
make
make install4.4 修改 nginx.conf
bash
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# 优化静态资源的访问性能
sendfile on;
# 启用 gzip 压缩,注意需要在安装 nginx 时启用 gzip 模块
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
text/javascript application/javascript application/x-javascript
text/x-json application/json application/x-web-app-manifest+json
text/css text/plain text/x-component
font/opentype application/x-font-ttf application/vnd.ms-fontobject
image/x-icon;
gzip_disable "MSIE [1-6]\.";
server {
#前端项目端口号
listen 3000;
server_name localhost;
location / {
#前端文件根目录
root html/web;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
}5 Minio 安装
5.1 ftp/java/linux 下载minio到指定目录,如root/
5.2 执行命令
bash
nohup ./minio server /root/data/jpwise-resources > /root/data/jpwise-resources/minio.log 2>&1 &