Browse Source

[fix] Nginx default_type directive + sed commands with paths

pull/1/head
Kload 12 years ago
parent
commit
2c6a89f068
  1. 1
      conf/nginx.conf
  2. 8
      scripts/install
  3. 4
      scripts/upgrade

1
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;

8
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

4
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

Loading…
Cancel
Save