Class: Capricorn::Actors::ApacheActor
- Inherits:
-
Capricorn::Actor
- Object
- Capricorn::Actor
- Capricorn::Actors::ApacheActor
- Defined in:
- lib/capricorn/actors/apache_actor.rb
Defined Under Namespace
Modules: Config
Instance Attribute Summary
Attributes inherited from Capricorn::Actor
Instance Method Summary collapse
-
#remove_config_file ⇒ Object
remove the vhost config file (needs apache restart).
-
#restart ⇒ Object
restart the apache server.
-
#write_config_file ⇒ Object
write the vhost config file (needs apache restart).
Methods inherited from Capricorn::Actor
Methods included from Capricorn::Actor::Actions
included, #run_callbacks!, #run_callbacks_in_fase!
Constructor Details
This class inherits a constructor from Capricorn::Actor
Instance Method Details
#remove_config_file ⇒ Object
remove the vhost config file (needs apache restart)
36 37 38 |
# File 'lib/capricorn/actors/apache_actor.rb', line 36 def remove_config_file File.unlink(system.apache_conf_path) if File.exist? system.apache_conf_path end |
#restart ⇒ Object
restart the apache server
13 14 15 |
# File 'lib/capricorn/actors/apache_actor.rb', line 13 def restart system.run "#{system.apachectl_path} -k restart" end |
#write_config_file ⇒ Object
write the vhost config file (needs apache restart)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/capricorn/actors/apache_actor.rb', line 18 def write_config_file config = %{<VirtualHost *> ServerName #{satellite.domain} ErrorLog logs/#{satellite.domain}.error.log CustomLog logs/#{satellite.domain}.access.log common DocumentRoot #{system.satellite_root}/public <Directory "#{system.satellite_root}/public"> Options All AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>} File.open(system.apache_conf_path, 'w+') { |f| f.write config } end |