# lol **Repository Path**: wanglvlong/lol ## Basic Information - **Project Name**: lol - **Description**: lol - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-09-24 - **Last Updated**: 2021-09-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 生产环境的编译 ## 将 web 和 admin 编译成静态文件 放到 server 里 ### 1 地址问题:接口地址需要根据开发和编译来进行替换,axios 变量替换 baseURL:process.env.VUE_APP_API_URL || '/admin/api' ### 2 添加环境文件 ### 3 静态文件托管 ## css 文件等路径问题 ### vue.config.js # nginx 安装和配置 yum ## apt show nginx /yum list/info nginx ## yum -y install nginx # 数据库 ## yum -y install mongodb mongo => show dbs # git 安装和配置 ssh ## ssh-keygen ## cat /root/.ssh/id_rsa.pub # 安装 nodejs 配置淘宝镜像 ## yum install -y nodejs node -v ## yum install -y npm ## npm i nrm -g nrm use npm i -g n # 拉取代码 ## C:\Users\win10\.ssh\下产生两个文件:id_rsa 和 id_rsa.pub ## git init git add . git commit -m "" git remote add origin https://gitee.com/wanglvlong/lol.git git push -u origin master ## 服务器部署公钥 ## ll/ls git clone 进入 server npm i # pm2 ## pm2 start index.js pm2 list pm2 logs index ## curl http://localhost:3000 # nginx 反向代理 ps -ef | grep nginx ## Nginx 配置文件路径为:/www/server/panel/vhost/nginx/xinshouzhanzhang.conf ## nginx.conf 文件路径:/www/server/nginx/conf/nginx.conf ## 多域名 Nginx 配置文件:/www/server/panel/vhost/nginx/你的域名.conf ## /www/server/nginx https://nginxconfig.io/ ## service nginx reload 重载nginx # 数据导出 ## mongodump -d node-vue-lol ## mongorestore find / -name mongodb locate mongodb whereis mongodb which mongodb netstat -tunlp |grep 端口号 lsof -i:端口号 安装pm2 npm install -g pm2 启动应用 pm2 start app.js 列出所有应用 pm2 list 查看资源消耗 pm2 monit 查看某一个应用状态 pm2 describe [app id] 查看所有日志 pm2 logs 重启应用 pm2 restart [app id] 停止应用 pm2 stop [app id] 开启api访问 pm2 web