From a0fce4f7b6525bc8045ed7d123340735af1f7aea Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Thu, 5 Sep 2024 00:10:10 +0200 Subject: [PATCH] Fixes for ssl with mod_m,d --- scripts/manage_apache.py | 7 ++++--- tasks/apache/apache/add_vhost.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/manage_apache.py b/scripts/manage_apache.py index ddff12b..daab3ac 100644 --- a/scripts/manage_apache.py +++ b/scripts/manage_apache.py @@ -110,7 +110,8 @@ def manage(): real_root_dir=args.root_dir+'/htdocs' - aliases='ServerAlias www.'+args.domain + #aliases='ServerAlias www.'+args.domain + aliases='' if args.aliases: aliases='ServerAlias '+args.aliases.replace(',', ' ') @@ -213,7 +214,7 @@ def manage(): "RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]") vhost=vhost.replace('# SSL Options', "\n".join(ssl_options_http)) - vhost+="\n\n"+vhost_ssl + vhost=vhost_ssl+"\n\n"+vhost json_return={'error':0, 'status': 0, 'progress': 100, 'no_progress':0, 'message': 'Creating SSL Cert with Letsencrypt using mod_md...'} print(json.dumps(json_return)) @@ -454,7 +455,7 @@ def manage(): json_return['error']=1 json_return['status']=1 json_return['progress']=100 - json_return['message']='Error: the config is wrong '+vhost + json_return['message']='Error: the config is wrong \n'+vhost # Delete user diff --git a/tasks/apache/apache/add_vhost.py b/tasks/apache/apache/add_vhost.py index e18ccf4..746eafc 100644 --- a/tasks/apache/apache/add_vhost.py +++ b/tasks/apache/apache/add_vhost.py @@ -71,7 +71,7 @@ class ServerTask(Task): if 'debug' in self.data: debug_opt='--debug' - self.commands_to_execute=[['modules/apache/scripts/manage_apache.py', '--operation=add --domain=%s --email=%s --user=%s --root_dir=%s --type_cgi=%s --ip=%s --%s --port=%s %s %s %s' % (self.data['domain'], self.data['email'], self.data['user'], self.data['root_dir'], self.data['cgi_type'], self.data['ip'], debug_opt, self.data['port'], password, indexes, allow_override), 'sudo']] + self.commands_to_execute=[['modules/apache/scripts/manage_apache.py', '--operation=add --domain=%s --email=%s --user=%s --root_dir=%s --type_cgi=%s --ip=%s %s --port=%s %s %s %s' % (self.data['domain'], self.data['email'], self.data['user'], self.data['root_dir'], self.data['cgi_type'], self.data['ip'], debug_opt, self.data['port'], password, indexes, allow_override), 'sudo']] return True