Skip to content

Commit

Permalink
Apache/2.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Jul 22, 2014
1 parent 090de2f commit af41164
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 52 deletions.
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [[ "${HHVM_VERSION}" ]]; then
export -f hhvm
fi

APACHE_VERSION="2.4.9"
APACHE_VERSION="2.4.10"
APACHE_DIST_URL="$S3_URL/apache-$APACHE_VERSION.tar.gz"
echo "- Apache $APACHE_VERSION" | indent
curl --silent --location "$APACHE_DIST_URL" | tar xz -C $BUILD_DIR/.heroku/php
Expand Down
10 changes: 6 additions & 4 deletions conf/apache2/httpd.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ LoadModule dir_module libexec/mod_dir.so
LoadModule alias_module libexec/mod_alias.so
LoadModule rewrite_module libexec/mod_rewrite.so

# special Heroku treatment
# taken from https://gist.github.com/progandy/6ed4eeea60f6277c3e39
# will be included in Apache 2.4.10+, most likely
LoadModule proxy_handler_module libexec/mod_proxy_handler.so
<IfVersion < 2.4.10>
# special treatment for Apache < 2.4.10 so we can SetHandler to mod_proxy_fcgi
# taken from https://gist.github.com/progandy/6ed4eeea60f6277c3e39
# the functionality is included in Apache 2.4.10+
LoadModule proxy_handler_module libexec/mod_proxy_handler.so
</IfVersion>

<IfModule unixd_module>
#
Expand Down
60 changes: 60 additions & 0 deletions support/build/apache
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: libraries/zlib, libraries/pcre

OUT_PREFIX=$1

# fail hard
set -o pipefail
# fail harder
set -eux

DEFAULT_VERSION="2.4.10"
dep_version=${VERSION:-$DEFAULT_VERSION}
dep_dirname=httpd-${dep_version}
dep_archive_name=${dep_dirname}.tar.gz
depdeps_archive_name=${dep_dirname}-deps.tar.gz
if echo -n $dep_version | python -c "import sys, pkg_resources; sys.exit(pkg_resources.parse_version(sys.stdin.read()) >= pkg_resources.parse_version('2.4.11'));"; then
dep_url=http://archive.apache.org/dist/httpd/${dep_archive_name}
depdeps_url=http://archive.apache.org/dist/httpd/${depdeps_archive_name}
else
dep_url=http://httpd.apache.org/dev/dist/${dep_archive_name}
depdeps_url=http://httpd.apache.org/dev/dist/${depdeps_archive_name}
fi

echo "-----> Building Apache ${dep_version}..."

curl -L ${dep_url} | tar xz
# both of these untar to $dep_dirname
curl -L ${depdeps_url} | tar xz

pushd ${dep_dirname}
./configure \
--enable-layout=GNU \
--prefix=${OUT_PREFIX} \
--with-included-apr \
--with-pcre=${OUT_PREFIX} \
--with-z=${OUT_PREFIX} \
--with-ssl \
--with-mpm=event \
--enable-mods-shared=all \
--enable-proxy \
--enable-proxy-fcgi \
--enable-rewrite \
--enable-deflate
make -s -j 9
make install -s
popd

if echo -n $dep_version | python -c "import sys, pkg_resources; sys.exit(pkg_resources.parse_version(sys.stdin.read()) >= pkg_resources.parse_version('2.4.10'));"; then
echo "-----> Building mod_proxy_handler..."

export PATH=${OUT_PREFIX}/bin:${OUT_PREFIX}/sbin:$PATH

curl -LO https://gist.githubusercontent.com/progandy/6ed4eeea60f6277c3e39/raw/5762a2542a18cd41ed6694bb0c4bd13109b649ad/mod_proxy_handler.c

apxs -i -c mod_proxy_handler.c
fi


echo "-----> Done."
7 changes: 7 additions & 0 deletions support/build/apache-2.4.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: libraries/zlib, libraries/pcre

VERSION=2.4.10

source $(dirname $0)/apache
49 changes: 2 additions & 47 deletions support/build/apache-2.4.9
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,6 @@
# Build Path: /app/.heroku/php/
# Build Deps: libraries/zlib, libraries/pcre

OUT_PREFIX=$1
VERSION=2.4.9

# fail hard
set -o pipefail
# fail harder
set -eux

DEFAULT_VERSION="2.4.9"
dep_version=${VERSION:-$DEFAULT_VERSION}
dep_dirname=httpd-${dep_version}
dep_archive_name=${dep_dirname}.tar.gz
dep_url=http://archive.apache.org/dist/httpd/${dep_archive_name}
depdeps_archive_name=${dep_dirname}-deps.tar.gz
depdeps_url=http://archive.apache.org/dist/httpd/${depdeps_archive_name}

echo "-----> Building Apache ${dep_version}..."

curl -L ${dep_url} | tar xz
# both of these untar to $dep_dirname
curl -L ${depdeps_url} | tar xz

pushd ${dep_dirname}
./configure \
--enable-layout=GNU \
--prefix=${OUT_PREFIX} \
--with-included-apr \
--with-pcre=${OUT_PREFIX} \
--with-z=${OUT_PREFIX} \
--with-ssl \
--with-mpm=event \
--enable-mods-shared=all \
--enable-proxy \
--enable-proxy-fcgi \
--enable-rewrite \
--enable-deflate
make -s -j 9
make install -s
popd

echo "-----> Building mod_proxy_handler..."

export PATH=${OUT_PREFIX}/bin:${OUT_PREFIX}/sbin:$PATH

curl -LO https://gist.githubusercontent.com/progandy/6ed4eeea60f6277c3e39/raw/5762a2542a18cd41ed6694bb0c4bd13109b649ad/mod_proxy_handler.c

apxs -i -c mod_proxy_handler.c

echo "-----> Done."
source $(dirname $0)/apache

0 comments on commit af41164

Please sign in to comment.