refs #1134 use php-fpm opengnsys
testing/og-dhcp-API/pipeline/head There was a failure building this commit Details

nginx_conf
Luis Gerardo Romero Garcia 2024-11-13 16:05:41 +01:00
parent 6afc14fb9a
commit dbd3f88101
2 changed files with 11 additions and 5 deletions

View File

@ -18,7 +18,7 @@ server {
# Bloque para manejar las solicitudes a index.php
location ~ ^/index.php(/|$) {
include fastcgi_params;
fastcgi_pass unix:/run/php/php__PHPVERSION__-fpm.sock; # Asegúrate de que esto sea correcto
fastcgi_pass unix:/run/php/php__PHPVERSION__-fpm-opengnsys.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;

View File

@ -432,14 +432,20 @@ modify_php_fpm_config() {
fi
php_fpm_conf_path="/etc/php/$php_version/fpm/pool.d/www.conf"
new_fpm_conf_path="/etc/php/$php_version/fpm/pool.d/ogdhcp.conf"
socket_path="/run/php/php$php_version-fpm-ogdhcp.sock"
new_fpm_conf_path="/etc/php/$php_version/fpm/pool.d/opengnsys.conf"
socket_path="/run/php/php$php_version-fpm-opengnsys.sock"
# Copiar el archivo www.conf a ogdhcp.conf
# Verificar si el archivo new_fpm_conf_path ya existe
if [[ -f "$new_fpm_conf_path" ]]; then
echo "El archivo $new_fpm_conf_path ya existe. No se realizarán modificaciones."
return
fi
# Copiar el archivo www.conf a opengnsys.conf
cp "$php_fpm_conf_path" "$new_fpm_conf_path"
# Modificar el archivo ogdhcp.conf
sed -i 's/\[www\]/[ogdhcp]/g' "$new_fpm_conf_path"
sed -i 's/\[www\]/[opengnsys]/g' "$new_fpm_conf_path"
sed -i 's/user = www-data/user = opengnsys/g' "$new_fpm_conf_path"
sed -i 's/group = www-data/group = opengnsys/g' "$new_fpm_conf_path"
sed -i "s|listen =.*|listen = $socket_path|g" "$new_fpm_conf_path"