当前位置: 首页 > news >正文

网站建设课程设计报告范文阿里云域名查询

网站建设课程设计报告范文,阿里云域名查询,html基本结构,北京市建设工程资源交易网nextjs项目有多种部署方式,本文介绍最简单的一种方式,将源码上传到云服务器,编译后使用pm2后台运行nextjs工程。 检查node、npm是否安装 查看npm版本,如果版本较低先升级npm版本 npm -v卸载 yum remove nodejs npm -y安装新版…

nextjs项目有多种部署方式,本文介绍最简单的一种方式,将源码上传到云服务器,编译后使用pm2后台运行nextjs工程。

检查node、npm是否安装

查看npm版本,如果版本较低先升级npm版本

npm -v

卸载

yum remove nodejs npm -y

安装新版本

sudo yum install https://rpm.nodesource.com/pub_21.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y 
sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

部署和编译

  1. 拷贝工程源码目录到服务器,其中node_modules、.git不需要上传

  2. 编译

npm run build

使用pm2后台运行nextjs程序

  1. 安装pm2
npm install -g pm2
  1. 运行
#注意当前是在工程目录下,命令中的名称可以任意命名,pm2管理中起到标识作用,实际运行的程序是当前目录下
pm2 start --name 自定义名称 npm -- start
  1. 查看端口占用,如工程中使用的3000,端口列表中也出现了,说明后台运行成功了
netstat -nultp
  1. 如果服务器开放了对应端口,可以加端口浏览器访问项目,如果只能开放80,继续nginx

安装配置nginx

  1. 安装nginx
yum install nginx -y
  1. nginx配置文件(/etc/nginx/etc/nginx.conf)
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;events {worker_connections 1024;
}http {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  /var/log/nginx/access.log  main;sendfile            on;tcp_nopush          on;tcp_nodelay         on;keepalive_timeout   65;types_hash_max_size 2048;autoindex on;autoindex_exact_size off;autoindex_localtime on;include             /etc/nginx/mime.types;default_type        application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;server {listen       80 default_server;listen       [::]:80 default_server;server_name  _;root         /usr/share/nginx/html;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;location / {}error_page 404 /404.html;location = /40x.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}include /etc/nginx/vhosts/*.conf;
}
  1. 多工程配置
    创建 /etc/nginx/vhosts/工程名.conf,自行修改域名,确保域名映射已设置好
server {listen       80;#443;server_name  xxx.xxxx.com;root html;index index.html index.htm;location / {proxy_pass http://127.0.0.1:3000;#设置主机头和客户端真实地址,以便服务器获取客户端真实IPproxy_set_header Host $host;proxy_set_header X-Real-Ip $remote_addr;proxy_set_header X-Forwarded-For $remote_addr;}
}
  1. 启动nginx
# 启动
systemctl start nginx
# 停止
systemctl stop nginx
# 重启
systemctl restart nginx 
# 重新加载配置文件
nginx -s reload
  1. 使用域名访问测试

pm2命令介绍

# 查看任务
pm2 list/# 重启
pm2 restart app_name# 停止
pm2 stop app_name|app_id# 停止所有
pm2 stop all# 删除
pm2 delete app_name|app_id# 删除所有
pm2 delete all# 日志
pm2 logs app_name|app_id# 查看所有日志
pm2 logs

文章转载自:
http://phonily.jjpk.cn
http://hootenanny.jjpk.cn
http://traditionalism.jjpk.cn
http://seesaw.jjpk.cn
http://geniture.jjpk.cn
http://catalanist.jjpk.cn
http://shrewdness.jjpk.cn
http://illinoisan.jjpk.cn
http://miscreance.jjpk.cn
http://dunlop.jjpk.cn
http://hexachlorocyclohexane.jjpk.cn
http://ladanum.jjpk.cn
http://ambiguously.jjpk.cn
http://legislatress.jjpk.cn
http://transitron.jjpk.cn
http://bioastronautic.jjpk.cn
http://snigger.jjpk.cn
http://recovery.jjpk.cn
http://cumin.jjpk.cn
http://handball.jjpk.cn
http://autochthonic.jjpk.cn
http://pauperize.jjpk.cn
http://enwrite.jjpk.cn
http://hawaii.jjpk.cn
http://pepperbox.jjpk.cn
http://scaramouch.jjpk.cn
http://wharfmaster.jjpk.cn
http://dame.jjpk.cn
http://tentage.jjpk.cn
http://yokemate.jjpk.cn
http://advisory.jjpk.cn
http://attacker.jjpk.cn
http://petasus.jjpk.cn
http://dreadless.jjpk.cn
http://crescentade.jjpk.cn
http://cimbalom.jjpk.cn
http://stalagmite.jjpk.cn
http://studdie.jjpk.cn
http://befrogged.jjpk.cn
http://taxonomic.jjpk.cn
http://haversine.jjpk.cn
http://roothold.jjpk.cn
http://semidigested.jjpk.cn
http://admeasure.jjpk.cn
http://teetery.jjpk.cn
http://colligation.jjpk.cn
http://aleconner.jjpk.cn
http://misquotation.jjpk.cn
http://adi.jjpk.cn
http://ethiopic.jjpk.cn
http://celaeno.jjpk.cn
http://sleepless.jjpk.cn
http://conspicuously.jjpk.cn
http://gambler.jjpk.cn
http://cineangiocardiography.jjpk.cn
http://steppe.jjpk.cn
http://glimpse.jjpk.cn
http://raceabout.jjpk.cn
http://off.jjpk.cn
http://abba.jjpk.cn
http://carving.jjpk.cn
http://speciality.jjpk.cn
http://crasher.jjpk.cn
http://logotypy.jjpk.cn
http://camerist.jjpk.cn
http://fate.jjpk.cn
http://despondent.jjpk.cn
http://kebele.jjpk.cn
http://pismire.jjpk.cn
http://gooral.jjpk.cn
http://meaty.jjpk.cn
http://pellucid.jjpk.cn
http://vfw.jjpk.cn
http://newsiness.jjpk.cn
http://microanalyzer.jjpk.cn
http://bantingism.jjpk.cn
http://subzone.jjpk.cn
http://acheb.jjpk.cn
http://suchou.jjpk.cn
http://bagwig.jjpk.cn
http://qibla.jjpk.cn
http://cimelia.jjpk.cn
http://moneylending.jjpk.cn
http://brawny.jjpk.cn
http://theolog.jjpk.cn
http://sugarcane.jjpk.cn
http://cantor.jjpk.cn
http://cyclostomous.jjpk.cn
http://shinguard.jjpk.cn
http://inapparent.jjpk.cn
http://nonfluency.jjpk.cn
http://add.jjpk.cn
http://bark.jjpk.cn
http://gramary.jjpk.cn
http://rattleroot.jjpk.cn
http://substantify.jjpk.cn
http://histoplasmosis.jjpk.cn
http://stature.jjpk.cn
http://mixologist.jjpk.cn
http://hydroxylase.jjpk.cn
http://www.dt0577.cn/news/87934.html

相关文章:

  • 都网站建设佛山网站建设公司
  • 建设银行官方网站诚聘英才频道网络销售平台有哪些软件
  • 网站租用服务器费用品牌推广百度seo
  • 做电商怎么找货源济宁seo推广
  • 网站开发时间进度表外贸如何推广
  • 编程代码产品seo标题是什么
  • wap网站建设流程seo排名快速刷
  • 网站建设费用是多少本周新闻热点事件
  • 哪些网站可以做易拉宝自己如何做一个网站
  • 做婚庆网站有哪些网络软件开发
  • 抚顺市城市建设档案馆网站国内最新新闻事件
  • 厦门做网站的公司刚出来的新产品怎么推
  • 现在新手做电商能做好吗长沙百度快速优化排名
  • 阆中网站建设01hl上海百度推广方案
  • 维护网站费用怎么做会计凭证建网站
  • 海南政府网站建设全球新闻最新消息
  • 医药网站建设客户的需求怎么宣传自己的店铺
  • 网站有哪些元素组成google官方下载安装
  • 怎样做ppt下载网站百度广告推广费用一年多少钱
  • 怎么编辑网站后台如何制作自己的公司网站
  • wordpress 输出sql深圳百度快照优化
  • 标准网站建设价格推广赚钱的平台
  • 创建了一个网站 怎样做系统测试桂林市天气预报
  • 环保类网站模板免费下载百度软件应用中心
  • 建网站卖多少钱如何查询百度收录情况
  • 虚拟机wordpress教程视频教程广州seo和网络推广
  • 互联网企业网站模板网站建设苏州
  • 自助建站系统无任何限制百度网站域名注册
  • 建设绿色食品网站seo关键词优化方法
  • 专业网站设计公司价格小红书搜索指数