From ebfe9ee733f3cd0197d8a0bdf8ef15c439c4e8a3 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 00:15:51 -0400 Subject: [PATCH 01/30] Debug messages --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index d7edcb5..f13a741 100755 --- a/bin/compile +++ b/bin/compile @@ -378,7 +378,7 @@ if [ ! -f "$FRAMEWORK" ] && [ -f "$basedir/../frameworks/$FRAMEWORK" ]; then fi if [ ! -f "$FRAMEWORK" ]; then - log_error "Framework \"$FRAMEWORK\" not found!" + echo "Framework \"$FRAMEWORK\" not found!" exit 1 fi From f2758b5ef9a1618c9a3e5ef0782a9331520a1451 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 09:55:00 -0400 Subject: [PATCH 02/30] Enabling debug --- conf/buildpack.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/buildpack.conf b/conf/buildpack.conf index 72c6889..0f998ce 100644 --- a/conf/buildpack.conf +++ b/conf/buildpack.conf @@ -3,7 +3,7 @@ S3_BUCKET=chh-heroku-buildpack-php S3_REGION=eu-west-1 # Uncomment if you want debug output and set -x -# BUILDPACK_DEBUG=yes +BUILDPACK_DEBUG=yes declare -A PHP_MODULE_API_VERSIONS PHP_MODULE_API_VERSIONS["5.3"]="20090626" From 00cf93c2f3a60e11f9d4e81a7c110977dbddee41 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 09:56:39 -0400 Subject: [PATCH 03/30] Making /root/bin directory before downloading jq --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index f13a741..31b1f7f 100755 --- a/bin/compile +++ b/bin/compile @@ -241,6 +241,7 @@ export_env_dir "$3" # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" +mkdir -p $HOME/bin curl "http://${S3_BUCKET}.s3.amazonaws.com/jq/jq" -L -s -o - > "$HOME/bin/jq" chmod +x "$HOME/bin/jq" From 921210218de085cea3734c3b41547579b141fd15 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 10:00:36 -0400 Subject: [PATCH 04/30] Disabling debug debug --- conf/buildpack.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/buildpack.conf b/conf/buildpack.conf index 0f998ce..72c6889 100644 --- a/conf/buildpack.conf +++ b/conf/buildpack.conf @@ -3,7 +3,7 @@ S3_BUCKET=chh-heroku-buildpack-php S3_REGION=eu-west-1 # Uncomment if you want debug output and set -x -BUILDPACK_DEBUG=yes +# BUILDPACK_DEBUG=yes declare -A PHP_MODULE_API_VERSIONS PHP_MODULE_API_VERSIONS["5.3"]="20090626" From 4a395538715719fb423ff8137c3293c23ab44d9f Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 10:08:40 -0400 Subject: [PATCH 05/30] Reverting debug message change -- needed to enable in buildpack.conf instead --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 31b1f7f..9327aa2 100755 --- a/bin/compile +++ b/bin/compile @@ -379,7 +379,7 @@ if [ ! -f "$FRAMEWORK" ] && [ -f "$basedir/../frameworks/$FRAMEWORK" ]; then fi if [ ! -f "$FRAMEWORK" ]; then - echo "Framework \"$FRAMEWORK\" not found!" + log_error "Framework \"$FRAMEWORK\" not found!" exit 1 fi From 3b36c4ca9e301e92ca74e900a5ac72be843cef42 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:12:08 -0400 Subject: [PATCH 06/30] Enabling debug --- conf/buildpack.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/buildpack.conf b/conf/buildpack.conf index 72c6889..0f998ce 100644 --- a/conf/buildpack.conf +++ b/conf/buildpack.conf @@ -3,7 +3,7 @@ S3_BUCKET=chh-heroku-buildpack-php S3_REGION=eu-west-1 # Uncomment if you want debug output and set -x -# BUILDPACK_DEBUG=yes +BUILDPACK_DEBUG=yes declare -A PHP_MODULE_API_VERSIONS PHP_MODULE_API_VERSIONS["5.3"]="20090626" From c242fddf19e461c68b965cd561108aa1dbe6dc6b Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:22:45 -0400 Subject: [PATCH 07/30] Adding cmsmadesimple --- frameworks/cmsmadesimple | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 frameworks/cmsmadesimple diff --git a/frameworks/cmsmadesimple b/frameworks/cmsmadesimple new file mode 100644 index 0000000..2193e58 --- /dev/null +++ b/frameworks/cmsmadesimple @@ -0,0 +1,34 @@ +#!/bin/bash + +BUILD_DIR="$2" +basedir="$( cd -P "$( dirname "$0" )" && pwd )" + +function sets_framework_cmsmadesimple() { + [ $(jq --raw-output '.extra.heroku.framework' < "$BUILD_DIR/composer.json") == "cmsmadesimple" ] +} + +case "$1" in + detect) + if [ ! -f "$BUILD_DIR/composer.json" ]; then + exit 1 + fi + + if sets_framework_cmsmadesimple; then + echo "-----> Detected cmsmadesimple app" + exit 0 + else + exit 1 + fi + ;; + compile) + echo "-----> Setting up cmsmadesimple app" + #cp "$basedir/../conf/nginx/cmsmadesimple.conf.erb" "$BUILD_DIR/conf/site.conf.erb" + /bin/mkdir -p $basedir/web/tmp/cache + /bin/mkdir -p $basedir/web/tmp/configs + /bin/mkdir -p $basedir/web/tmp/template_c + /bin/chmod 777 -R $basedir/web/tmp + /bin/touch $basedir/web/tmp/cache/index.html + /bin/touch $basedir/web/tmp/configs/index.html + /bin/touch $basedir/web/tmp/template_c/index.html + ;; +esac From 5175a76c56880b20fb84cb90aa10a4feb743bce8 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:23:43 -0400 Subject: [PATCH 08/30] Adding cmsmadesimple --- frameworks/cmsmadesimple | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 frameworks/cmsmadesimple diff --git a/frameworks/cmsmadesimple b/frameworks/cmsmadesimple old mode 100644 new mode 100755 From e4795d78c66a7ee240fef3d6f64a628b8c2366a1 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:26:30 -0400 Subject: [PATCH 09/30] Removing cmsmadesimple --- conf/buildpack.conf | 2 +- frameworks/cmsmadesimple | 34 ---------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100755 frameworks/cmsmadesimple diff --git a/conf/buildpack.conf b/conf/buildpack.conf index 0f998ce..72c6889 100644 --- a/conf/buildpack.conf +++ b/conf/buildpack.conf @@ -3,7 +3,7 @@ S3_BUCKET=chh-heroku-buildpack-php S3_REGION=eu-west-1 # Uncomment if you want debug output and set -x -BUILDPACK_DEBUG=yes +# BUILDPACK_DEBUG=yes declare -A PHP_MODULE_API_VERSIONS PHP_MODULE_API_VERSIONS["5.3"]="20090626" diff --git a/frameworks/cmsmadesimple b/frameworks/cmsmadesimple deleted file mode 100755 index 2193e58..0000000 --- a/frameworks/cmsmadesimple +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -BUILD_DIR="$2" -basedir="$( cd -P "$( dirname "$0" )" && pwd )" - -function sets_framework_cmsmadesimple() { - [ $(jq --raw-output '.extra.heroku.framework' < "$BUILD_DIR/composer.json") == "cmsmadesimple" ] -} - -case "$1" in - detect) - if [ ! -f "$BUILD_DIR/composer.json" ]; then - exit 1 - fi - - if sets_framework_cmsmadesimple; then - echo "-----> Detected cmsmadesimple app" - exit 0 - else - exit 1 - fi - ;; - compile) - echo "-----> Setting up cmsmadesimple app" - #cp "$basedir/../conf/nginx/cmsmadesimple.conf.erb" "$BUILD_DIR/conf/site.conf.erb" - /bin/mkdir -p $basedir/web/tmp/cache - /bin/mkdir -p $basedir/web/tmp/configs - /bin/mkdir -p $basedir/web/tmp/template_c - /bin/chmod 777 -R $basedir/web/tmp - /bin/touch $basedir/web/tmp/cache/index.html - /bin/touch $basedir/web/tmp/configs/index.html - /bin/touch $basedir/web/tmp/template_c/index.html - ;; -esac From 4c690a3c68e09b3a46b267f9e8218dbccb578300 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:39:35 -0400 Subject: [PATCH 10/30] Test -- trying to create temporary directories in run script --- bin/compile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/compile b/bin/compile index 9327aa2..a8f0931 100755 --- a/bin/compile +++ b/bin/compile @@ -418,7 +418,14 @@ mkdir -p "bin" cat > "bin/run" < /app/vendor/php/etc/conf.d/newrelic_license.ini fi From 9cd9bdee0140abddbc7df9ae44fec3f9b7ab6adf Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 12:41:07 -0400 Subject: [PATCH 11/30] Test -- trying to create temporary directories in run script --- bin/compile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bin/compile b/bin/compile index a8f0931..2829607 100755 --- a/bin/compile +++ b/bin/compile @@ -418,14 +418,7 @@ mkdir -p "bin" cat > "bin/run" < Date: Sun, 28 Sep 2014 13:21:20 -0400 Subject: [PATCH 12/30] Running php-fpm as dokku --- bin/compile | 3 +++ conf/php/php-fpm.conf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 2829607..9659fd0 100755 --- a/bin/compile +++ b/bin/compile @@ -239,6 +239,9 @@ function package_newrelic_enabled() { export_env_dir "$3" +# Create dokku user so volumes can be read/write +useradd -b /app/web -s /dev/null -u 1000 -U dokku + # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" mkdir -p $HOME/bin diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index 970c967..81c4468 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -127,7 +127,7 @@ daemonize = no ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. -user = nobody +user = dokku ;group = nobody ; The address on which to accept FastCGI requests. From 4c75db553f59d325ba8d655efe433dfc6bd349a6 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Sep 2014 20:56:13 -0400 Subject: [PATCH 13/30] Increasing types_hash_max_size 2048 in nginx.conf --- conf/nginx/base.conf.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index 7da051a..25ad47a 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -18,6 +18,8 @@ http { error_log logs/error.log notice; access_log logs/access.log; + types_hash_max_size 2048; + client_max_body_size 100m; client_body_timeout 600s; From 3ad0ad588eefc3125164bed8917ff3b7d7c6a5d3 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 1 Oct 2014 20:08:29 -0400 Subject: [PATCH 14/30] Making log directories writable --- bin/compile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/compile b/bin/compile index 9659fd0..3dd00d0 100755 --- a/bin/compile +++ b/bin/compile @@ -397,6 +397,11 @@ if [ -n "$FRAMEWORK" ] && [ -f "$FRAMEWORK" ]; then LOG_FILES=$(unique_array ${LOG_FILES[@]} ${FRAMEWORK_LOG_FILES[@]}) fi +for d in ${LOG_FILES[@]}; do + chown dokku $d + chmod 777 $d +done + if [ -n "$COMPILE_CMD" ]; then status "Running compile commands" while read -r cmd; do From ee189c554689559cc203078e947051442cfb3822 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 1 Oct 2014 20:08:29 -0400 Subject: [PATCH 15/30] Making log directories writable --- bin/compile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/compile b/bin/compile index 9659fd0..104bf70 100755 --- a/bin/compile +++ b/bin/compile @@ -397,6 +397,11 @@ if [ -n "$FRAMEWORK" ] && [ -f "$FRAMEWORK" ]; then LOG_FILES=$(unique_array ${LOG_FILES[@]} ${FRAMEWORK_LOG_FILES[@]}) fi +for d in ${LOG_FILES[@]}; do + chown dokku `dirname $d` + chmod 777 `dirname $d` +done + if [ -n "$COMPILE_CMD" ]; then status "Running compile commands" while read -r cmd; do From eb0b53042fb3513a0b370eda9c5768a4bd2dc350 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 1 Oct 2014 21:36:42 -0400 Subject: [PATCH 16/30] More log changes --- bin/compile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index eda1070..62cbf14 100755 --- a/bin/compile +++ b/bin/compile @@ -241,8 +241,6 @@ export_env_dir "$3" # Create dokku user so volumes can be read/write useradd -b /app/web -s /dev/null -u 1000 -U dokku -chgrp dokku -R /app/vendor/nginx -chgrp dokku -R /app/vendor/php # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" @@ -429,6 +427,9 @@ mkdir -p "bin" cat > "bin/run" < Date: Wed, 1 Oct 2014 22:10:07 -0400 Subject: [PATCH 17/30] More log changes --- bin/compile | 3 --- conf/nginx/base.conf.erb | 4 ++-- conf/php/php-fpm.conf | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/compile b/bin/compile index 62cbf14..104bf70 100755 --- a/bin/compile +++ b/bin/compile @@ -427,9 +427,6 @@ mkdir -p "bin" cat > "bin/run" < Date: Thu, 2 Oct 2014 21:36:51 -0400 Subject: [PATCH 18/30] Moving logfile location for pipe --- conf/nginx/base.conf.erb | 4 ++-- conf/php/php-fpm.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index 3b8a1d2..bdc08da 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -15,8 +15,8 @@ http { keepalive_timeout 65; - error_log /app/logs/nginx-error.log notice; - access_log /app/logs/nginx-access.log; + error_log /app/vendor/nginx/logs/nginx-error.log notice; + access_log /app/vendor/nginx/logs/nginx-access.log; types_hash_max_size 2048; diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index 950c176..c0659ff 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -27,7 +27,7 @@ ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Default Value: log/php-fpm.log -error_log = /app/logs/error.log +error_log = /app/vendor/php/var/log/php-error.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities From 6d66c95145a692150c46026c04132bc32a071718 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Thu, 2 Oct 2014 23:27:39 -0400 Subject: [PATCH 19/30] Reverting my changes to test new lxc --- bin/compile | 12 ++++++------ conf/php/php-fpm.conf | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/compile b/bin/compile index 104bf70..0ecf0a0 100755 --- a/bin/compile +++ b/bin/compile @@ -240,7 +240,7 @@ function package_newrelic_enabled() { export_env_dir "$3" # Create dokku user so volumes can be read/write -useradd -b /app/web -s /dev/null -u 1000 -U dokku +#useradd -b /app/web -s /dev/null -u 1000 -U dokku # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" @@ -265,7 +265,7 @@ PHP_INCLUDES= COMPILE_CMD= NGINX_INCLUDES= NEWRELIC_VERSION=4.4.5.35 -LOG_FILES=( "/app/vendor/nginx/logs/access.log" "/app/vendor/nginx/logs/error.log" "/app/vendor/php/var/log/error.log" ) +LOG_FILES=( "/app/vendor/nginx/logs/access.log" "/app/vendor/nginx/logs/error.log" "/app/vendor/php/var/log/error.log" "/app/vendor/php/var/log/php-error.log" ) # Read config variables from composer.json if it exists if [ -f "$BUILD_DIR/composer.json" ]; then @@ -397,10 +397,10 @@ if [ -n "$FRAMEWORK" ] && [ -f "$FRAMEWORK" ]; then LOG_FILES=$(unique_array ${LOG_FILES[@]} ${FRAMEWORK_LOG_FILES[@]}) fi -for d in ${LOG_FILES[@]}; do - chown dokku `dirname $d` - chmod 777 `dirname $d` -done +# for d in ${LOG_FILES[@]}; do +# chown dokku `dirname $d` +# chmod 777 `dirname $d` +# done if [ -n "$COMPILE_CMD" ]; then status "Running compile commands" diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index c0659ff..a37697b 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -127,7 +127,7 @@ daemonize = no ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. -user = dokku +;user = dokku ;group = nobody ; The address on which to accept FastCGI requests. From 6adb78e4e41094cbb7cc919ddae932c3e31c4a4b Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Thu, 2 Oct 2014 23:31:06 -0400 Subject: [PATCH 20/30] Reverting my changes to test new lxc --- conf/php/php-fpm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index a37697b..b45f674 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -127,7 +127,7 @@ daemonize = no ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. -;user = dokku +user = nobody ;group = nobody ; The address on which to accept FastCGI requests. From fe01f33b64c546fc64aac0b0c50e1c67cabb65af Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 00:04:51 -0400 Subject: [PATCH 21/30] Putting custom above site.conf --- conf/nginx/base.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index bdc08da..b75ec53 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -70,10 +70,10 @@ http { #Specify a charset charset utf-8; - include site.conf; - <% Shellwords.split(ENV['NGINX_INCLUDES'].to_s).each do |f| %> include /app/<%= f %>; <% end %> + + include site.conf; } } From d77b95448832faed9dae074e35ef44184911b275 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 00:29:39 -0400 Subject: [PATCH 22/30] Tweaking logs --- bin/compile | 4 +++- conf/nginx/base.conf.erb | 4 ++-- conf/php/php-fpm.conf | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/compile b/bin/compile index 0ecf0a0..961aaf1 100755 --- a/bin/compile +++ b/bin/compile @@ -245,6 +245,8 @@ export_env_dir "$3" # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" mkdir -p $HOME/bin +mkdir /app/logs +chmod 777 /app/logs curl "http://${S3_BUCKET}.s3.amazonaws.com/jq/jq" -L -s -o - > "$HOME/bin/jq" chmod +x "$HOME/bin/jq" @@ -265,7 +267,7 @@ PHP_INCLUDES= COMPILE_CMD= NGINX_INCLUDES= NEWRELIC_VERSION=4.4.5.35 -LOG_FILES=( "/app/vendor/nginx/logs/access.log" "/app/vendor/nginx/logs/error.log" "/app/vendor/php/var/log/error.log" "/app/vendor/php/var/log/php-error.log" ) +LOG_FILES=( "/app/logs/nginx-error.log" "/app/logs/nginx-access.log" "/app/logs/php-error.log" ) # Read config variables from composer.json if it exists if [ -f "$BUILD_DIR/composer.json" ]; then diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index b75ec53..0870f7b 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -15,8 +15,8 @@ http { keepalive_timeout 65; - error_log /app/vendor/nginx/logs/nginx-error.log notice; - access_log /app/vendor/nginx/logs/nginx-access.log; + error_log /app/logs/nginx-error.log notice; + access_log /app/logs/nginx-access.log; types_hash_max_size 2048; diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index b45f674..180162d 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -27,7 +27,7 @@ ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Default Value: log/php-fpm.log -error_log = /app/vendor/php/var/log/php-error.log +error_log = /app/logs/php-error.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities From e4fce0e67d247c706a195cfd6267bbda8004439d Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 00:33:33 -0400 Subject: [PATCH 23/30] Tweaking logs --- conf/nginx/base.conf.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index 0870f7b..167ccdf 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -15,7 +15,8 @@ http { keepalive_timeout 65; - error_log /app/logs/nginx-error.log notice; + rewrite_log on; + error_log /app/logs/nginx-error.log debug; access_log /app/logs/nginx-access.log; types_hash_max_size 2048; From cbc3de492675d2f04c3ac25e2d051cbe61c21fa5 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 00:45:31 -0400 Subject: [PATCH 24/30] Tweaking logs --- bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 961aaf1..8fe7fe0 100755 --- a/bin/compile +++ b/bin/compile @@ -450,8 +450,8 @@ fi erb conf/nginx.conf.erb > /app/vendor/nginx/conf/nginx.conf erb conf/site.conf.erb > /app/vendor/nginx/conf/site.conf -`init_log_plex_fifo ${LOG_FILES}` -`tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` +# `init_log_plex_fifo ${LOG_FILES}` +# `tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` ( exec php-fpm -p "/app/vendor/php" From d049dc725ca42eec6926fc8c1ddd1cf08fa35fa5 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 00:53:43 -0400 Subject: [PATCH 25/30] Tweaking logs --- bin/compile | 8 +++----- conf/nginx/base.conf.erb | 4 ++-- conf/php/php-fpm.conf | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/compile b/bin/compile index 8fe7fe0..5f5ee89 100755 --- a/bin/compile +++ b/bin/compile @@ -245,8 +245,6 @@ export_env_dir "$3" # Download jq binary for JSON processing export PATH="$HOME/bin:$PATH" mkdir -p $HOME/bin -mkdir /app/logs -chmod 777 /app/logs curl "http://${S3_BUCKET}.s3.amazonaws.com/jq/jq" -L -s -o - > "$HOME/bin/jq" chmod +x "$HOME/bin/jq" @@ -267,7 +265,7 @@ PHP_INCLUDES= COMPILE_CMD= NGINX_INCLUDES= NEWRELIC_VERSION=4.4.5.35 -LOG_FILES=( "/app/logs/nginx-error.log" "/app/logs/nginx-access.log" "/app/logs/php-error.log" ) +LOG_FILES=( "/app/vendor/nginx/logs/access.log" "/app/vendor/nginx/logs/error.log" "/app/vendor/php/var/log/php-error.log" ) # Read config variables from composer.json if it exists if [ -f "$BUILD_DIR/composer.json" ]; then @@ -450,8 +448,8 @@ fi erb conf/nginx.conf.erb > /app/vendor/nginx/conf/nginx.conf erb conf/site.conf.erb > /app/vendor/nginx/conf/site.conf -# `init_log_plex_fifo ${LOG_FILES}` -# `tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` +`init_log_plex_fifo ${LOG_FILES}` +`tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` ( exec php-fpm -p "/app/vendor/php" diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index 167ccdf..4d8e15c 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -16,8 +16,8 @@ http { keepalive_timeout 65; rewrite_log on; - error_log /app/logs/nginx-error.log debug; - access_log /app/logs/nginx-access.log; + error_log /app/vendor/nginx/logs/error.log debug; + access_log /app/vendor/nginx/logs/access.log; types_hash_max_size 2048; diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index 180162d..b45f674 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -27,7 +27,7 @@ ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Default Value: log/php-fpm.log -error_log = /app/logs/php-error.log +error_log = /app/vendor/php/var/log/php-error.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities From eb1968abbadb8316f88a63f7d3ac62a71f559ab2 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 01:01:55 -0400 Subject: [PATCH 26/30] Tweaking logs --- conf/nginx/base.conf.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index 4d8e15c..f082fbe 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -15,10 +15,11 @@ http { keepalive_timeout 65; - rewrite_log on; - error_log /app/vendor/nginx/logs/error.log debug; + error_log /app/vendor/nginx/logs/error.log notice; access_log /app/vendor/nginx/logs/access.log; + rewrite_log on; + types_hash_max_size 2048; client_max_body_size 100m; From 3a86e58f299e59ee95c47be31d82570a80031896 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 3 Oct 2014 01:03:55 -0400 Subject: [PATCH 27/30] Tweaking logs --- bin/compile | 9 ++++++--- conf/nginx/base.conf.erb | 4 ++-- conf/php/php-fpm.conf | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/compile b/bin/compile index 5f5ee89..5d2d84a 100755 --- a/bin/compile +++ b/bin/compile @@ -439,7 +439,10 @@ export DOCUMENT_ROOT="$DOCUMENT_ROOT" export INDEX_DOCUMENT="$INDEX_DOCUMENT" export NGINX_INCLUDES="$NGINX_INCLUDES" - +if [[ ! -d /app/logs ]]; then + mkdir /app/logs +fi +chmod 777 -R /app/logs if [ -n "\$NEW_RELIC_LICENSE_KEY" ]; then echo "newrelic.license=\"\$NEW_RELIC_LICENSE_KEY\"" > /app/vendor/php/etc/conf.d/newrelic_license.ini @@ -448,8 +451,8 @@ fi erb conf/nginx.conf.erb > /app/vendor/nginx/conf/nginx.conf erb conf/site.conf.erb > /app/vendor/nginx/conf/site.conf -`init_log_plex_fifo ${LOG_FILES}` -`tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` +# `init_log_plex_fifo ${LOG_FILES}` +# `tail_log_plex ${LOG_FILES} ${SYS_LOG_FILES}` ( exec php-fpm -p "/app/vendor/php" diff --git a/conf/nginx/base.conf.erb b/conf/nginx/base.conf.erb index f082fbe..fbbb993 100644 --- a/conf/nginx/base.conf.erb +++ b/conf/nginx/base.conf.erb @@ -15,8 +15,8 @@ http { keepalive_timeout 65; - error_log /app/vendor/nginx/logs/error.log notice; - access_log /app/vendor/nginx/logs/access.log; + error_log /app/logs/error.log notice; + access_log /app/logs/access.log; rewrite_log on; diff --git a/conf/php/php-fpm.conf b/conf/php/php-fpm.conf index b45f674..180162d 100644 --- a/conf/php/php-fpm.conf +++ b/conf/php/php-fpm.conf @@ -27,7 +27,7 @@ ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Default Value: log/php-fpm.log -error_log = /app/vendor/php/var/log/php-error.log +error_log = /app/logs/php-error.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities From da845dd394abac0baaaa4d2501999910400d9280 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 Oct 2014 20:06:07 -0400 Subject: [PATCH 28/30] Changing upload dir to 777 permissions --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index 5d2d84a..bb04832 100755 --- a/bin/compile +++ b/bin/compile @@ -443,6 +443,7 @@ if [[ ! -d /app/logs ]]; then mkdir /app/logs fi chmod 777 -R /app/logs +find /app/web/uploads -type d -exec chmod 777 {} \; if [ -n "\$NEW_RELIC_LICENSE_KEY" ]; then echo "newrelic.license=\"\$NEW_RELIC_LICENSE_KEY\"" > /app/vendor/php/etc/conf.d/newrelic_license.ini From ec5f58b96ba0c56f167d6b0b176430a3d603abb3 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 Oct 2014 20:10:24 -0400 Subject: [PATCH 29/30] Changing upload dir to 777 permissions --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index bb04832..165d5c3 100755 --- a/bin/compile +++ b/bin/compile @@ -444,6 +444,7 @@ if [[ ! -d /app/logs ]]; then fi chmod 777 -R /app/logs find /app/web/uploads -type d -exec chmod 777 {} \; +find /app/web/tmp -type d -exec chmod 777 {} \; if [ -n "\$NEW_RELIC_LICENSE_KEY" ]; then echo "newrelic.license=\"\$NEW_RELIC_LICENSE_KEY\"" > /app/vendor/php/etc/conf.d/newrelic_license.ini From 853787775db7f4131f1b98a5064ac73f0e82c8c2 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 11 Oct 2014 08:23:51 -0400 Subject: [PATCH 30/30] Fixing redirect to port :5000 --- conf/nginx/default_site.conf.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/nginx/default_site.conf.erb b/conf/nginx/default_site.conf.erb index 050312f..f69efdd 100644 --- a/conf/nginx/default_site.conf.erb +++ b/conf/nginx/default_site.conf.erb @@ -3,6 +3,8 @@ root /app/<%= ENV['DOCUMENT_ROOT'] %>; location ~ \.php { include fastcgi_params; + fastcgi_param SERVER_PORT 80; + fastcgi_param SERVER_NAME $http_host; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass php; fastcgi_buffers 256 4k;