From 2c6a89f0682f8dd51894f402ca5866cc71ddccdb Mon Sep 17 00:00:00 2001 From: Kload Date: Sun, 20 Apr 2014 19:42:44 +0200 Subject: [PATCH] [fix] Nginx default_type directive + sed commands with paths --- conf/nginx.conf | 1 + scripts/install | 8 ++++---- scripts/upgrade | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9df087e..68c4cec 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,6 +1,7 @@ location PATHTOCHANGE { alias ALIASTOCHANGE; index index.php index.html index.htm; + default_type text/html; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm.sock; diff --git a/scripts/install b/scripts/install index 1d0c315..6591516 100644 --- a/scripts/install +++ b/scripts/install @@ -34,10 +34,10 @@ sudo yunohost firewall allow TCP 21 > /dev/null 2>&1 sudo apt-get install pure-ftpd-ldap -y -qq # Change user ID in configurations -sed -i "s/FTPUSER/$user/g" ../conf/ldap.conf -sed -i "s/FTPDIR/$final_path/g" ../conf/ldap.conf -sed -i "s/FTPUSER/$user/g" ../sources/index.html -sed -i "s/HOST/$domain/g" ../sources/index.html +sed -i "s@FTPUSER@$user@g" ../conf/ldap.conf +sed -i "s@FTPDIR@$final_path@g" ../conf/ldap.conf +sed -i "s@FTPUSER@$user@g" ../sources/index.html +sed -i "s@HOST@$domain@g" ../sources/index.html # Copy files to the right place sudo mkdir -p $final_path diff --git a/scripts/upgrade b/scripts/upgrade index a457f9f..d6bea89 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,8 +8,8 @@ is_public=$(sudo yunohost app setting my_webapp is_public) final_path=/var/www/my_webapp # Change user ID in configurations -sed -i "s/FTPUSER/$user/g" ../conf/ldap.conf -sed -i "s/FTPDIR/$final_path/g" ../conf/ldap.conf +sed -i "s@FTPUSER@$user@g" ../conf/ldap.conf +sed -i "s@FTPDIR@$final_path@g" ../conf/ldap.conf # Modify Nginx configuration file and copy it to Nginx conf directory sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf