Table des matières

Apache


Services réseaux

Méthode2 avec Apache2


Installation du serveur Apache

pkg_add -v apache-httpd-2.4.41
rcctl enable apache2
rcctl start apache2

Installation du module apache pour la liaison php

pkg_add -v php-apache-7.3.11

Création du lien symbolique pour lier le module PHP à Apache

ln -s /var/www/conf/modules.sample/php-7.3.conf /var/www/conf/modules/

Modification de la configuration Apache

vi /etc/apache2/httpd2.conf

LoadModule proxy_module /usr/local/lib/apache2/mod_proxy.so
LoadModule proxy_fcgi_module /usr/local/lib/apache2/mod_proxy_fcgi.so
LoadModule rewrite_module /usr/local/lib/apache2/mod_rewrite.so

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Redémarrage du php73_fpm service et apache2

rcctl restart php73_fpm && rcctl restart apache2

Création d'un fichier info.php pour test

vi /var/www/htdocs/mon_super_site/info.php
<?php phpinfo(); ?>

PHP fonctionne alors que le serveur de base de donnée n'est pas installé et que les extensions de modules ne sont pas installé non plus !

;-)

Configuration de Apache2


httpd2.conf






Services réseaux