Fixes in proxy virtualhost

This commit is contained in:
absurdo 2023-12-14 23:51:40 +01:00
parent b2b879c3f8
commit d3d041f569
9 changed files with 84 additions and 21 deletions

View file

@ -148,12 +148,14 @@ if subprocess.call("sudo su %s -s /bin/bash -c 'git clone %s %sapp && cd %sapp &
sys.exit(1)
if path=='/':
base_name_file='{}-001-{}.conf'.format(args.domain, name)
base_name_file='{}-{}.conf'.format(args.domain, name)
else:
base_name_file='{}-000-{}.conf'.format(args.domain, name)
base_name_file='{}-{}.conf'.format(args.domain, name)
name_file='/home/{}/{}'.format(system_user, base_name_file)
apache_path='/proxy'
with open(name_file, 'w') as f:
f.write("ProxyPreserveHost On\n")
@ -177,9 +179,12 @@ with open(name_file, 'w') as f:
f.write("ProxyPass !\n")
f.write("</Location>\n")
else:
apache_path=''
print('Updating apache configuration for flask outside of htdocs...')
if subprocess.call('sudo mv {} /etc/{}/vhosts.d/extra && sudo chown root:root /etc/{}/vhosts.d/extra/{}'.format(name_file, apache_cmd, apache_cmd, base_name_file), shell=True) > 0:
if subprocess.call('sudo mv {} /etc/{}/vhosts.d/extra{} && sudo chown root:root /etc/{}/vhosts.d/extra{}/{}'.format(name_file, apache_cmd, apache_path, apache_cmd, apache_path, base_name_file), shell=True) > 0:
print('Error')
sys.exit(1)