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 [22-08-2019 22:38] – [En cas de piratage] edmc73 | linux:apache [03-07-2025 14:42] (Version actuelle) – [htcacheclean] edmc73 | ||
|---|---|---|---|
| Ligne 385: | Ligne 385: | ||
| a2enconf php7.3-fpm | a2enconf php7.3-fpm | ||
| systemctl restart apache | 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 | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | |||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||