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;
}
}
}