Discover Centmin Mod today
Register Now

SSL Cloudflare Sysadmin What's the best practice to set up a new server restored from snapshot of another server?

Discussion in 'System Administration' started by modder, May 16, 2021.

  1. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    10:12 PM
    I want to build a new server (B) by restoring a snapshot from another server (A) with different domain name.

    For server A, I have xenforo with latest centminmod. ssh port changed to say, 3030, by option 16 in centmin menu.

    Currently this is what I do to build server B from the snapshot of server A:

    1) restore the snapshot to server B and I can SSH to it with the same credentials as in server A

    2) in Cloudflare, everything is the same as server A except hostname and IP address, etc.

    3) in Cloudflare, I create cert/key in Original Server, then I update those cert/key in the server by the following commands:

    Code:
    # cat> *crt
    (the generated crt)
    CTL-D
    # cat > *key
    (the generated key)
    CTL-D
    4) Then I changed server name in the following two parts:


    Code:
    server {
          listen   80;
          server_name mydomain.com www.mydomain.com;
          return 302 https://$server_name$request_uri;
    }
    
    server {
      listen 443 ssl http2 reuseport;
      server_name mydomain.com www.mydomain.com;
    5) # ngxrestart

    Done. I should be able to see the same website running with my new domain name.

    Does it cover everything? I use this method to create some other websites without problem, but this time, I got the following error when loading the new site:

    400 Bad Request
    No required SSL certificate was sent


    Can find a clue for that..
     
    Last edited: May 16, 2021
  2. eva2000

    eva2000 Administrator Staff Member

    54,548
    12,221
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,790
    Local Time:
    12:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Are you using Cloudflare Authenticated Origin Pull certs?
     
  3. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    10:12 PM
    Oh yeah. I didn't turn this option on in Cloudflare new server settings. Thanks.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,548
    12,221
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,790
    Local Time:
    12:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Ah ha ! :D
     
  5. AHTOLLlKA

    AHTOLLlKA Member

    32
    4
    8
    Dec 1, 2017
    Ratings:
    +9
    Local Time:
    5:12 PM