Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deb13:apache [2026/08/21 13:23] – [Upgrade Sury certificates] Bernard Condraudeb13:apache [2026/11/15 09:03] (current) – [PHP Extensions] Bernard Condrau
Line 12: Line 12:
   - If you are migrating from an old server, follow the [[deb11:migrate#apache_2.4|How to migrate a (web) server]] guide   - If you are migrating from an old server, follow the [[deb11:migrate#apache_2.4|How to migrate a (web) server]] guide
   - Run ''apachectl configtest'' before reloading apache   - Run ''apachectl configtest'' before reloading apache
 +
 ===== Apache Settings ===== ===== Apache Settings =====
 +==== Basic configuration for your web root ====
 +  * Add your custom configuration file ''/etc/apache2/conf-available/my-webspace'':<code># grant access to bco's web space
 +# * this is a proxied server, check access rules on proxy
 +# * black list is created by bethico.com
 +# (c) bco, 2021-09-26
 +<Directory /home/bco/www/>
 + Options -Indexes +FollowSymLinks
 + AllowOverride None
 +
 + <RequireAll>
 +
 + # allow access
 + Require all granted
 +
 + # block ip addresses
 + Include /home/bco/www/ipblacklist.conf
 + </RequireAll>
 +
 + # block spiders
 + Include conf-available/bco-spiders.conf
 +</Directory>
 +
 +ErrorDocument 403 "<h1>Unusual activity has been detected from this IP address.</h1><p>You don't have permission to access this resource.<br>If you belive this is a mistake please <a href='https://www.condrau.com'>contact me</a>.</p>"
 +</code>
 +  * Enable the configuration:<code>sudo a2enconf my-webspace</code>
 +  * Check the configuration and fix errors if you have any:<code>sudo apache2ctl configtest</code>
 +  * Restart the web server:<code>sudo systemctl restart apache2</code>
  
 ==== Harden apache ==== ==== Harden apache ====
Line 46: Line 74:
  
 ===== PHP Extensions ===== ===== PHP Extensions =====
-  * PHP extensions for Joomla:<code>$ sudo apt install phpV.v-{bz2 curl gd mbstring mysql xml zip} phpV.v-{bcmath}</code> +  * PHP extensions for Joomla:<code>$ sudo apt install php- or phpV.v-{bz2 curl gd mbstring mysql xml zip} phpV.v-{bcmath intl}</code> 
-  * PHP extensions for Wiki:<code>$ sudo apt install phpV.v-{bz2 curl gd mbstring mysql xml zip} phpV.v-{sqlite3}</code> +  * PHP extensions for Wiki:<code>$ sudo apt install php- or phpV.v-{bz2 curl gd mbstring mysql xml zip json curl} phpV.v-{sqlite3}</code> 
-  * PHP extensions for phpMyAdmin:<code>$ sudo apt install phpV.v-mbstring</code> +  * PHP extensions for phpMyAdmin:<code>$ sudo apt install php- or phpV.v-{mbstring json curl}</code> 
-  * PHP extensions for vps:<code>$ sudo apt install phpV.v-{curl xml zip}</code> +  * PHP extensions for vps:<code>$ sudo apt install php- or phpV.v-{curl xml zip}</code> 
-  * Required for PHP7:<code>$ sudo apt install phpV.v-json</code> +  * Restart the service:<code>$ sudo systemctl restart apache2</code>
-  * Restart the service with one of the 2 commands below:<code>$ sudo systemctl restart apache2 +
-$ sudo service apache2 restart</code>+
  
 ===== Set or change PHP version ===== ===== Set or change PHP version =====
Line 72: Line 98:
   * Refresh your package manager:<code>sudo apt update</code>   * Refresh your package manager:<code>sudo apt update</code>
   * Update to the fresh key:<code>curl -sS https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sury-keyring.gpg >/dev/null</code>   * Update to the fresh key:<code>curl -sS https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sury-keyring.gpg >/dev/null</code>
-  * Create the apt list file:<code>echo "deb [signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/php/ <bullseye|bookworm|trixie> main" | sudo tee /etc/apt/sources.list.d/php.list</code>+  * Create the apt list file (debian 11=bullseye, 12=bookworm, 13=trixie):<code>echo "deb [signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/php/ <bullseye|bookworm|trixie> main" | sudo tee /etc/apt/sources.list.d/php.list</code>
 ===== PHP Settings ===== ===== PHP Settings =====
  
Line 80: Line 106:
  
 ==== php.ini ==== ==== php.ini ====
-  * <code>max_execution_time = 120+  * <code>max_execution_time = 300
 max_input_vars = 2000 max_input_vars = 2000
 memory_limit = 512M memory_limit = 512M