vhost
This commit is contained in:
parent
6cc2f3e223
commit
2199d81f1e
@ -70,10 +70,10 @@ def vhost_add(domain):
|
|||||||
if re.match(re_domain, domain) is None:
|
if re.match(re_domain, domain) is None:
|
||||||
print("Invalid domain name: " + domain + " -> pass")
|
print("Invalid domain name: " + domain + " -> pass")
|
||||||
|
|
||||||
www = os.path.join(html_dir_path + domain)
|
www = os.path.join(html_dir_path, domain)
|
||||||
os.makedirs(www, exist_ok=True)
|
os.makedirs(www, exist_ok=True)
|
||||||
|
|
||||||
logs = os.path.join(logs_dir_path + domain)
|
logs = os.path.join(logs_dir_path, domain)
|
||||||
os.makedirs(logs, exist_ok=True)
|
os.makedirs(logs, exist_ok=True)
|
||||||
|
|
||||||
# debug: this file might not be here
|
# debug: this file might not be here
|
||||||
@ -90,6 +90,12 @@ def vhost_add(domain):
|
|||||||
with open(vhost_file, 'w+') as vhost_file_fp:
|
with open(vhost_file, 'w+') as vhost_file_fp:
|
||||||
vhost_file_fp.write(vhost)
|
vhost_file_fp.write(vhost)
|
||||||
|
|
||||||
|
# check is ssl cert exists
|
||||||
|
cert = os.path.join('/etc/letsencrypt/live', domain)
|
||||||
|
if not os.path.exists(cert):
|
||||||
|
print("SSL certificates do not exist for domain - " + domain)
|
||||||
|
print("Please make sure to place them in " + cert + "to allow secure https")
|
||||||
|
|
||||||
def vhost_remove(domain):
|
def vhost_remove(domain):
|
||||||
print(" removing domain — " + domain)
|
print(" removing domain — " + domain)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user