Skip to content
Browse files

Apache, proxy to Hudson

  • Loading branch information...
1 parent f846912 commit 7dda89e22893948a602d7eecf3c05bf108aa3ff2 @jferris jferris committed Mar 24, 2011
Showing with 37 additions and 1 deletion.
  1. +13 −0 assets/site
  2. +1 −0 main.rb
  3. +8 −0 packages/apache.rb
  4. +15 −1 packages/hudson.rb
View
13 assets/site
@@ -0,0 +1,13 @@
+<VirtualHost *:80>
+ ProxyPass / http://localhost:8080/
+ ProxyPassReverse / http://localhost:8080/
+ ProxyRequests Off
+
+ # Local reverse proxy authorization override
+ # Most unix distribution deny proxy by default
+ # (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)
+ <Proxy http://localhost:8080/*>
+ Order deny,allow
+ Allow from all
+ </Proxy>
+</VirtualHost>
View
1 main.rb
@@ -1,4 +1,5 @@
require 'config'
+require 'packages/apache'
require 'packages/hudson'
require 'packages/ruby'
View
8 packages/apache.rb
@@ -0,0 +1,8 @@
+package :apache do
+ description "Apache HTTP server"
+ apt %w(apache2) do
+ post :install, [
+ %{a2dissite 000-default}
+ ]
+ end
+end
View
16 packages/hudson.rb
@@ -1,11 +1,25 @@
package :hudson do
description 'Hudson CI Server'
deb "http://hudson-ci.org/downloads/debian/hudson.deb"
- requires :hudson_dependencies
+ requires :hudson_dependencies, :apache_hudson_proxy
end
package :hudson_dependencies do
description "Hudson Dependencies"
apt %w(daemon openjdk-6-jre java-virtual-machine)
end
+package :apache_hudson_proxy do
+ describe "Proxy 80 to 8080 for Hudson"
+ apt %w(libapache2-mod-proxy-html) do
+ site = IO.read("assets/site")
+ post :install, [
+ %{a2enmod proxy},
+ %{a2enmod proxy_http},
+ %{bash -c "echo -e '#{site.gsub("\n", '\n')}' > /etc/apache2/sites-available/hudson"},
+ %{a2ensite hudson},
+ %{/etc/init.d/apache2 restart}
+ ]
+ end
+ requires :apache
+end

0 comments on commit 7dda89e

Please sign in to comment.
Something went wrong with that request. Please try again.