Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

change all httpd vars to apache

  • Loading branch information...
commit 225a45e8637c3455e25e79fa2b7c542255fb6894 1 parent 5052a49
@pinguskahn pinguskahn authored
View
30 lib/railsmachine/generators/railsmachine/templates/deploy.rb
@@ -58,27 +58,27 @@
# WEB SERVER OPTIONS
# =============================================================================
# set :httpd, "apache" # apache or nginx
-# set :httpd_server_name, domain
-# set :httpd_server_aliases, %w{alias1 alias2}
-# set :httpd_default_vhost, true # force use of httpd_default_vhost_config
-# set :httpd_default_vhost_conf, "/etc/httpd/conf/default.conf"
-# set :httpd_conf, "/etc/httpd/conf/apps/#{application}.conf"
-# set :httpd_proxy_port, 8000
-# set :httpd_proxy_servers, 2
-# set :httpd_proxy_address, "127.0.0.1"
-# set :httpd_ssl_enabled, false
-# set :httpd_ssl_ip, "127.0.0.1"
-# set :httpd_ssl_forward_all, false
-# set :httpd_ctl, "/etc/init.d/httpd"
+# set : apache_server_name, domain
+# set : apache_server_aliases, %w{alias1 alias2}
+# set : apache_default_vhost, true # force use of apache_default_vhost_config
+# set : apache_default_vhost_conf, "/etc/httpd/conf/default.conf"
+# set : apache_conf, "/etc/httpd/conf/apps/#{application}.conf"
+# set : apache_proxy_port, 8000
+# set : apache_proxy_servers, 2
+# set : apache_proxy_address, "127.0.0.1"
+# set : apache_ssl_enabled, false
+# set : apache_ssl_ip, "127.0.0.1"
+# set : apache_ssl_forward_all, false
+# set : apache_ctl, "/etc/init.d/httpd"
# =============================================================================
# MONGREL OPTIONS
# =============================================================================
-# set :mongrel_servers, httpd_proxy_servers
-# set :mongrel_port, httpd_proxy_port
-# set :mongrel_address, httpd_proxy_address
+# set :mongrel_servers, apache_proxy_servers
+# set :mongrel_port, apache_proxy_port
+# set :mongrel_address, apache_proxy_address
# set :mongrel_environment, "production"
# set :mongrel_pid_file, "/var/run/mongrel_cluster/#{application}.pid"
# set :mongrel_conf, "/etc/mongrel_cluster/#{application}.conf"
View
6 lib/railsmachine/recipes.rb
@@ -151,7 +151,7 @@
desc "Setup web server."
task :setup, :roles => :web do
- set :httpd_server_name, domain unless httpd_server_name
+ set : apache_server_name, domain unless apache_server_name
apache.configure
end
@@ -200,8 +200,8 @@
def setup_mongrel
set_mongrel_conf
set :mongrel_environment, rails_env
- set :mongrel_port, httpd_proxy_port
- set :mongrel_servers, httpd_proxy_servers
+ set :mongrel_port, apache_proxy_port
+ set :mongrel_servers, apache_proxy_servers
set :mongrel_user, user unless mongrel_user
set :mongrel_group, mongrel_user unless mongrel_group
mongrel.cluster.configure
View
58 lib/railsmachine/recipes/web/apache.rb
@@ -2,18 +2,18 @@
Capistrano::Configuration.instance(:must_exist).load do
- set :httpd_server_name, nil
- set :httpd_conf, nil
- set :httpd_default_vhost, false
- set :httpd_default_vhost_conf, nil
- set :httpd_ctl, "/etc/init.d/httpd"
- set :httpd_server_aliases, []
- set :httpd_proxy_port, 8000
- set :httpd_proxy_servers, 2
- set :httpd_proxy_address, "127.0.0.1"
- set :httpd_ssl_enabled, false
- set :httpd_ssl_ip, nil
- set :httpd_ssl_forward_all, false
+ set : apache_server_name, nil
+ set : apache_conf, nil
+ set : apache_default_vhost, false
+ set : apache_default_vhost_conf, nil
+ set : apache_ctl, "/etc/init.d/httpd"
+ set : apache_server_aliases, []
+ set : apache_proxy_port, 8000
+ set : apache_proxy_servers, 2
+ set : apache_proxy_address, "127.0.0.1"
+ set : apache_ssl_enabled, false
+ set : apache_ssl_ip, nil
+ set : apache_ssl_forward_all, false
load 'config/deploy'
@@ -23,26 +23,26 @@
variable to determine whether to use sudo or not. By default, :use_sudo is
set to true."
task :configure, :roles => :web do
- set_httpd_conf
+ set_ apache_conf
- run("[ -f #{httpd_conf} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
+ run("[ -f #{ apache_conf} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
if o =~ /yes?/
- backup = "#{httpd_conf}.old.#{Time.now.strftime('%Y%m%d%H%M%S')}"
- send(run_method, "cp #{httpd_conf} #{backup}")
+ backup = "#{ apache_conf}.old.#{Time.now.strftime('%Y%m%d%H%M%S')}"
+ send(run_method, "cp #{ apache_conf} #{backup}")
exit if Capistrano::CLI.ui.ask("WARNING: You are about to change your existing Apache configuration. A backup has been created at #{backup}. Are you sure you want to proceed? [y/N]").upcase != "Y"
end
end
server_aliases = []
- server_aliases << "www.#{httpd_server_name}"
- server_aliases.concat httpd_server_aliases
- set :httpd_server_aliases_array, server_aliases
+ server_aliases << "www.#{ apache_server_name}"
+ server_aliases.concat apache_server_aliases
+ set : apache_server_aliases_array, server_aliases
file = File.join(File.dirname(__FILE__), "templates", app_server.to_s, "httpd.conf")
template = File.read(file)
buffer = ERB.new(template).result(binding)
- if httpd_ssl_enabled
+ if apache_ssl_enabled
file = File.join(File.dirname(__FILE__), "templates", app_server.to_s, "httpd-ssl.conf")
template = File.read(file)
ssl_buffer = ERB.new(template).result(binding)
@@ -50,37 +50,37 @@
end
put buffer, "#{shared_path}/httpd.conf", :mode => 0444
- send(run_method, "cp #{shared_path}/httpd.conf #{httpd_conf}")
+ send(run_method, "cp #{shared_path}/httpd.conf #{ apache_conf}")
send(run_method, "rm -f #{shared_path}/httpd.conf")
end
desc "Start Apache "
task :start, :roles => :web do
- send(run_method, "#{httpd_ctl} start")
+ send(run_method, "#{ apache_ctl} start")
end
desc "Restart Apache "
task :restart, :roles => :web do
- send(run_method, "#{httpd_ctl} restart")
+ send(run_method, "#{ apache_ctl} restart")
end
desc "Stop Apache "
task :stop, :roles => :web do
- send(run_method, "#{httpd_ctl} stop")
+ send(run_method, "#{ apache_ctl} stop")
end
desc "Reload Apache "
task :reload, :roles => :web do
- send(run_method, "#{httpd_ctl} reload")
+ send(run_method, "#{ apache_ctl} reload")
end
end
- def set_httpd_conf
- if httpd_default_vhost
- set :httpd_conf, "/etc/httpd/conf/default.conf" unless httpd_default_vhost_conf
+ def set_ apache_conf
+ if apache_default_vhost
+ set : apache_conf, "/etc/httpd/conf/default.conf" unless apache_default_vhost_conf
else
- set :httpd_conf, "/etc/httpd/conf/apps/#{application}.conf" unless httpd_conf
+ set : apache_conf, "/etc/httpd/conf/apps/#{application}.conf" unless apache_conf
end
end
View
58 lib/railsmachine/recipes/web/nginx.rb
@@ -2,18 +2,18 @@
Capistrano::Configuration.instance(:must_exist).load do
- set :httpd_server_name, nil
- set :httpd_conf, nil
- set :httpd_default_vhost, false
- set :httpd_default_vhost_conf, nil
- set :httpd_ctl, "/etc/init.d/httpd"
- set :httpd_server_aliases, []
- set :httpd_proxy_port, 8000
- set :httpd_proxy_servers, 2
- set :httpd_proxy_address, "127.0.0.1"
- set :httpd_ssl_enabled, false
- set :httpd_ssl_ip, nil
- set :httpd_ssl_forward_all, false
+ set : apache_server_name, nil
+ set : apache_conf, nil
+ set : apache_default_vhost, false
+ set : apache_default_vhost_conf, nil
+ set : apache_ctl, "/etc/init.d/httpd"
+ set : apache_server_aliases, []
+ set : apache_proxy_port, 8000
+ set : apache_proxy_servers, 2
+ set : apache_proxy_address, "127.0.0.1"
+ set : apache_ssl_enabled, false
+ set : apache_ssl_ip, nil
+ set : apache_ssl_forward_all, false
load 'config/deploy'
@@ -23,26 +23,26 @@
variable to determine whether to use sudo or not. By default, :use_sudo is
set to true."
task :configure, :roles => :web do
- set_httpd_conf
+ set_ apache_conf
- run("[ -f #{httpd_conf} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
+ run("[ -f #{ apache_conf} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
if o =~ /yes?/
- backup = "#{httpd_conf}.old.#{Time.now.strftime('%Y%m%d%H%M%S')}"
- send(run_method, "cp #{httpd_conf} #{backup}")
+ backup = "#{ apache_conf}.old.#{Time.now.strftime('%Y%m%d%H%M%S')}"
+ send(run_method, "cp #{ apache_conf} #{backup}")
exit if Capistrano::CLI.ui.ask("WARNING: You are about to change your existing Apache configuration. A backup has been created at #{backup}. Are you sure you want to proceed? [y/N]").upcase != "Y"
end
end
server_aliases = []
- server_aliases << "www.#{httpd_server_name}"
- server_aliases.concat httpd_server_aliases
- set :httpd_server_aliases_array, server_aliases
+ server_aliases << "www.#{ apache_server_name}"
+ server_aliases.concat apache_server_aliases
+ set : apache_server_aliases_array, server_aliases
file = File.join(File.dirname(__FILE__), "templates", app_server.to_s, "httpd.conf")
template = File.read(file)
buffer = ERB.new(template).result(binding)
- if httpd_ssl_enabled
+ if apache_ssl_enabled
file = File.join(File.dirname(__FILE__), "templates", app_server.to_s, "httpd-ssl.conf")
template = File.read(file)
ssl_buffer = ERB.new(template).result(binding)
@@ -50,37 +50,37 @@
end
put buffer, "#{shared_path}/httpd.conf", :mode => 0444
- send(run_method, "cp #{shared_path}/httpd.conf #{httpd_conf}")
+ send(run_method, "cp #{shared_path}/httpd.conf #{ apache_conf}")
send(run_method, "rm -f #{shared_path}/httpd.conf")
end
desc "Start Apache "
task :start, :roles => :web do
- send(run_method, "#{httpd_ctl} start")
+ send(run_method, "#{ apache_ctl} start")
end
desc "Restart Apache "
task :restart, :roles => :web do
- send(run_method, "#{httpd_ctl} restart")
+ send(run_method, "#{ apache_ctl} restart")
end
desc "Stop Apache "
task :stop, :roles => :web do
- send(run_method, "#{httpd_ctl} stop")
+ send(run_method, "#{ apache_ctl} stop")
end
desc "Reload Apache "
task :reload, :roles => :web do
- send(run_method, "#{httpd_ctl} reload")
+ send(run_method, "#{ apache_ctl} reload")
end
end
- def set_httpd_conf
- if httpd_default_vhost
- set :httpd_conf, "/etc/httpd/conf/default.conf" unless httpd_default_vhost_conf
+ def set_ apache_conf
+ if apache_default_vhost
+ set : apache_conf, "/etc/httpd/conf/default.conf" unless apache_default_vhost_conf
else
- set :httpd_conf, "/etc/httpd/conf/apps/#{application}.conf" unless httpd_conf
+ set : apache_conf, "/etc/httpd/conf/apps/#{application}.conf" unless apache_conf
end
end
View
12 lib/railsmachine/recipes/web/templates/mongrel/httpd-ssl.conf
@@ -1,7 +1,7 @@
-<VirtualHost <%= httpd_ssl_ip %>:443>
+<VirtualHost <%= apache_ssl_ip %>:443>
-ServerName <%= httpd_server_name %>
-<% httpd_server_aliases_array.each do |a| %>
+ServerName <%= apache_server_name %>
+<% apache_server_aliases_array.each do |a| %>
ServerAlias <%= "#{a}" %>
<% end %>
@@ -20,10 +20,10 @@ DocumentRoot <%= "#{current_path}/public" %>
# Configure mongrel_cluster
<Proxy balancer://<%= "#{application}_cluster" %>>
- <% start_port = httpd_proxy_port %>
- <% end_port = httpd_proxy_port + httpd_proxy_servers - 1 %>
+ <% start_port = apache_proxy_port %>
+ <% end_port = apache_proxy_port + apache_proxy_servers - 1 %>
<% start_port.upto(end_port) do |port| %>
- BalancerMember http://<%= "#{httpd_proxy_address}:#{port.to_s}" %>
+ BalancerMember http://<%= "#{ apache_proxy_address}:#{port.to_s}" %>
<% end %>
</Proxy>
View
14 lib/railsmachine/recipes/web/templates/mongrel/httpd.conf
@@ -1,8 +1,8 @@
-<VirtualHost <%= httpd_ssl_enabled ? httpd_ssl_ip : "*" %>:80>
- ServerName <%= httpd_server_name %>
- <% httpd_server_aliases_array.each do |a| %>
+<VirtualHost <%= apache_ssl_enabled ? apache_ssl_ip : "*" %>:80>
+ ServerName <%= apache_server_name %>
+ <% apache_server_aliases_array.each do |a| %>
ServerAlias <%= "#{a}" %>
<% end %>
@@ -22,16 +22,16 @@
# Configure mongrel_cluster
<Proxy balancer://<%= "#{application}_cluster" %>>
- <% start_port = httpd_proxy_port %>
- <% end_port = httpd_proxy_port + httpd_proxy_servers - 1 %>
+ <% start_port = apache_proxy_port %>
+ <% end_port = apache_proxy_port + apache_proxy_servers - 1 %>
<% start_port.upto(end_port) do |port| %>
- BalancerMember http://<%= "#{httpd_proxy_address}:#{port.to_s}" %>
+ BalancerMember http://<%= "#{ apache_proxy_address}:#{port.to_s}" %>
<% end %>
</Proxy>
RewriteEngine On
- <% if httpd_ssl_enabled && httpd_ssl_forward_all %>
+ <% if apache_ssl_enabled && apache_ssl_forward_all %>
RewriteRule ^(.*)$ https://<%= domain %>$1
<% end %>
View
6 lib/railsmachine/recipes/web/templates/passenger/httpd-ssl.conf
@@ -1,6 +1,6 @@
-<VirtualHost <%= httpd_ssl_ip %>:443>
- ServerName <%= httpd_server_name %>
- <% httpd_server_aliases_array.each do |a| %>
+<VirtualHost <%= apache_ssl_ip %>:443>
+ ServerName <%= apache_server_name %>
+ <% apache_server_aliases_array.each do |a| %>
ServerAlias <%= "#{a}" %>
<% end %>
DocumentRoot <%= "#{current_path}/public" %>
View
4 lib/railsmachine/recipes/web/templates/passenger/httpd.conf
@@ -1,6 +1,6 @@
<VirtualHost *:80>
- ServerName <%= httpd_server_name %>
- <% httpd_server_aliases_array.each do |a| %>
+ ServerName <%= apache_server_name %>
+ <% apache_server_aliases_array.each do |a| %>
ServerAlias <%= "#{a}" %>
<% end %>
DocumentRoot <%= "#{current_path}/public" %>
Please sign in to comment.
Something went wrong with that request. Please try again.