fortminor
By:
fortminor

[lesaff] serverpilot - letsencrypt

May 31, 2017 269 views
Nginx Let's Encrypt Ubuntu 16.04

Im trying to install letsencrypt but Im totally noob when it comes to linux .
I need to install it from this link https://github.com/lesaff/serverpilot-letsencrypt
there is a "How to Install" but not quite clear to me
any advice tips would highly appreciated

5 Answers

@fortminor If you're using the free version, I don't think it includes free SSL management, so in that case you have either buy their Coach subscription or do it manually by following the tutorial.

You say that it didn't work - what didn't work, what errors did you get, when you followed the tutorial?

  • well some files was missing I tried it 3 times but didn't work as need to be, after a long search I found this tuto https://github.com/lesaff/serverpilot-letsencrypt I didn't test it yet but it worked for a setup as mine.
    he said "Copy sple.sh to your /usr/local/bin folder" and I don't know where to start,

    • @fortminor

      Login to your droplet thru SSH as root and do the following:

      cd /usr/local/bin
      
      wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh
      
      chmod +x sple.sh
      
      cd /root
      
      sple.sh
      
      • it works like a charm but I found another problem when I try to restart the nginx a message popup "Job for nginx-sp.service failed because the control process exited with error co de. See "systemctl status nginx-sp.service" and "journalctl -xe" for details.
        "

        • Then run either systemctl status nginx-sp.service or journalctl -xe
          Or run tail -30 /var/log/nginx/error.log

          I don't use ServerPilot, so their setup is different than a default setup, so I'm not sure what/why it's giving you an error.

          • well this what I got from systemctl status nginx-sp.service

            ● nginx-sp.service - nginx-sp
               Loaded: loaded (/lib/systemd/system/nginx-sp.service; enabled; vendor preset: enabled)
               Active: inactive (dead) (Result: exit-code) since Wed 2017-05-31 19:59:36 UTC; 1min 0s ago
              Process: 11872 ExecStartPre=/opt/sp/nginx/sbin/nginx -t (code=exited, status=1/FAILURE)
            
            May 31 19:59:34 ubuntu-1gb-ams3-01 systemd[1]: nginx-sp.service: Control process exited, code=exited status=1
            May 31 19:59:34 ubuntu-1gb-ams3-01 systemd[1]: Failed to start nginx-sp.
            May 31 19:59:35 ubuntu-1gb-ams3-01 systemd[1]: nginx-sp.service: Unit entered failed state.
            May 31 19:59:35 ubuntu-1gb-ams3-01 systemd[1]: nginx-sp.service: Failed with result 'exit-code'.
            May 31 19:59:36 ubuntu-1gb-ams3-01 systemd[1]: nginx-sp.service: Service hold-off time over, scheduling restart.
            May 31 19:59:36 ubuntu-1gb-ams3-01 systemd[1]: Stopped nginx-sp.
            May 31 19:59:36 ubuntu-1gb-ams3-01 systemd[1]: nginx-sp.service: Start request repeated too quickly.
            May 31 19:59:36 ubuntu-1gb-ams3-01 systemd[1]: Failed to start nginx-sp.
            
            

            and from journalctl -xe

            May 31 20:00:42 ubuntu-1gb-ams3-01 sshd[11900]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            May 31 20:00:46 ubuntu-1gb-ams3-01 sshd[11904]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121
            May 31 20:00:49 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:51 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Received disconnect from 121.18.238.125 port 38845:11:  [preauth]
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Disconnected from 121.18.238.125 port 38845 [preauth]
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            May 31 20:00:57 ubuntu-1gb-ams3-01 sshd[11906]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121
            May 31 20:01:00 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:02 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:04 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: Received disconnect from 121.18.238.125 port 50212:11:  [preauth]
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: Disconnected from 121.18.238.125 port 50212 [preauth]
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            May 31 20:01:08 ubuntu-1gb-ams3-01 sshd[11908]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121
            May 31 20:01:10 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:12 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:14 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: Received disconnect from 121.18.238.125 port 58928:11:  [preauth]
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: Disconnected from 121.18.238.125 port 58928 [preauth]
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            May 31 20:01:18 ubuntu-1gb-ams3-01 sshd[11910]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121
            May 31 20:01:20 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:23 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Received disconnect from 121.18.238.125 port 39096:11:  [preauth]
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Disconnected from 121.18.238.125 port 39096 [preauth]
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            May 31 20:01:29 ubuntu-1gb-ams3-01 sshd[11912]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121
            May 31 20:01:31 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:34 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Received disconnect from 121.18.238.125 port 52221:11:  [preauth]
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Disconnected from 121.18.238.125 port 52221 [preauth]
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.1
            lines 1743-1778/1778 (END)
            May 31 20:00:42 ubuntu-1gb-ams3-01 sshd[11900]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:00:46 ubuntu-1gb-ams3-01 sshd[11904]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:00:49 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:51 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Failed password for root from 121.18.238.125 port 38845 ssh2
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Received disconnect from 121.18.238.125 port 38845:11:  [preauth]
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: Disconnected from 121.18.238.125 port 38845 [preauth]
            May 31 20:00:53 ubuntu-1gb-ams3-01 sshd[11904]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:00:57 ubuntu-1gb-ams3-01 sshd[11906]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:00 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:02 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:04 ubuntu-1gb-ams3-01 sshd[11906]: Failed password for root from 121.18.238.125 port 50212 ssh2
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: Received disconnect from 121.18.238.125 port 50212:11:  [preauth]
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: Disconnected from 121.18.238.125 port 50212 [preauth]
            May 31 20:01:05 ubuntu-1gb-ams3-01 sshd[11906]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:08 ubuntu-1gb-ams3-01 sshd[11908]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:10 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:12 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:14 ubuntu-1gb-ams3-01 sshd[11908]: Failed password for root from 121.18.238.125 port 58928 ssh2
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: Received disconnect from 121.18.238.125 port 58928:11:  [preauth]
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: Disconnected from 121.18.238.125 port 58928 [preauth]
            May 31 20:01:15 ubuntu-1gb-ams3-01 sshd[11908]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:18 ubuntu-1gb-ams3-01 sshd[11910]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:20 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:23 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Failed password for root from 121.18.238.125 port 39096 ssh2
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Received disconnect from 121.18.238.125 port 39096:11:  [preauth]
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: Disconnected from 121.18.238.125 port 39096 [preauth]
            May 31 20:01:26 ubuntu-1gb-ams3-01 sshd[11910]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:29 ubuntu-1gb-ams3-01 sshd[11912]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            May 31 20:01:31 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:34 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Failed password for root from 121.18.238.125 port 52221 ssh2
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Received disconnect from 121.18.238.125 port 52221:11:  [preauth]
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: Disconnected from 121.18.238.125 port 52221 [preauth]
            May 31 20:01:36 ubuntu-1gb-ams3-01 sshd[11912]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=121.18.238.125  user=root
            
            

            and for more details Im using cloudflare and this IP "121.18.238.125" is not my original IP from DO

Hi @fortminor

Are you using ServerPilot? If yes, then use the interface in their control panel.

If no, then doesn't use their script, but use this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

In this tutorial, we will show you how to use Let's Encrypt to obtain a free SSL certificate and use it with Nginx on Ubuntu 16.04. We will also show you how to automatically renew your SSL certificate. If you're running a different web server, simply follow your web server's documentation to learn how to use the certificate with your setup.

@fortminor
I cannot see why it's failing. Let's see the Nginx log:

tail -30 /var/log/nginx/error.log

And run the Nginx configuration tester:

service nginx configtest

Solved by running:

apt-get -f install

cd /usr/local/bin

wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh

chmod +x sple.sh

./sple.sh

@hansen thanks a lot for your help (y)

Have another answer? Share your knowledge.