Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| linux:apache [26-10-2017 20:17] – [Tester les performances] edmc73 | linux:apache [03-07-2025 14:42] (Version actuelle) – [htcacheclean] edmc73 | ||
|---|---|---|---|
| Ligne 213: | Ligne 213: | ||
| par | par | ||
| create 644 root adm | create 644 root adm | ||
| + | |||
| + | |||
| + | ==== internal dummy connection ==== | ||
| + | |||
| + | --- source: https:// | ||
| + | |||
| + | Si vous avez plein de log apache avec des lignes **internal dummy connection**, | ||
| + | |||
| + | # Filters | ||
| + | SetEnvIf Remote_Addr " | ||
| + | SetEnvIf Remote_Addr " | ||
| + | |||
| + | Ensuite, on doit activer ce filtre le fichier de définition de votre site (sous le répertoire / | ||
| + | CustomLog / | ||
| + | |||
| + | Un restart d' | ||
| | | ||
| ===== Lorsque Apache est installé dans un NAT à travers d'un reverse proxy ===== | ===== Lorsque Apache est installé dans un NAT à travers d'un reverse proxy ===== | ||
| Ligne 358: | Ligne 374: | ||
| Comparer les logs | Comparer les logs | ||
| + | |||
| + | |||
| + | ===== Debian 10 Apache 2.4 php7.3 ===== | ||
| + | |||
| + | Sur la dernière debian, apache est par défaut apache mpm event. | ||
| + | Plus question ici d' | ||
| + | |||
| + | apt install php7.3-fpm | ||
| + | a2enmod proxy_fcgi | ||
| + | a2enconf php7.3-fpm | ||
| + | systemctl restart apache | ||
| + | |||
| + | le module itk n'est plus nécessaire, | ||
| + | |||
| + | => doc: https:// | ||
| + | |||
| + | < | ||
| + | # cd / | ||
| + | # ls | ||
| + | www.conf | ||
| + | |||
| + | cp www.conf dev.conf | ||
| + | vi dev.conf | ||
| + | |||
| + | </ | ||
| + | |||
| + | On modifie au minimum | ||
| + | < | ||
| + | ; Start a new pool named ' | ||
| + | ; the variable $pool can be used in any directive and will be replaced by the | ||
| + | ; pool name (' | ||
| + | [dev] | ||
| + | |||
| + | ; Unix user/group of processes | ||
| + | ; Note: The user is mandatory. If the group is not set, the default user's group | ||
| + | ; will be used. | ||
| + | user = edmc | ||
| + | group = edmc | ||
| + | |||
| + | ; The address on which to accept FastCGI requests. | ||
| + | ; Valid syntaxes are: | ||
| + | ; ' | ||
| + | ; a specific port; | ||
| + | ; ' | ||
| + | ; a specific port; | ||
| + | ; ' | ||
| + | ; (IPv6 and IPv4-mapped) on a specific port; | ||
| + | ; '/ | ||
| + | ; Note: This value is mandatory. | ||
| + | listen = / | ||
| + | </ | ||
| + | |||
| + | ensuite on adapte notre config apache | ||
| + | < | ||
| + | < | ||
| + | SetHandler " | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | on restart php et apache | ||
| + | systemctl restart php7.3-fpm.service apache2.service | ||
| + | |||
| + | et voila :) | ||
| + | |||
| + | ===== htcacheclean ===== | ||
| + | |||
| + | Activez les modules | ||
| + | a2enmod mod_cache mod_cache_disk | ||
| + | |||
| + | Dans la config du site, pour un cache de 60 secondes | ||
| + | <code apache> | ||
| + | < | ||
| + | < | ||
| + | #LogLevel debug | ||
| + | CacheRoot / | ||
| + | CacheDefaultExpire 60 | ||
| + | CacheMinExpire 60 | ||
| + | CacheMaxExpire 60 | ||
| + | CacheEnable disk / | ||
| + | # | ||
| + | CacheHeader On | ||
| + | CacheIgnoreCacheControl On | ||
| + | CacheIgnoreNoLastMod On | ||
| + | CacheStoreNoStore On | ||
| + | CacheStoreExpired On | ||
| + | # | ||
| + | # | ||
| + | #UnsetEnv no-cache | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Voir les fichiers en cache | ||
| + | htcacheclean -A -p/ | ||
| + | |||
| + | Si vous avez configuré un autre répertoire que celui par défaut, la purge ne se fera pas, mettez un cron | ||
| + | 0 */2 * * * / | ||
| + | |||
| + | Cette exemple purge toutes les 2 heures en vérifiant que la taille globale ne dépasse pas 100Mo, '' | ||
| + | |||
| + | ===== Restriction par ip ===== | ||
| + | |||
| + | Avant apache 2.4 c' | ||
| + | < | ||
| + | < | ||
| + | Order deny,allow | ||
| + | Deny from all | ||
| + | Allow from 14.14.14.14, | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Depuis Apache 2.4 c'est ça | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | |||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||