From e03b21203e67c64537b0d2cf131b6f86b5bb4225 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 19:24:50 +0100 Subject: [PATCH 01/15] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 157ecb2..095025b 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ exit 1 fi # Remove trailing "/" for next commands -if [ ! $path -lt 2 ]; then +if [ !$path = "/" ]; then path=${path%/} fi From c23d9d8d8a2f863d51a57e882fb1f4b3ff511fd0 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 19:28:26 +0100 Subject: [PATCH 02/15] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 095025b..227b349 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ exit 1 fi # Remove trailing "/" for next commands -if [ !$path = "/" ]; then +if [ $path != "/" ]; then path=${path%/} fi From 972c87364aeaa65db97c0c9c62ce9ca5cb0b0e31 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 19:46:24 +0100 Subject: [PATCH 03/15] Update install --- scripts/install | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/install b/scripts/install index 227b349..79c1be3 100644 --- a/scripts/install +++ b/scripts/install @@ -10,10 +10,6 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi -# Remove trailing "/" for next commands -if [ $path != "/" ]; then -path=${path%/} -fi # Generate random DES key & password deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') From 47cd0867588da90be4b7dec041ac54bc8ba03db2 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 19:49:58 +0100 Subject: [PATCH 04/15] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 79c1be3..20ffbb9 100644 --- a/scripts/install +++ b/scripts/install @@ -10,6 +10,8 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi +# Remove trailing "/" for next commands +path=${path%/} # Generate random DES key & password deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') From 17c91fc0037f3092b4859dfaebc3b1bc93e36ae1 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 19:58:20 +0100 Subject: [PATCH 05/15] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 20ffbb9..74fb029 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,9 @@ exit 1 fi # Remove trailing "/" for next commands +if [ "$path" != "/" ]; then path=${path%/} +fi # Generate random DES key & password deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') From b0ee44fde04acd1617dbec392e4c758c10b12951 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 20:02:46 +0100 Subject: [PATCH 06/15] Update install --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 74fb029..febf1af 100644 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,8 @@ exit 1 fi # Remove trailing "/" for next commands -if [ "$path" != "/" ]; then path=${path%/} -fi + # Generate random DES key & password deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') From 25d0b2dff5f2367e5ffdbbb768102e555917cf90 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 20:08:13 +0100 Subject: [PATCH 07/15] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index febf1af..04866c4 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ exit 1 fi # Remove trailing "/" for next commands -path=${path%/} +#path=${path%/} # Generate random DES key & password From 76e5f4e75273cea9e30aa197067610ca21e72d15 Mon Sep 17 00:00:00 2001 From: titoko Date: Fri, 29 Nov 2013 20:25:13 +0100 Subject: [PATCH 08/15] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 04866c4..febf1af 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ exit 1 fi # Remove trailing "/" for next commands -#path=${path%/} +path=${path%/} # Generate random DES key & password From 8f809495251ba1288457ce491c2475d66a599ac8 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:22:57 +0100 Subject: [PATCH 09/15] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 79c5fb2..ba7717a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location PATHTOCHANGE/ { +location PATHTOCHANGE { alias ALIASTOCHANGE ; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; From 222486cd715f07f905454ee413fe060b18935a34 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:28:16 +0100 Subject: [PATCH 10/15] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ba7717a..79c5fb2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location PATHTOCHANGE { +location PATHTOCHANGE/ { alias ALIASTOCHANGE ; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; From e48976f4717bc749143d54f2e9c2e29d80f63dbf Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:28:42 +0100 Subject: [PATCH 11/15] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 79c5fb2..ba7717a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location PATHTOCHANGE/ { +location PATHTOCHANGE { alias ALIASTOCHANGE ; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; From 4dccc55487cb7e078cfd6d7f57a14d25fa830fb9 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:32:17 +0100 Subject: [PATCH 12/15] Update install --- scripts/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index febf1af..800bd06 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,10 @@ fi # Remove trailing "/" for next commands path=${path%/} +if [ -z "$path" ]; then + path="/" +fi + # Generate random DES key & password deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') From 474077f8b2772fac465f0e041495495f6d964937 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:36:28 +0100 Subject: [PATCH 13/15] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 800bd06..51951c9 100644 --- a/scripts/install +++ b/scripts/install @@ -34,6 +34,7 @@ sudo chown -R www-data: $final_path # Modify Nginx configuration file and copy it to Nginx conf directory sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf +path=${path%/} sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jappix.conf sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/store/conf/main.xml From 86bab9db8d8165d49d3536a0672b13ff94ad1f64 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:45:28 +0100 Subject: [PATCH 14/15] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ba7717a..99ce424 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,7 +14,7 @@ location PATHTOCHANGE { fastcgi_param PATH_INFO $fastcgi_path_info; } } -location PATHTOCHANGE/http-bind { +location PATHTOCHANGE2/http-bind { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } From 8d77e85005ec6c9a78aee280650cf358f696acc3 Mon Sep 17 00:00:00 2001 From: titoko Date: Mon, 9 Dec 2013 16:46:25 +0100 Subject: [PATCH 15/15] Update install --- scripts/install | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 51951c9..6eee341 100644 --- a/scripts/install +++ b/scripts/install @@ -13,9 +13,7 @@ fi # Remove trailing "/" for next commands path=${path%/} -if [ -z "$path" ]; then - path="/" -fi + # Generate random DES key & password @@ -33,8 +31,13 @@ db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' sudo chown -R www-data: $final_path # Modify Nginx configuration file and copy it to Nginx conf directory +sudo sed -i "s@PATHTOCHANGE2@$path@g" ../conf/nginx.conf + +if [ -z "$path" ]; then + path="/" +fi + sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf -path=${path%/} sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jappix.conf sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/store/conf/main.xml