* Conoscenza del computer >> sistemi >  >> Windows 11

Come installare APXS (apxs) su CentOS per compilare moduli Apache

apxs (APache eXtenSion tool) serve per compilare e installare moduli Apache (es. mod_security, mod_pagespeed, PHP come modulo). Su CentOS/RHEL/Rocky/AlmaLinux è nel pacchetto httpd-devel.

Installazione rapida (CentOS 7/8/9, Rocky, Alma)

  1. Apri terminale come root o usa sudo.
  2. Esegui:
    dnf install httpd-devel (CentOS 8/9, Rocky, Alma)
    yum install httpd-devel (CentOS 7)
  3. Verifica: which apxs → /usr/bin/apxs (o /usr/sbin/apxs).

Se serve anche PHP development headers (per mod_php)

dnf install php-devel (o yum install php-devel)

Esempio: compilare un modulo custom

cd /path/to/modulo.c
apxs -cia modulo.c
  • -c compila
  • -i installa in /usr/lib64/httpd/modules/
  • -a aggiunge LoadModule in httpd.conf

Riavvia Apache

systemctl restart httpd

Nota: su CentOS 7 httpd è 2.4.6. Su CentOS 9 Stream / Rocky 9 / Alma 9 è 2.4.53+. I moduli vanno ricompilati per la versione Apache corrispondente.

Windows 11