項目部署問題彙總

Mac和Linux遠程鏈接服務器異常修復(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)javascript

1、今天在使用SSH,鏈接遠程服務器的時候,剛開始是沒問題的。
後來阿里雲主機重裝了一下系統後,再也連不上了。一直報一個錯。php

~ ⌚ 22:49:52
$ ssh root@47.98.233.15
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:8hgJ8jpcBr1tm6HS72FpXwMrjba8MQqlqYJQLPB/Qf4.
Please contact your system administrator.
Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:26
ECDSA host key for 47.98.233.15 has changed and you have requested strict checking.
Host key verification failed.

2、解決方法,看錯誤日誌中有一句css

Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
3、以編輯器的方式進入這個文件java

vi /Users/wangdong/.ssh/known_hosts
4、將紅線框部分刪除掉node


5、再次進行遠程鏈接npm

~ ⌚ 22:52:18
$ ssh root@47.98.233.15
The authenticity of host '47.98.233.15 (47.98.233.15)' can't be established.
ECDSA key fingerprint is SHA256:8hgJ8jpcBr1tm6HS72FpXwMrjba8MQqlqYJQLPB/Qf4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '47.98.233.15' (ECDSA) to the list of known hosts.
root@47.98.233.15's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-105-generic x86_64)json

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantageubuntu

Welcome to Alibaba Cloud Elastic Compute Service !api

root@iZbp17cj14ulhfrlj02rkaZ:~#

問題就解決了,緣由是由於才重裝系統後,再次進行遠程鏈接上,在輸入yes後,本機會將遠程機器的信息,寫到/Users/wangdong/.ssh/known_hosts文件中,因此若是遠程重裝系統了,本機必定要先清理掉。
————————————————
版權聲明:本文爲CSDN博主「向小凱同窗學習」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/wd2014610/article/details/79945424緩存

 

=========

```js
upstream blog {
    server 127.0.0.1:8000;
}
proxy_cache_path /cache levels=1:2 keys_zone=cache:10m max_size=10g inactive=60m use_temp_path=off;
server {
    listen 80;
    server_name www.blog.xiaozhumaopao.com;
    #開啓gzip壓縮start
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    #gzip_http_version 1.0;
    gzip_comp_level 8;
    gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif;
    gzip_vary off;
    gzip_disable "MSIE [1-6]\.";
    #開啓gzip壓縮end
    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Nginx-Proxy true;
        proxy_set_header   X-Forwarded-Host $server_name;

        proxy_pass http://blog;
        proxy_redirect off;

        #配置緩存start
        proxy_cache cache;
        proxy_cache_valid   200 304 12h;
        proxy_cache_valid   any 10m;
        add_header  Nginx-Cache "$upstream_cache_status";
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        #配置緩存end
    }
}


```

 3.若是每次提交代碼到服務器 都提示正在運行 pm2,還有關閉服務後,沒法請求接口:

1 配置文件中:

"post-deploy" : "npm install && pm2 startOrRestart ecosystem.json --env production", //項目發佈到服務器上執行的命令
 
2.增長 processes.json文件
{
    "apps": [
      {
        "name": "myblog",
        "cwd": "./",
        "script": "./bin/www",
        "log_date_format": "YYYY-MM-DD HH:mm Z",
        "error_file": "/var/log/node-app/node-app.stderr.log",
        "out_file": "log/node-app.stdout.log",
        "pid_file": "pids/node-geo-api.pid",
        "instances": 6,
        "min_uptime": "200s",
        "max_restarts": 10,
        "max_memory_restart": "1M",
        "cron_restart": "1 0 * * *",
        "watch": false,
        "merge_logs": true,
        "exec_interpreter": "node",
        "exec_mode": "fork",
        "autorestart": false,
        "vizion": false
      }
    ]
  }

 

如何解決出現 unable to resolve host 問題 . https://www.jianshu.com/p/a46795929d1e

相關文章
相關標籤/搜索