Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Apache, proxy to Hudson

  • Loading branch information...
commit 7dda89e22893948a602d7eecf3c05bf108aa3ff2 1 parent f846912
@jferris jferris authored
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,7 +1,7 @@
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
@@ -9,3 +9,17 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.