From d2605a927daad6c03d8ab67590604a907a945fd5 Mon Sep 17 00:00:00 2001 From: Anmol Date: Mon, 17 Jul 2017 01:26:40 +0530 Subject: [PATCH] typo in nginx.conf and updated restore script --- conf/nginx.conf | 6 +++++- scripts/restore | 56 ++++--------------------------------------------- 2 files changed, 9 insertions(+), 53 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3a3112e..c3ea210 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,6 +1,10 @@ location __PATH__ { alias __FINALPATH__/; + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + # Default indexes and catch-all index index.html index.php; try_files $uri $uri/ __PATH__/index.php?$args; @@ -24,7 +28,7 @@ location __PATH__ { # Execute and serve PHP files location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php5-fpm-my_webapp__11.sock; + fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; diff --git a/scripts/restore b/scripts/restore index 79cdbe1..f0c81f4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -55,6 +55,10 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "$final_path" +# Set permissions to app files (requires 774 for folder permissions) +#**********NEEDED TO BE CHECKED********* +sudo find $final_path -type f | xargs chmod 774 +sudo find $final_path -type d | xargs chmod 774 #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -67,59 +71,7 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql # RECREATE THE DEDICATED USER #================================================= -# Create the dedicated user (if not existing) -ynh_system_user_create $app -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -sudo chown -R root: $final_path - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" -ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= - -# Define and install dependencies -ynh_install_app_dependencies deb1 deb2 - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -sudo yunohost service add $app --log "/var/log/$app/APP.log" - -#================================================= -# RESTORE SYSTEMD -#================================================= - -ynh_restore_file "/etc/systemd/system/$app.service" -sudo systemctl enable $app.service - -#================================================= -# RESTORE THE CRON FILE -#================================================= - -ynh_restore_file "/etc/cron.d/$app" - -#================================================= -# BACKUP THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file "/etc/logrotate.d/$app" - -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #=================================================