aboutsummaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorDavi Antônio da Silva Santos <antoniossdavi@gmail.com>2023-03-02 18:42:50 +0000
committerDavi Antônio da Silva Santos <antoniossdavi@gmail.com>2023-03-04 01:24:15 +0000
commitedee1c1af975e885903d2207f657c36275c2e220 (patch)
treeb5add13d2997767c2c15bddfc096cdac433db3a7 /debian
parent6695d2384069b7016398b2a55fc6962b1d8e6985 (diff)
downloadboca-edee1c1af975e885903d2207f657c36275c2e220.tar.gz
boca-edee1c1af975e885903d2207f657c36275c2e220.zip
Migrate dependencies and maintainer scripts to PHP 8.1
The dependencies on PHP packages have been explicitly set to use PHP version 8.1. The boca-web post installation maintainer script has been updated with extra descriptions and a the required steps to migrate from PHP 7.4.
Diffstat (limited to 'debian')
-rw-r--r--debian/boca-web.postinst36
-rw-r--r--debian/control4
2 files changed, 30 insertions, 10 deletions
diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst
index 108693e..bcfce75 100644
--- a/debian/boca-web.postinst
+++ b/debian/boca-web.postinst
@@ -6,19 +6,39 @@ set -e
chown -R www-data:www-data /var/www/boca
chmod -R go-rwx /var/www/boca/src/private
+# Stop the apache2 server before changing enabled modules
+systemctl stop apache2
+
+# Ensure that apache's embedded php module is not loaded
+a2dismod php8.1
+
+# Enable apache's shared object cache provider that uses a high-performance
+# cyclic buffer inside a shared memory segment
+# See https://httpd.apache.org/docs/2.4/socache.html
a2enmod socache_shmcb
-a2enmod proxy_fcgi
-# Make sure embedded apache php module is not loaded
-a2dismod php7.4 || true
+# Recommended setup before enabling the php-fpm with apache httpd 2.4: enable
+# fast CGI and set its environment variables
+# Older tutorials recommended disabling the mpm_prefork module and enabling the
+# mpm_event one before setting Fast CGI up, e.g.
+# https://askubuntu.com/questions/1319861/how-to-configure-apache-http-to-php-fpm-on-ubuntu-20-10
+# Fortunately, Apache HTTPD version 2.4 already enables the mpm_event by default
+# according the project's documentation
+# https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM
+a2enmod proxy_fcgi setenvif
+
+# Enable php-fpm module for apache
+a2enconf php8.1-fpm
-#enable php fpm instead
-a2enconf php7.4-fpm
+# Check the syntax of apache2's configuration file
+# This DOES NOT CATCH ALL ERRORS
+apache2ctl configtest
-service apache2 restart || true
+# Restart apache2 with the new configuration
+systemctl start apache2
-#remember to reset possible stored password from debconf
-db_reset boca-common/dbpassword || true
+# Remember to reset possible stored password from debconf
+db_reset boca-common/dbpassword
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
diff --git a/debian/control b/debian/control
index 3c8ae00..c7af64c 100644
--- a/debian/control
+++ b/debian/control
@@ -31,7 +31,7 @@ Description: BOCA - database
Package: boca-web
Architecture: all
-Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php-fpm, php
+Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php8.1-fpm, php8.1
Description: BOCA - WEB files
BOCA is a software created to control a contest with the ACM International
Collegiate Programming Contest rules. It has been developed in PHP and the
@@ -42,7 +42,7 @@ Description: BOCA - WEB files
Package: boca-common
Architecture: all
Pre-Depends: debconf, makepasswd, sharutils
-Depends: ${misc:Depends}, ${shlibs:Depends}, php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl
+Depends: ${misc:Depends}, ${shlibs:Depends}, php8.1-zip, wget, php8.1-cli, php8.1-pgsql, php8.1-gd, postgresql-client, php8.1-xml, openssl, libany-uri-escape-perl
Description: BOCA - Common files
BOCA is a software created to control a contest with the ACM International
Collegiate Programming Contest rules. It has been developed in PHP and the