This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
informatica:servidor_internet_2009_debian_10_part_3 [2022/08/09 16:41] miquel created |
informatica:servidor_internet_2009_debian_10_part_3 [2022/08/10 14:43] (current) miquel [[CANCEL·LADA] Configuració d'Apache amb PHP-FPM] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Servidor web/dades ====== | ||
+ | |||
===== Actualització a Debian 10.12 " | ===== Actualització a Debian 10.12 " | ||
Line 5: | Line 7: | ||
Aquesta pàgina conté la tercera part de la descripció detallada del procés d' | Aquesta pàgina conté la tercera part de la descripció detallada del procés d' | ||
+ | |||
+ | ==== [PENDENT] Install phpmyadmin ==== | ||
+ | |||
+ | <WRAP important> | ||
+ | La instal·lació de phpmyadmin no s'ha pogut completar perquè requereix PHP-7, però mentre no actualitzi el servidor de reserves, hem de mantenir la versió PHP-5. | ||
+ | </ | ||
+ | |||
+ | |||
+ | < | ||
+ | # apt install -f phpmyadmin | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | Some packages could not be installed. This may mean that you have | ||
+ | requested an impossible situation or if you are using the unstable | ||
+ | distribution that some required packages have not yet been created | ||
+ | or been moved out of Incoming. | ||
+ | The following information may help to resolve the situation: | ||
+ | | ||
+ | The following packages have unmet dependencies: | ||
+ | | ||
+ | E: Unable to correct problems, you have held broken packages. | ||
+ | |||
+ | # apt-cache madison php-twig | ||
+ | php-twig | 2.14.3-1~bpo10+1 | http:// | ||
+ | php-twig | 2.6.2-2 | http:// | ||
+ | twig | 2.6.2-2 | http:// | ||
+ | php-twig | 2.14.3-1~bpo10+1 | http:// | ||
+ | root@sermnserver:/ | ||
+ | phpmyadmin | 4: | ||
+ | phpmyadmin | 4: | ||
+ | |||
+ | # apt install php-twig/ | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | Selected version ' | ||
+ | The following package was automatically installed and is no longer required: | ||
+ | php7.3-mysql | ||
+ | Use 'apt autoremove' | ||
+ | Suggested packages: | ||
+ | php-twig-doc | ||
+ | The following NEW packages will be installed: | ||
+ | php-twig | ||
+ | 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. | ||
+ | Need to get 121 kB of archives. | ||
+ | After this operation, 906 kB of additional disk space will be used. | ||
+ | Get:1 http:// | ||
+ | Fetched 121 kB in 1s (220 kB/s) | ||
+ | Selecting previously unselected package php-twig. | ||
+ | (Reading database ... 220929 files and directories currently installed.) | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking php-twig (2.14.3-1~bpo10+1) ... | ||
+ | Setting up php-twig (2.14.3-1~bpo10+1) ... | ||
+ | |||
+ | # apt autoremove | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following packages will be REMOVED: | ||
+ | php7.3-mysql | ||
+ | 0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded. | ||
+ | After this operation, 458 kB disk space will be freed. | ||
+ | Do you want to continue? [Y/n] | ||
+ | (Reading database ... 221331 files and directories currently installed.) | ||
+ | Removing php7.3-mysql (7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4) ... | ||
+ | Processing triggers for libapache2-mod-php7.3 (7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4) ... | ||
+ | root@sermnserver:/ | ||
+ | PHP 5.6.40-60+0~20220627.67+debian10~1.gbp1f7ffd (cli) | ||
+ | Copyright (c) 1997-2016 The PHP Group | ||
+ | Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies | ||
+ | with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies | ||
+ | |||
+ | # apt install -f phpmyadmin | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following packages were automatically installed and are no longer required: | ||
+ | php-gettext php-php-gettext | ||
+ | Use 'apt autoremove' | ||
+ | The following additional packages will be installed: | ||
+ | libc-ares2 libjs-bootstrap4 libjs-codemirror libjs-jquery-mousewheel libjs-jquery-timepicker libjs-openlayers libjs-popper.js libnode64 libuv1 node-jquery nodejs nodejs-doc php-apcu p | ||
+ | hp-google-recaptcha | ||
+ | php-mariadb-mysql-kbs php-phpmyadmin-motranslator php-phpmyadmin-shapefile php-phpmyadmin-sql-parser php-psr-cache php-psr-container php-psr-log php-psr-simple-cache php-symfony-cache | ||
+ | | ||
+ | php-symfony-dependency-injection php-symfony-expression-language php-symfony-filesystem php-symfony-yaml php-twig-i18n-extension php8.1-apcu | ||
+ | Suggested packages: | ||
+ | libjs-requirejs npm php-dbase php-symfony-finder php-symfony-proxy-manager-bridge php-symfony-console php-recode php-gd2 php-pragmarx-google2fa-qrcode php-samyoul-u2f-php-server | ||
+ | The following NEW packages will be installed: | ||
+ | libc-ares2 libjs-bootstrap4 libjs-codemirror libjs-jquery-mousewheel libjs-jquery-timepicker libjs-openlayers libjs-popper.js libnode64 libuv1 node-jquery nodejs nodejs-doc php-apcu p | ||
+ | hp-google-recaptcha | ||
+ | php-mariadb-mysql-kbs php-phpmyadmin-motranslator php-phpmyadmin-shapefile php-phpmyadmin-sql-parser php-psr-cache php-psr-container php-psr-log php-psr-simple-cache php-symfony-cache | ||
+ | | ||
+ | php-symfony-dependency-injection php-symfony-expression-language php-symfony-filesystem php-symfony-yaml php-twig-i18n-extension php8.1-apcu | ||
+ | The following packages will be upgraded: | ||
+ | phpmyadmin | ||
+ | 1 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. | ||
+ | Need to get 14.8 MB of archives. | ||
+ | After this operation, 60.9 MB of additional disk space will be used. | ||
+ | Do you want to continue? [Y/n] | ||
+ | Get:1 https:// | ||
+ | Get:2 http:// | ||
+ | Get:3 https:// | ||
+ | ... | ||
+ | Get:30 http:// | ||
+ | Get:31 http:// | ||
+ | Fetched 14.8 MB in 4s (3,653 kB/s) | ||
+ | Reading changelogs... Done | ||
+ | apt-listchanges: | ||
+ | Extracting templates from packages: 100% | ||
+ | Preconfiguring packages ... | ||
+ | Determining localhost credentials from / | ||
+ | Selecting previously unselected package php8.1-apcu. | ||
+ | (Reading database ... 221319 files and directories currently installed.) | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking php8.1-apcu (5.1.21+4.0.11-8+0~20220625.32+debian10~1.gbpa7cde5) ... | ||
+ | Selecting previously unselected package php-apcu. | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking php-apcu (5.1.21+4.0.11-8+0~20220625.32+debian10~1.gbpa7cde5) ... | ||
+ | ... | ||
+ | Setting up php-phpmyadmin-motranslator (5.2.0-1~bpo10+1) ... | ||
+ | Setting up phpmyadmin (4: | ||
+ | |||
+ | Configuration file '/ | ||
+ | | ||
+ | | ||
+ | What would you like to do about it ? Your options are: | ||
+ | Y or I : install the package maintainer' | ||
+ | N or O : keep your currently-installed version | ||
+ | D : show the differences between the versions | ||
+ | Z : start a shell to examine the situation | ||
+ | The default action is to keep your current version. | ||
+ | *** apache.conf (Y/ | ||
+ | |||
+ | Configuration file '/ | ||
+ | | ||
+ | | ||
+ | What would you like to do about it ? Your options are: | ||
+ | Y or I : install the package maintainer' | ||
+ | N or O : keep your currently-installed version | ||
+ | D : show the differences between the versions | ||
+ | Z : start a shell to examine the situation | ||
+ | The default action is to keep your current version. | ||
+ | *** config.inc.php (Y/ | ||
+ | Installing new version of config file / | ||
+ | Determining localhost credentials from / | ||
+ | dbconfig-common: | ||
+ | creating database backup in / | ||
+ | applying upgrade sql for 4: | ||
+ | dbconfig-common: | ||
+ | The blowfish_secret configured in / | ||
+ | A backup of the file has been placed at / | ||
+ | The webbased installer was disabled on debian with phpmyadmin version 4.9.1. | ||
+ | An existing configuration was found under / | ||
+ | A backup of the file has been placed at / | ||
+ | apache2_invoke phpmyadmin: no action - configuration was disabled by local admin | ||
+ | Processing triggers for hicolor-icon-theme (0.17-2) ... | ||
+ | Processing triggers for doc-base (0.10.8) ... | ||
+ | Processing 1 changed doc-base file, 2 added doc-base files... | ||
+ | Registering documents with dwww... | ||
+ | Registering documents with scrollkeeper... | ||
+ | Processing triggers for libc-bin (2.28-10+deb10u1) ... | ||
+ | Processing triggers for man-db (2.8.5-2) ... | ||
+ | Processing triggers for php8.1-cli (8.1.8-1+0~20220711.23+debian10~1.gbp5e9cbc) ... | ||
+ | Processing triggers for libapache2-mod-php8.1 (8.1.8-1+0~20220711.23+debian10~1.gbp5e9cbc) ... | ||
+ | </ | ||
+ | |||
+ | però quan intento accedir a PHPMyAdmin em surt el missatge d' | ||
+ | |||
+ | * PHP 7.1.3+ is required.\\ Currently installed version is: 5.6.40-60+0~20220627.67+debian10~1.gbp1f7ffd | ||
+ | |||
+ | de forma que hauré de configurar Apache amb PHP-FPM perquè faci servir diferents versions de PHP en funció de quina aplicació web es visiti, | ||
+ | |||
+ | |||
+ | |||
+ | ==== [CANCEL·LADA] Configuració d' | ||
+ | |||
+ | Comprovo quines versions de PHP hi ha instal·lades, | ||
+ | |||
+ | < | ||
+ | # ls -l /etc/php/ | ||
+ | total 16 | ||
+ | drwxr-xr-x 5 root root 4096 Aug 5 16:04 5.6 | ||
+ | drwxr-xr-x 5 root root 4096 Aug 4 22:24 7.0 | ||
+ | drwxr-xr-x 5 root root 4096 Aug 5 13:05 7.3 | ||
+ | drwxr-xr-x 5 root root 4096 Aug 5 15:47 8.1 | ||
+ | </ | ||
+ | |||
+ | i desinstal·lo la versió 7.0 perquè ja hi ha instal·lada una versió de PHP 7 més actual, | ||
+ | |||
+ | < | ||
+ | # apt remove php7.0 | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following packages will be REMOVED: | ||
+ | php7.0 | ||
+ | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | ||
+ | After this operation, 87.0 kB disk space will be freed. | ||
+ | Do you want to continue? [Y/n] | ||
+ | (Reading database ... 226316 files and directories currently installed.) | ||
+ | Removing php7.0 (7.0.33-60+0~20220627.68+debian10~1.gbp3d361a) ... | ||
+ | |||
+ | # apt remove php7.0-* | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | Note, selecting ' | ||
+ | Note, selecting ' | ||
+ | Note, selecting ' | ||
+ | ... | ||
+ | Package ' | ||
+ | Package ' | ||
+ | The following packages will be REMOVED: | ||
+ | libapache2-mod-php7.0 php7.0-bz2 php7.0-cli php7.0-common php7.0-gd php7.0-json php7.0-mbstring php7.0-opcache php7.0-pgsql php7.0-readline php7.0-xml php7.0-zip | ||
+ | 0 upgraded, 0 newly installed, 12 to remove and 0 not upgraded. | ||
+ | After this operation, 16.5 MB disk space will be freed. | ||
+ | Do you want to continue? [Y/n] Y | ||
+ | (Reading database ... 226309 files and directories currently installed.) | ||
+ | Removing libapache2-mod-php7.0 (7.0.33-60+0~20220627.68+debian10~1.gbp3d361a) ... | ||
+ | apache2_invoke php7.0 prerm: No action required | ||
+ | Removing php7.0-bz2 (7.0.33-60+0~20220627.68+debian10~1.gbp3d361a) ... | ||
+ | ... | ||
+ | Removing php7.0-readline (7.0.33-60+0~20220627.68+debian10~1.gbp3d361a) ... | ||
+ | Removing php7.0-common (7.0.33-60+0~20220627.68+debian10~1.gbp3d361a) ... | ||
+ | Processing triggers for man-db (2.8.5-2) ... | ||
+ | |||
+ | # apt list --installed | grep ^php7\.0 | ||
+ | |||
+ | WARNING: apt does not have a stable CLI interface. Use with caution in scripts. | ||
+ | </ | ||
+ | |||
+ | Llavors instal·lo els paquets, | ||
+ | |||
+ | * php5.6-fpm | ||
+ | * libapache2-mod-php5.6 | ||
+ | * php7.3-fpm | ||
+ | * libapache2-mod-php7.3 | ||
+ | * libapache2-mod-fcgid | ||
+ | |||
+ | però al final aquesta solució no em serveix perquè només funciona amb diferents hosts-virtuals, | ||
+ | |||
+ | < | ||
+ | # apt remove php5.6-fpm php7.3-fpm libapache2-mod-fcgid | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following packages will be REMOVED: | ||
+ | libapache2-mod-fcgid php5.6-fpm php7.3-fpm | ||
+ | ... | ||
+ | Registering documents with scrollkeeper... | ||
+ | </ | ||
+ | |||
+ | i comprovo que els corresponents serveis s' | ||
+ | |||
+ | < | ||
+ | # systemctl status php5.6-fpm | ||
+ | ? php5.6-fpm.service | ||
+ | | ||
+ | | ||
+ | Main PID: 27345 (code=exited, | ||
+ | | ||
+ | |||
+ | Aug 07 17:20:58 sermnserver systemd[1]: Starting The PHP 5.6 FastCGI Process Manager... | ||
+ | Aug 07 17:20:58 sermnserver systemd[1]: Started The PHP 5.6 FastCGI Process Manager. | ||
+ | Aug 07 18:36:08 sermnserver systemd[1]: Stopping The PHP 5.6 FastCGI Process Manager... | ||
+ | Aug 07 18:36:08 sermnserver systemd[1]: php5.6-fpm.service: | ||
+ | Aug 07 18:36:08 sermnserver systemd[1]: Stopped The PHP 5.6 FastCGI Process Manager. | ||
+ | |||
+ | # systemctl status php7.3-fpm | ||
+ | ? php7.3-fpm.service | ||
+ | | ||
+ | | ||
+ | Main PID: 27268 (code=exited, | ||
+ | | ||
+ | |||
+ | Aug 07 17:20:56 sermnserver systemd[1]: Starting The PHP 7.3 FastCGI Process Manager... | ||
+ | Aug 07 17:20:56 sermnserver systemd[1]: Started The PHP 7.3 FastCGI Process Manager. | ||
+ | Aug 07 18:36:16 sermnserver systemd[1]: Stopping The PHP 7.3 FastCGI Process Manager... | ||
+ | Aug 07 18:36:17 sermnserver systemd[1]: php7.3-fpm.service: | ||
+ | Aug 07 18:36:17 sermnserver systemd[1]: Stopped The PHP 7.3 FastCGI Process Manager. | ||
+ | </ | ||
+ | |||
+ | Tot seguit desactivo altres mòduls d' | ||
+ | |||
+ | < | ||
+ | # a2dismod actions fcgid proxy_fcgi | ||
+ | Module actions already disabled | ||
+ | Module fcgid already disabled | ||
+ | Module proxy_fcgi disabled. | ||
+ | To activate the new configuration, | ||
+ | systemctl restart apache2 | ||
+ | </ | ||
+ | |||
+ | Finalment, reinicio Apache per aplicar els canvis: | ||
+ | |||
+ | < | ||
+ | # apache2ctl configtest | ||
+ | Syntax OK | ||
+ | # systemctl restart apache2 | ||
+ | </ | ||
+ | |||
+ | <WRAP box > | ||
+ | **Continuació: | ||
+ | </ |