Add directory specific apache conf at app installation

This commit is contained in:
Kload 2013-07-09 12:22:17 +02:00
parent b0b5967d8e
commit bc87412228

View file

@ -516,9 +516,13 @@ def app_install(app, domain, path='/', label=None, mode='private'):
if path != '/': if path != '/':
a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path']) a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path'])
a2_conf_lines.append('<Directory '+ app_final_path +'>')
if lvl(manifest, 'yunohost', 'webapp', 'language') and manifest['yunohost']['webapp']['language'] == 'php': 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()) for line in open(a2_template_path +'/php.conf'): a2_conf_lines.append(line.rstrip())
a2_conf_lines.append('</Directory>')
with open(a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf', 'w') as a2_conf: with open(a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf', 'w') as a2_conf:
for line in a2_conf_lines: for line in a2_conf_lines:
a2_conf.write(line + '\n') a2_conf.write(line + '\n')