Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Letsencypt still broken #10

Closed
mhertel opened this issue Aug 24, 2017 · 7 comments
Closed

Letsencypt still broken #10

mhertel opened this issue Aug 24, 2017 · 7 comments

Comments

@mhertel
Copy link

mhertel commented Aug 24, 2017

Just updated and I'm still getting the same error:

[Thu Aug 24 20:34:08 CEST 2017] Single domain='XXXX.com'
[Thu Aug 24 20:34:08 CEST 2017] Getting domain auth token for each domain
[Thu Aug 24 20:34:08 CEST 2017] Getting webroot for domain='XXXX.com'
[Thu Aug 24 20:34:08 CEST 2017] Getting new-authz for domain='XXXX.com'
[Thu Aug 24 20:34:14 CEST 2017] The new-authz request is ok.
[Thu Aug 24 20:34:14 CEST 2017] Verifying:XXXX.com
[Thu Aug 24 20:34:14 CEST 2017] Nginx mode for domain:XXXX.com
[Thu Aug 24 20:34:15 CEST 2017] Can not find conf file for domain XXXX.com
[Thu Aug 24 20:34:15 CEST 2017] Please add '--debug' or '--log' to check more details.
[Thu Aug 24 20:34:15 CEST 2017] See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh
[Thu Aug 24 20:34:16 CEST 2017] Installing CA to:/etc/nginx/ssl/XXXX.com/chain.pem
cat: /root/.acme.sh/XXXX.com/ca.cer: No such file or directory
(Domain name removed..)

@liaralabs
Copy link
Member

Hey @mhertel, sorry you're still having issues. Clean or dirty install from the last issue?

If you're using a dirty install, there are some things that need to be updated in /etc/nginx/sites-enabled/default in order for this to start working.

The easiest way to get you going without reinstalling nginx or the entire box would be:

hostname=sub.domain.com(enter your (sub)domain here)
rm -rf /etc/nginx/ssl/${hostname}
cat > /etc/nginx/sites-enabled/default <<NGC
server {
  listen 80 default_server;
  listen [::]:80 default_server;
  server_name _;

  location /.well-known {
    alias /srv/.well-known;
    allow all;
    default_type "text/plain";
    autoindex    on;
  }

  location / {
    return 301 https://\$server_name\$request_uri;
  }
}

# SSL configuration
server {
  listen 443 ssl default_server;
  listen [::]:443 ssl default_server;
  server_name _;
  ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
  ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
  include snippets/ssl-params.conf;
  client_max_body_size 40M;
  server_tokens off;
  root /srv/;

  index index.html index.php index.htm;

  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
  }

  include /etc/nginx/apps/*;

  location ~ /\.ht {
    deny all;
  }

  location /fancyindex {

  }
}
NGC

This will rebuild nginx with the proper configuration and wipe out the empty ssl certs from a botched install. If you run the updated letsencrypt script, it should find the necessary hooks to inject your hostname for acme.sh to find them.

Please let me know if you're still running into issues after this

@mhertel
Copy link
Author

mhertel commented Aug 24, 2017

I actually did a clean install after it failed last time since I couldnt get nginx to run properly again LOL

I will try out what you posted and will report back..

@mhertel
Copy link
Author

mhertel commented Aug 24, 2017

ok, it worked.. I also changed my hostname to what letsencrypt was looking for.

Cheers!

@mhertel
Copy link
Author

mhertel commented Aug 24, 2017

Hmm, letsencrypt worked, but now rutorrent won't connect to rtorrent any more.. Let's see what I broke now lol

@mhertel
Copy link
Author

mhertel commented Aug 25, 2017

I got it working now, some of the copy paste for the nginx config was borked..

@liaralabs
Copy link
Member

That's why I recommend cat -- the cat command necessarily has to escape the $ in the file, otherwise cat will expand them as variables (which are null)

fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;

becomes

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Once the command is done.

Is this safe to close now?

@mhertel
Copy link
Author

mhertel commented Aug 25, 2017

Yes, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants