From 5476f1c799b3fc0ac38d11ad991819f5e1ccd427 Mon Sep 17 00:00:00 2001 From: titoko Date: Wed, 17 Jul 2013 17:33:45 +0200 Subject: [PATCH] make webapp have their own apache conf files --- yunohost_app.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index 26e5e2b6..5daadaec 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -511,21 +511,23 @@ def app_install(app, domain, path='/', label=None, mode='private'): ########## # Apache # ########## + if lvl(manifest,'yunohost','webapp','custom_apache_conf'): + os.system('mv '+app_tmp_folder+'/'+manifest['yunohost']['webapp']['custom_apache_conf']+' '++a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf') + else: + a2_conf_lines = [ 'Alias '+ path +' '+ app_final_path + manifest['launch_path'] ] + if path != '/': + a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path']) - a2_conf_lines = [ 'Alias '+ path +' '+ app_final_path + manifest['launch_path'] ] - if path != '/': - a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path']) + a2_conf_lines.append('') - a2_conf_lines.append('') + if lvl(manifest, 'yunohost', 'webapp', 'language') and manifest['yunohost']['webapp']['language'] == 'php': + for line in open(a2_template_path +'/php.conf'): a2_conf_lines.append(line.rstrip()) - if lvl(manifest, 'yunohost', 'webapp', 'language') and manifest['yunohost']['webapp']['language'] == 'php': - for line in open(a2_template_path +'/php.conf'): a2_conf_lines.append(line.rstrip()) + a2_conf_lines.append('') - a2_conf_lines.append('') - - with open(a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf', 'w') as a2_conf: - for line in a2_conf_lines: - a2_conf.write(line + '\n') + with open(a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf', 'w') as a2_conf: + for line in a2_conf_lines: + a2_conf.write(line + '\n') #########################################