| 178 | | |
|---|
| 179 | | task :install_apache do |
|---|
| 180 | | version = 'httpd-2.2.4' |
|---|
| 181 | | set :src_package, { |
|---|
| 182 | | :file => version + '.tar.gz', |
|---|
| 183 | | :md5sum => '3add41e0b924d4bb53c2dee55a38c09e httpd-2.2.4.tar.gz', |
|---|
| 184 | | :dir => version, |
|---|
| 185 | | :url => "http://www.apache.org/dist/httpd/#{version}.tar.gz", |
|---|
| 186 | | :unpack => "tar zxf #{version}.tar.gz;", |
|---|
| 187 | | :configure => %w( |
|---|
| 188 | | ./configure |
|---|
| 189 | | --enable-mods-shared=all |
|---|
| 190 | | --enable-proxy |
|---|
| 191 | | --enable-proxy-balancer |
|---|
| 192 | | --enable-proxy-http |
|---|
| 193 | | --enable-rewrite |
|---|
| 194 | | --enable-cache |
|---|
| 195 | | --enable-headers |
|---|
| 196 | | --enable-ssl |
|---|
| 197 | | --enable-deflate |
|---|
| 198 | | --with-included-apr #_so_this_recipe_doesn't_break_when_rerun |
|---|
| 199 | | --enable-dav #_for_subversion_ |
|---|
| 200 | | --enable-so #_for_subversion_ |
|---|
| 201 | | ; |
|---|
| 202 | | ).reject{|arg| arg.match '#'}.join(' '), |
|---|
| 203 | | :make => 'make;', |
|---|
| 204 | | :install => 'make install;', |
|---|
| 205 | | :post_install => 'install -b support/apachectl /etc/init.d/httpd;' |
|---|
| 206 | | } |
|---|
| 207 | | apt.install( {:base => %w(zlib1g-dev zlib1g openssl libssl-dev)}, :stable ) |
|---|
| 208 | | deprec.download_src(src_package, src_dir) |
|---|
| 209 | | deprec.install_from_src(src_package, src_dir) |
|---|
| 210 | | # ubuntu specific - should instead call generic name which can be picked up by different distros |
|---|
| 211 | | send(run_method, "update-rc.d httpd defaults") |
|---|
| 212 | | end |
|---|
| 213 | | |
|---|
| 214 | | desc "Install PHP from source" |
|---|
| 215 | | task :install_php do |
|---|
| 216 | | version = 'php-5.2.2' |
|---|
| 217 | | set :src_package, { |
|---|
| 218 | | :file => version + '.tar.gz', |
|---|
| 219 | | :md5sum => '7a920d0096900b2b962b21dc5c55fe3c php-5.2.2.tar.gz', |
|---|
| 220 | | :dir => version, |
|---|
| 221 | | :url => "http://www.php.net/distributions/#{version}.tar.gz", |
|---|
| 222 | | :unpack => "tar zxf #{version}.tar.gz;", |
|---|
| 223 | | :configure => %w( |
|---|
| 224 | | ./configure |
|---|
| 225 | | --prefix=/usr/local/php |
|---|
| 226 | | --with-apxs2=/usr/local/apache2/bin/apxs |
|---|
| 227 | | --disable-ipv6 |
|---|
| 228 | | --enable-sockets |
|---|
| 229 | | --enable-soap |
|---|
| 230 | | --with-pcre-regex |
|---|
| 231 | | --with-mysql |
|---|
| 232 | | --with-zlib |
|---|
| 233 | | --with-gettext |
|---|
| 234 | | --with-sqlite |
|---|
| 235 | | --enable-sqlite-utf8 |
|---|
| 236 | | --with-openssl |
|---|
| 237 | | --with-mcrypt |
|---|
| 238 | | --with-ncurses |
|---|
| 239 | | --with-jpeg-dir=/usr |
|---|
| 240 | | --with-gd |
|---|
| 241 | | --with-ctype |
|---|
| 242 | | --enable-mbstring |
|---|
| 243 | | --with-curl==/usr/lib |
|---|
| 244 | | ; |
|---|
| 245 | | ).reject{|arg| arg.match '#'}.join(' '), |
|---|
| 246 | | :make => 'make;', |
|---|
| 247 | | :install => 'make install;', |
|---|
| 248 | | :post_install => "" |
|---|
| 249 | | } |
|---|
| 250 | | apt.install( {:base => %w(zlib1g-dev zlib1g openssl libssl-dev |
|---|
| 251 | | flex libcurl3 libcurl3-dev libmcrypt-dev libmysqlclient15-dev libncurses5-dev |
|---|
| 252 | | libxml2-dev libjpeg62-dev libpng12-dev)}, :stable ) |
|---|
| 253 | | run "export CFLAGS=-O2;" |
|---|
| 254 | | deprec.download_src(src_package, src_dir) |
|---|
| 255 | | deprec.install_from_src(src_package, src_dir) |
|---|
| 256 | | deprec.append_to_file_if_missing('/usr/local/apache2/conf/httpd.conf', 'AddType application/x-httpd-php .php') |
|---|
| 257 | | end |
|---|
| 258 | | |
|---|
| 259 | | |
|---|
| 260 | | |
|---|
| 261 | | # move all memcache stuff to separate file |
|---|
| 262 | | set :memcache_ip, '127.0.0.1' |
|---|
| 263 | | set :memcache_port, 11211 |
|---|
| 264 | | set :memcache_memory, 256 |
|---|
| 265 | | |
|---|
| 266 | | # XXX needs thought/work |
|---|
| 267 | | task :memcached_start do |
|---|
| 268 | | run "memcached -d -m #{memcache_memory} -l #{memcache_ip} -p #{memcache_port}" |
|---|
| 269 | | end |
|---|
| 270 | | |
|---|
| 271 | | # XXX needs thought/work |
|---|
| 272 | | task :memcached_stop do |
|---|
| 273 | | run "killall memcached" |
|---|
| 274 | | end |
|---|
| 275 | | |
|---|
| 276 | | # XXX needs thought/work |
|---|
| 277 | | task :memcached_restart do |
|---|
| 278 | | memcached_stop |
|---|
| 279 | | memcached_start |
|---|
| 280 | | end |
|---|
| 281 | | |
|---|
| 282 | | task :install_memcached do |
|---|
| 283 | | version = 'memcached-1.2.2' |
|---|
| 284 | | set :src_package, { |
|---|
| 285 | | :file => version + '.tar.gz', |
|---|
| 286 | | :md5sum => 'a08851f7fa7b15e92ee6320b7a79c321 memcached-1.2.2.tar.gz', |
|---|
| 287 | | :dir => version, |
|---|
| 288 | | :url => "http://www.danga.com/memcached/dist/#{version}.tar.gz", |
|---|
| 289 | | :unpack => "tar zxf #{version}.tar.gz;", |
|---|
| 290 | | :configure => %w{ |
|---|
| 291 | | ./configure |
|---|
| 292 | | --prefix=/usr/local |
|---|
| 293 | | ; |
|---|
| 294 | | }.reject{|arg| arg.match '#'}.join(' '), |
|---|
| 295 | | :make => 'make;', |
|---|
| 296 | | :install => 'make install;', |
|---|
| 297 | | :post_install => 'install -b support/apachectl /etc/init.d/httpd;' |
|---|
| 298 | | } |
|---|
| 299 | | apt.install( {:base => %w(libevent-dev)}, :stable ) |
|---|
| 300 | | deprec.download_src(src_package, src_dir) |
|---|
| 301 | | deprec.install_from_src(src_package, src_dir) |
|---|
| 302 | | end |
|---|
| 303 | | |
|---|