Skip to content

Instantly share code, notes, and snippets.

@damm
Created October 16, 2009 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damm/211557 to your computer and use it in GitHub Desktop.
Save damm/211557 to your computer and use it in GitHub Desktop.
ruby_block "apache_version" do
block do
@apache_version_temp1=IO.popen("/usr/local/apache/bin/httpd -V | grep 'Server version' | awk '{print $3}' | cut -d / -f 2-2")
@apache_version=@apache_version_temp1.readline.chomp.to_i
end
end
remote_file "/usr/src/httpd-2.2.14.tar.bz2" do
source "http://archive.apache.org/dist/httpd/httpd-2.2.14.tar.bz2"
owner "root"
group "root"
mode "0644"
not_if { FileTest.exists?("/usr/src/httpd-2.2.14.tar.bz2") }
end
execute "unarchive-httpd-2.2.14" do
command "cd /usr/src;tar jxfv httpd-2.2.14.tar.bz2"
not_if { FileTest.exists?("/usr/src/httpd-2.2.14/configure") }
only_if { FileTest.directory?("/usr/src/httpd-2.2.6") }
end
directory "/usr/local/apache" do
owner "root"
group "root"
mode "0755"
end
directory "/usr/local/apache/lib" do
owner "root"
group "root"
mode "0755"
end
execute "configure-httpd-2.2.14" do
command "cd /usr/src/httpd-2.2.14;./configure --prefix=/usr/local/apache --enable-so --enable-info --disable-alias --disable-userdir --disable-dir --disable-negotiation --disable-asis --disable-autoindex --disable-filter --disable-include --disable-authn-file --disable-authn-default --disable-authz-host --disable-authz-user --disable-authz-default --disable-auth-basic --disable-cgi --disable-cgid --with-mpm=worker --enable-deflate --enable-headers --enable-rewrite"
only_if { @apache_version!='2.2.14' }
not_if { FileTest.exists?("/usr/src/httpd-2.2.14/Makefile") }
end
execute "make-httpd-2.2.14" do
command "cd /usr/src/httpd-2.2.14;make -j2"
not_if { @apache_version='2.2.14' }
only_if { FileTest.exists?("/usr/src/httpd-2.2.6/.libs/httpd") }
end
execute "install-httpd-2.2.14" do
command "cd /usr/src/httpd-2.2.14;make install"
only_if { FileTest.exists?("/usr/src/httpd-2.2.14/.libs/httpd") || @apache_version!='2.2.14' }
not_if { @apache_version='2.2.14' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment