中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

離婚協(xié)議書模板 完整版海南seo代理加盟供應(yīng)商

離婚協(xié)議書模板 完整版,海南seo代理加盟供應(yīng)商,怎么做運營網(wǎng)站,湖北省建設(shè)信息網(wǎng)nextjs項目有多種部署方式,本文介紹最簡單的一種方式,將源碼上傳到云服務(wù)器,編譯后使用pm2后臺運行nextjs工程。 檢查node、npm是否安裝 查看npm版本,如果版本較低先升級npm版本 npm -v卸載 yum remove nodejs npm -y安裝新版…

nextjs項目有多種部署方式,本文介紹最簡單的一種方式,將源碼上傳到云服務(wù)器,編譯后使用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. 拷貝工程源碼目錄到服務(wù)器,其中node_modules、.git不需要上傳

  2. 編譯

npm run build

使用pm2后臺運行nextjs程序

  1. 安裝pm2
npm install -g pm2
  1. 運行
#注意當前是在工程目錄下,命令中的名稱可以任意命名,pm2管理中起到標識作用,實際運行的程序是當前目錄下
pm2 start --name 自定義名稱 npm -- start
  1. 查看端口占用,如工程中使用的3000,端口列表中也出現(xiàn)了,說明后臺運行成功了
netstat -nultp
  1. 如果服務(wù)器開放了對應(yīng)端口,可以加端口瀏覽器訪問項目,如果只能開放80,繼續(xù)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. 多工程配置
    創(chuàng)建 /etc/nginx/vhosts/工程名.conf,自行修改域名,確保域名映射已設(shè)置好
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;#設(shè)置主機頭和客戶端真實地址,以便服務(wù)器獲取客戶端真實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命令介紹

# 查看任務(wù)
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://www.risenshineclean.com/news/39275.html

相關(guān)文章:

  • 網(wǎng)站交互圖片怎么做的免費搭建網(wǎng)站的軟件
  • 網(wǎng)站開發(fā)維護求職信全球十大搜索引擎排名
  • 網(wǎng)站建設(shè)的最新技術(shù)寧波seo優(yōu)化公司
  • 網(wǎng)絡(luò)代理是干嘛的重慶seo扣費
  • 廣州站桂平網(wǎng)絡(luò)推廣
  • 宿遷建設(shè)局網(wǎng)站win7系統(tǒng)優(yōu)化
  • 禪城網(wǎng)站建設(shè)多少錢網(wǎng)絡(luò)營銷推廣策劃的步驟是什么
  • 高端營銷網(wǎng)站泰州百度公司代理商
  • 代做ppt網(wǎng)站百度知道在線問答
  • 網(wǎng)站靜態(tài)頁面網(wǎng)絡(luò)營銷案例ppt
  • 鹽亭做網(wǎng)站采集站seo提高收錄
  • 研發(fā)一個app費用seo百度發(fā)包工具
  • 深圳有做網(wǎng)站公司十大計算機培訓(xùn)學校
  • 綿陽做網(wǎng)站優(yōu)化杭州百度開戶
  • 微信上的小說網(wǎng)站是怎么做的做網(wǎng)絡(luò)推廣要學些什么
  • 找建設(shè)網(wǎng)站公司seo技術(shù)優(yōu)化服務(wù)
  • 合肥響應(yīng)式網(wǎng)站開發(fā)方案網(wǎng)絡(luò)推廣需要什么
  • 注冊過什么網(wǎng)站經(jīng)典軟文案例和扶貧農(nóng)產(chǎn)品軟文
  • 網(wǎng)站模塊是指什么地方石家莊線上推廣平臺
  • 網(wǎng)站建設(shè)論團seo網(wǎng)站推廣報價
  • jsp做網(wǎng)站遇到的問題獨立站seo
  • 寶安網(wǎng)站開發(fā)百度平臺我的訂單查詢在哪里
  • 海口今天發(fā)現(xiàn)一例東莞網(wǎng)站優(yōu)化
  • 做資源下載網(wǎng)站用什么工具山東建站管理系統(tǒng)
  • 網(wǎng)頁制作三劍客教程品牌詞優(yōu)化
  • php動態(tài)網(wǎng)站開發(fā)第四章企業(yè)seo關(guān)鍵詞優(yōu)化
  • 做網(wǎng)站的客戶資料交換qq群北京sem
  • 網(wǎng)站商城建設(shè)如何避免內(nèi)部競爭百度網(wǎng)絡(luò)營銷推廣
  • 沈陽教做網(wǎng)站市場營銷策劃
  • 網(wǎng)站上圖怎么用ps做阿里云服務(wù)器