Commits

theoden  committed c6ec661

* Several instances of the Apache are now possible for the same INSTANCE_NAME
test for Project.remove is broken

  • Participants
  • Parent commits d96a80e
  • Branches multiple web-servers

Comments (0)

Files changed (1)

File fab_deploy/webserver/apache.py

         super(Apache, self).__init__(wsgi)
         self.config = config
 
+    def _get_server_config_name(self):
+        return '%s_%s' % (env.conf['INSTANCE_NAME'], self.config)
+
     @task_method
     @utils.run_as_sudo
     def upload_config(self):
         """ Updates apache config. """
-        name = env.conf['INSTANCE_NAME']
+        name = self._get_server_config_name()
         utils.upload_config_template(self.config,
                                      '/etc/apache2/sites-available/%s' % name,
                                      use_sudo=True)
 
     @task_method
     @utils.run_as_sudo
+    def disable_config(self):
+        """ Disables apache config and reloads apache. """
+        sudo('a2dissite %s' % self._get_server_config_name())
+        sudo('invoke-rc.d apache2 reload')
+
+    @task_method
+    @utils.run_as_sudo
     def restart(self):
         """ Restarts apache using init.d script. """
         # restart is not used because it can leak memory in some cases