From 70396c578230bddd8e43dc27e0302e07645a47c3 Mon Sep 17 00:00:00 2001 From: "ncomputers.org" Date: Mon, 27 Mar 2017 14:48:35 -0600 Subject: [PATCH] create directories for letsencrypt --- server/plugins-available/apache2_plugin.inc.php | 2 +- server/plugins-available/nginx_plugin.inc.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 2556468674..0265c34202 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1222,7 +1222,7 @@ class apache2_plugin { // check if domains are reachable to avoid letsencrypt verification errors $le_rnd_file = uniqid('le-') . '.txt'; $le_rnd_hash = md5(uniqid('le-', true)); - mkdir('/usr/local/ispconfig/interface/acme/.well-known/acme-challenge/',0750,true); + if(!is_dir('/usr/local/interface/acme/.well-known/acme-challenge/'))mkdir('/usr/local/ispconfig/interface/acme/.well-known/acme-challenge/',0755,true); file_put_contents('/usr/local/ispconfig/interface/acme/.well-known/acme-challenge/' . $le_rnd_file, $le_rnd_hash); $le_domains = array(); diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 55d2b19151..d114519f62 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1295,8 +1295,9 @@ class nginx_plugin { // check if domains are reachable to avoid letsencrypt verification errors $le_rnd_file = uniqid('le-') . '.txt'; $le_rnd_hash = md5(uniqid('le-', true)); + if(!is_dir('/usr/local/interface/acme/.well-known/acme-challenge/'))mkdir('/usr/local/ispconfig/interface/acme/.well-known/acme-challenge/',0755,true); file_put_contents('/usr/local/ispconfig/interface/acme/.well-known/acme-challenge/' . $le_rnd_file, $le_rnd_hash); - + $le_domains = array(); foreach($temp_domains as $temp_domain) { $le_hash_check = trim(@file_get_contents('http://' . $temp_domain . '/.well-known/acme-challenge/' . $le_rnd_file)); -- GitLab