This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| deb13:apache [2026/05/18 15:45] – created Bernard Condrau | deb13:apache [2026/11/15 09:03] (current) – [PHP Extensions] Bernard Condrau | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Apache 2.4 and PHP 8 ====== | + | ====== Apache 2.4 and PHP 8.4 ====== |
| + | add the following:< | ||
| + | SetEnvIfNoCase X-Forwarded-Proto https HTTPS=on</ | ||
| ===== Apache 2.4 Installation ===== | ===== Apache 2.4 Installation ===== | ||
| - Install apache 2.4< | - Install apache 2.4< | ||
| Line 9: | Line 11: | ||
| - Install and configure [[deb11: | - Install and configure [[deb11: | ||
| - If you are migrating from an old server, follow the [[deb11: | - If you are migrating from an old server, follow the [[deb11: | ||
| + | - Run '' | ||
| ===== Apache Settings ===== | ===== Apache Settings ===== | ||
| + | ==== Basic configuration for your web root ==== | ||
| + | * Add your custom configuration file ''/ | ||
| + | # * this is a proxied server, check access rules on proxy | ||
| + | # * black list is created by bethico.com | ||
| + | # (c) bco, 2021-09-26 | ||
| + | < | ||
| + | Options -Indexes +FollowSymLinks | ||
| + | AllowOverride None | ||
| + | |||
| + | < | ||
| + | |||
| + | # allow access | ||
| + | Require all granted | ||
| + | |||
| + | # block ip addresses | ||
| + | Include / | ||
| + | </ | ||
| + | |||
| + | # block spiders | ||
| + | Include conf-available/ | ||
| + | </ | ||
| + | |||
| + | ErrorDocument 403 "< | ||
| + | </ | ||
| + | * Enable the configuration:< | ||
| + | * Check the configuration and fix errors if you have any:< | ||
| + | * Restart the web server:< | ||
| ==== Harden apache ==== | ==== Harden apache ==== | ||
| Line 27: | Line 57: | ||
| ===== PHP Installation ===== | ===== PHP Installation ===== | ||
| - | - Install packages< | + | - Download the GPG key:< |
| - | $ sudo apt install -y curl wget gnupg2 ca-certificates lsb-release | + | $ sudo curl -sSLo / |
| - | - Add the SURY repository to your system< | + | - Add the repository to your sources< |
| - | - Import the repository key< | + | - Install the desired PHP version, where V is the major and v is the minor version number, for example |
| - | - Install the desired PHP version, where V is the major and v is the minor version number, for example | + | $ sudo apt install |
| - | $ sudo apt install | + | |
| - Enable modules:< | - Enable modules:< | ||
| $ sudo a2enmod proxy | $ sudo a2enmod proxy | ||
| Line 44: | Line 74: | ||
| ===== PHP Extensions ===== | ===== PHP Extensions ===== | ||
| - | * PHP extensions for Joomla:< | + | * PHP extensions for Joomla:< |
| - | * PHP extensions for Wiki:< | + | * PHP extensions for Wiki:< |
| - | * PHP extensions for phpMyAdmin:< | + | * PHP extensions for phpMyAdmin:< |
| - | * PHP extensions for vps:< | + | * PHP extensions for vps:< |
| - | * Required for PHP7:< | + | * Restart the service:< |
| - | * Restart the service | + | |
| - | $ sudo service apache2 restart</ | + | |
| ===== Set or change PHP version ===== | ===== Set or change PHP version ===== | ||
| Line 65: | Line 93: | ||
| * [[https:// | * [[https:// | ||
| + | ===== Upgrade Sury certificates ===== | ||
| + | * If the keyring file was installed via older legacy instructions:< | ||
| + | sudo rm -f / | ||
| + | * Refresh your package manager:< | ||
| + | * Update to the fresh key:< | ||
| + | * Create the apt list file (debian 11=bullseye, | ||
| ===== PHP Settings ===== | ===== PHP Settings ===== | ||
| Line 72: | Line 106: | ||
| ==== php.ini ==== | ==== php.ini ==== | ||
| - | * < | + | * < |
| max_input_vars = 2000 | max_input_vars = 2000 | ||
| memory_limit = 512M | memory_limit = 512M | ||