离线安装部署 ubuntu22

1.安装本地源 😉

tar -zvxf virtDeps.tar.gz -C /tmp
​
mv /etc/apt/sources.list /etc/apt/sources.list.bak
vi /etc/apt/sources.list
​
deb [trusted=yes] file:///tmp/root/virtDeps/   ./
​
apt update
#安装vim命令
apt install vim
#安装rz sz 命令
apt install lrzsz

2.安装mysql

1.安装命令

apt install mysql-server-8.0

2. 修改配置文件

vim /etc/mysql/mysql.conf.d/mysqld.cnf
​
#修改
bind-address            = 0.0.0.0
mysqlx-bind-address     = 0.0.0.0
​
#新增
skip-name-resolve
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
​

3. 重启mysql

systemctl restart mysql

4. 配置用户 密码 权限 创建数据库等

#创建需要的用户 密码
CREATE USER 'test'@'%' IDENTIFIED BY '123456';
​
GRANT all privileges ON *.* TO 'test'@'%';
​
FLUSH PRIVILEGES;
  
#创建需要的数据库 导入数据库脚本
create database yourdatabasename;
​
use yourdatabasename;
​
source /.../yourdbfile.sql;

3.安装redis

1. 安装命令

apt install redis

2. 修改配置文件

vim /etc/redis/redis.conf
#注释掉 bind
#bind 0.0.0.0 ::1
#模式修改为非保护模式
protected-mode no

3. 重启redis

systemctl restart redis

4.安装jdk

1. 安装命令

apt install openjdk-8-jdk

5.安装nginx

1. 安装命令

apt install nginx

2. 配置文件修改

mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
#创建新的nginx.conf 文件 使用下面的内容 修改本地地址、代理识别的uri、代理后的端口地址等
vim /etc/nginx/nginx.conf
#使nginx.conf 文件生效
nginx -s reload
#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"';
​
    #access_log  logs/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  65;
    client_max_body_size 500M;
    client_body_buffer_size 500M;
    #gzip  on;
    server {
        listen       80;
        server_name  localhost;
        gzip on;
        ssi on;
        ssi_silent_errors on;
        #默认路径:/usr/share/nginx
            root   html/dist/;
        #修改上传限制
        client_max_body_size 500M;
        client_body_buffer_size 500M;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
        client_max_body_size 500M;
        client_body_buffer_size 500M;
        try_files $uri $uri/ @router;
            index  index.html index.htm;
        }
      location @router {
        client_max_body_size 500M;
        client_body_buffer_size 500M;
        rewrite ^.*$ /index.html last;
        }
        #此处修改为对应的代理uri
        location /prod-api/ {
        client_max_body_size 500M;
        client_body_buffer_size 500M; 
        # 代理,修改为自己的ip 端口
          proxy_pass http://127.0.0.1:8082/; 
        } 
        #error_page  404              /404.html;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
  • 13
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值