1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yourls_ynh.git synced 2024-09-03 20:35:59 +02:00

fix installation on subdomain root

This commit is contained in:
Julien Malik 2014-07-03 12:26:56 +02:00
parent ed3203a78f
commit d532eb3de9
2 changed files with 5 additions and 7 deletions

View file

@ -1,5 +1,5 @@
location PATHTOCHANGE { location LOCATIONTOCHANGE {
alias ALIASTOCHANGE; alias ALIASTOCHANGE/;
try_files $uri $uri/ PATHTOCHANGE/yourls-loader.php; try_files $uri $uri/ PATHTOCHANGE/yourls-loader.php;

View file

@ -18,9 +18,6 @@ if [[ ! $? -eq 0 ]]; then
exit 1 exit 1
fi fi
# Remove trailing "/" for next commands
path=${path%/}
# Generate random password # Generate random password
db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
@ -54,7 +51,8 @@ sudo sed -i "s/_yourlspath$path/g" $final_path/user/config.php
sudo chown -R www-data: $final_path sudo chown -R www-data: $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf* sed -i "s@LOCATIONTOCHANGE@$path@g" ../conf/nginx.conf*
sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf*
sed -i "s@DOMAINTOCHANGE@$domain@g" ../conf/nginx.conf* sed -i "s@DOMAINTOCHANGE@$domain@g" ../conf/nginx.conf*
sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/nginx.conf* sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/nginx.conf*
nginxconf=/etc/nginx/conf.d/$domain.d/yourls.conf nginxconf=/etc/nginx/conf.d/$domain.d/yourls.conf