Skip to content

Commit

Permalink
merge pull request heroku#4 into redis branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbrainard committed Mar 28, 2012
2 parents 10a75f9 + f902738 commit 60929fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
49 changes: 14 additions & 35 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
set -e

# config
APACHE_VERSION="2.2.19"
APACHE_VERSION="2.2.22"
APACHE_PATH="apache"
PHP_VERSION="5.3.6"
PHP_VERSION="5.3.10"
PHP_PATH="php"
EXT_PATH="extensions"
REDIS_EXT="$EXT_PATH/redis.so"
Expand All @@ -32,35 +32,19 @@ if [ -f www/Procfile ]; then
mv www/Procfile .
fi

# unpack cache
for DIR in $APACHE_PATH $PHP_PATH ; do
rm -rf $DIR
if [ -d $CACHE_DIR/$DIR ]; then
cp -r $CACHE_DIR/$DIR $DIR
fi
done
APACHE_URL="https://s3.amazonaws.com/php-lp/apache-$APACHE_VERSION.tar.gz"
echo "-----> Bundling Apache version $APACHE_VERSION"
curl --silent --max-time 60 --location "$APACHE_URL" | tar xz

# install apache if needed
if [ ! -d $APACHE_PATH ]; then
APACHE_URL="https://s3.amazonaws.com/php-lp/apache-$APACHE_VERSION.tar.gz"
echo "-----> Bundling Apache v$APACHE_VERSION"
curl --silent --max-time 60 --location $APACHE_URL | tar xz
fi
PHP_URL="https://s3.amazonaws.com/php-lp/php-$PHP_VERSION.tar.gz"
echo "-----> Bundling PHP version $PHP_VERSION"
curl --silent --max-time 60 --location "$PHP_URL" | tar xz

# install php if needed
if [ ! -d $PHP_PATH ]; then
PHP_URL="https://s3.amazonaws.com/php-lp/php-$PHP_VERSION.tar.gz"
echo "-----> Bundling PHP v$PHP_VERSION"
curl --silent --max-time 60 --location $PHP_URL | tar xz
fi

# install redis if needed
if [ ! -f $REDIS_EXT ]; then
mkdir -p $(dirname $REDIS_EXT)
REDIS_EXT_URL="https://s3.amazonaws.com/rbrainard-public/redis.so"
echo "-----> Bundling Redis extension"
curl --silent --max-time 60 --location $REDIS_EXT_URL > $REDIS_EXT
fi
mkdir -p $(dirname $REDIS_EXT)
REDIS_EXT_URL="https://s3.amazonaws.com/rbrainard-public/redis.so"
echo "-----> Bundling Redis extension"
curl --silent --max-time 60 --location $REDIS_EXT_URL > $REDIS_EXT

# update config files
cp $LP_DIR/conf/httpd.conf $APACHE_PATH/conf
Expand All @@ -71,7 +55,6 @@ mkdir -p bin
ln -s /app/php/bin/php bin/php

cat >>boot.sh <<EOF
sed -i 's/Listen 80/Listen '\$PORT'/' /app/apache/conf/httpd.conf
for var in \`env|cut -f1 -d=\`; do
echo "PassEnv \$var" >> /app/apache/conf/httpd.conf;
done
Expand All @@ -87,9 +70,5 @@ EOF

chmod +x boot.sh

# repack cache
mkdir -p $CACHE_DIR
for DIR in $APACHE_PATH $PHP_PATH ; do
rm -rf $CACHE_DIR/$DIR
cp -R $DIR $CACHE_DIR/$DIR
done
# clean the cache
rm -rf $CACHE_DIR/*
2 changes: 1 addition & 1 deletion conf/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ServerRoot "/app/apache/"
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen ${PORT}

ServerLimit 1
MaxClients 1
Expand Down
5 changes: 3 additions & 2 deletions conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ error_reporting = E_ALL & ~E_NOTICE
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On
display_errors = Off

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
Expand Down Expand Up @@ -946,6 +946,7 @@ default_socket_timeout = 60
;
extension=soap.so
extension=/app/extensions/redis.so
extension=apc.so
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
Expand Down Expand Up @@ -995,7 +996,7 @@ extension=/app/extensions/redis.so
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
date.timezone = UTC

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667
Expand Down

0 comments on commit 60929fe

Please sign in to comment.