springboot打包部署可行方案:https://blog.youkuaiyun.com/qq_34409900/article/details/80561277
部署前端react将build放到liunx后执行npm install -g serve报错: https://blog.youkuaiyun.com/huanglin_developer/article/details/80050981
使用serve -s build 充当静态服务器后好像不能退出当前操作,退出服务器即停止
//这里安装nginx之后配置半天依然不会
安装nginx 进入root用户 yum -y install nginx
cd /etc/nginx
vi nginx.conf
修改server中的 root 前端文件目录 以及第一行的user 为你启动nginx的用户名
启动 /usr/sbin/nginx
因为1024以下端口只有root有权限,所有要授权(root安装的)
chown root:root nginx
chmod 755 nginx
chmod u+s nginx
//以至于我卸载了nginx,再次重装
卸载:yum remove nginx
查看linux是否存在nginx源:yum search nginx
安装:
sudo yum install -y nginx
启动nginx并设置开机自动启动
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
在 浏览器输入IP:80,可以访问到nginx的一个测试页面。
nginx访问日志的默认路径
/var/log/nginx
如果没有权限,进入root授权 name是用户名,pwd是密码
chown -R name:pwd /usr/local