ubuntu部署若依vue版
能用apt install就不要整那些幺蛾子
简单就是美学

安装mysql

apt update
apt upgrade

apt install mysql-server

修改etc/mysql/mysql.conf.d/mysqld.cnf的 bind-address=0.0.0.0

ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password by ‘密码’;

CREATE USER ‘root’@‘%’ IDENTIFIED BY ‘密码’;
GRANT ALL ON . TO ‘root’@‘%’;
ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘密码’;
FLUSH PRIVILEGES;

安装redis

apt install redis-server

安装java8

apt install openjdk-8-jdk

java -version

安装nginx

apt install nginx
验证是否安装成功
sudo systemctl status nginx
修改配置
/etc/nginx/sites-available/default

server {
	listen       80;
        server_name  12.34.56.78;

	location / {
        root   /usr/ruoyi/dist;
		try_files $uri $uri/ /index.html;
        index  index.html index.htm;
        }
		
	location /prod-api/{
		proxy_set_header Host $http_host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header REMOTE-HOST $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass http://localhost:8080/;
	}
	
    error_page   500 502 503 504  /50x.html;
        location = /50x.html {
             root   html;
        }
}
Logo

快速构建 Web 应用程序

更多推荐