angular - 如何在 aws ec2 中使用 pm2 启动/运行 Angular 应用程序
问题描述
我在目录 /etc/nginx/conf.d 中有配置
`
server {
listen 80;
root /var/www/html/owner/dist/browser;
server_name stagingapp.company.com;
location / {
proxy_pass http://127.0.0.1:8002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
我从本地系统构建了应用程序并推送到 Git。然后从 app 目录中的 Ec2 Server 中提取相同的内容。现在我想运行应用程序。我们对 PM2 有任何命令吗?
解决方案
与应用程序一起工作。
cd /var/www/my-demo-app ng build --prod --build-optimizer
*还要检查,sudo apt-get update sudo npm update
推荐阅读
- c# - Visual Studio 仍然引用我已经卸载的包
- angular - Importing MatButtonModule does nothing
- tomcat - 带有 Tomcat 的 JSF WebApp(哪个版本?)
- java - jdbc kerberos oracle 身份验证问题
- javascript - 针对特定 Post Id 的目标 wpcf7submit 事件
- paramiko - Paramiko SSHClient 从 shell 的菜单中选择一个选项
- javascript - Express 返回服务器的自动 HTML 错误页面,而不是我的 res.json 错误消息
- powershell - powershell 设置窗口大小并使用参数执行脚本
- python - python中.mp4到.wav的转换花费了太长时间
- highcharts - 在 Highcharts 中仅显示第一个和最后一个 xAxis 标签