From 4159990552686e1e898399cd6c3b6f31d492ade8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 14:14:02 +0200 Subject: [PATCH 1/4] fix --- scripts/_common.sh | 3 +++ scripts/install | 2 +- scripts/remove | 5 +++-- scripts/upgrade | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d7614e9..2b57d2e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,9 @@ YNH_PHP_VERSION="7.3" +extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-zip" + + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 86acc5a..047ccde 100644 --- a/scripts/install +++ b/scripts/install @@ -91,7 +91,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/remove b/scripts/remove index 4c4125f..45696e1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -49,8 +49,9 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=3 -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index bd3ac8e..3ddc979 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,7 +103,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE From 3c4137773b7162d7b864b532b97fcdf3a92ebb17 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 14:15:21 +0200 Subject: [PATCH 2/4] Update nginx.conf --- conf/nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index cfdefca..b0510c7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,6 +10,9 @@ location __PATH__/ { } index index.php; + if (!-e $request_filename) { + rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last; + } try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { From 0b100eb229f645566061c825e5ce9989579ff33b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 16:06:38 +0200 Subject: [PATCH 3/4] fix --- conf/nginx.conf | 3 ++- conf/settings.php | 3 ++- scripts/install | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index b0510c7..ab36d3b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,8 +10,9 @@ location __PATH__/ { } index index.php; + if (!-e $request_filename) { - rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last; + rewrite ^__PATH__/(.*)$ __PATH__/index.php?q=$1 last; } try_files $uri $uri/ index.php; diff --git a/conf/settings.php b/conf/settings.php index 90e118e..d1a9230 100644 --- a/conf/settings.php +++ b/conf/settings.php @@ -13,7 +13,8 @@ * https://api.backdropcms.org/database-configuration */ $database = 'mysql://__DBNAME__:__DBPWD__@localhost/__DBNAME__'; - $database_prefix = ''; + $database_prefix = '__DBNAME___'; + $database_charset = 'utf8mb4'; /** * Site configuration files location. diff --git a/scripts/install b/scripts/install index 047ccde..9906bb0 100644 --- a/scripts/install +++ b/scripts/install @@ -117,8 +117,8 @@ ynh_store_file_checksum --file="$final_path/settings.php" #================================================= # Set permissions to app files -chown -R root: $final_path -chown -R $app:www-data $final_path/files +chown -R $app:www-data $final_path +#chown -R $app:www-data $final_path/files chmod -R 770 $final_path/files #================================================= From adf0a1cf200fa80718d894314a3ac1232f317b6b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 18 Oct 2020 17:44:03 +0200 Subject: [PATCH 4/4] [fix]