diff --git a/wcsinst/wcsinstd/deploy.py b/wcsinst/wcsinstd/deploy.py index f82c5ff..08dcefc 100644 --- a/wcsinst/wcsinstd/deploy.py +++ b/wcsinst/wcsinstd/deploy.py @@ -152,7 +152,15 @@ class DeployInstance(object): def make_apache_vhost(self): - pass + apache_vhost_template_path = os.path.join(self.skel_dir, 'apache-vhost.conf') + if not os.path.exists(apache_vhost_template_path): + return + apache_vhost_template = file(apache_vhost_template_path).read() + apache_dir = os.path.join(settings.MEDIA_ROOT, 'vhosts.d') + if not os.path.exists(apache_dir): + os.mkdir(apache_dir) + file(os.path.join(apache_dir, '%s.conf' % self.domain), 'w').write( + string.Template(apache_vhost_template).substitute({'domain': self.domain})) def reload_apache(self):