Browse Source

Let cake locate nginx files and connect to database

In the transition to bash-based setup files we forgot
to address
1) nginx was no longer located at /usr/local/......
2) a $ was left off of the database host replacement, so cake
was literally trying to connect to host {DBHOST}
3) lots of unnecessary quotation marks
Hamilton Turner 10 years ago
parent
commit
4ce515da17
1 changed files with 6 additions and 5 deletions
  1. 6 5
      frameworks/PHP/cakephp/setup.sh

+ 6 - 5
frameworks/PHP/cakephp/setup.sh

@@ -1,11 +1,12 @@
 #!/bin/bash
 
-sed -i "s|'host' => '.*'|'host' => '\"{DBHOST}\"'|g" app/Config/database.php
-sed -i 's|REDISSERVER|'"${DBHOST}"'|g' app/Config/core.php
-sed -i 's|".*/FrameworkBenchmarks/cakephp|"'"${TROOT}"'|g' deploy/cake
-sed -i 's|Directory .*/FrameworkBenchmarks/cakephp|Directory '"${TROOT}"'|g' deploy/cake
-sed -i 's|root .*/FrameworkBenchmarks/cakephp|root '"${TROOT}"'|g' deploy/nginx.conf
 
 $PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
+sed -i "s|'host' => '.*'|'host' => '${DBHOST}'|g" app/Config/database.php
+sed -i 's|REDISSERVER|'${DBHOST}'|g' app/Config/core.php
+sed -i 's|".*/FrameworkBenchmarks/cakephp|"'${TROOT}'|g' deploy/cake
+sed -i 's|Directory .*/FrameworkBenchmarks/cakephp|Directory '${TROOT}'|g' deploy/cake
+sed -i 's|root .*/FrameworkBenchmarks/cakephp|root '${TROOT}'|g' deploy/nginx.conf
+sed -i 's|/usr/local/nginx/|'${IROOT}'/nginx/|g' deploy/nginx.conf
 
 $NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf