ConfWebServer

De InfoXelec
Aller à la navigation Aller à la recherche

Voici quelques configurations des serveurs Web

HTTPD ou Apache

Configuration d'un serveur HTTPD et de PHP 7.4 sur CentOS 7

<VirtualHost *:80>
    ServerName site74.centos

    DocumentRoot /var/www/html/site74

    DirectoryIndex index.php index.html
    RewriteEngine On
    <Directory /var/www/html/site74>
        AllowOverride All
        Options Indexes FollowSymLinks Multiviews
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/site74_error.log
    CustomLog /var/log/httpd/site74_access.log combined
</VirtualHost>

Configuration d'un serveur HTTPD et de PHP-FPM 7.4 sur CentOS 7

<VirtualHost *:80>
    ServerName site74.centos

    DocumentRoot /var/www/html/site74

    DirectoryIndex index.php index.html
    <FilesMatch \.php$>
        SetHandler proxy:fcgi://127.0.0.1:9074
    </FilesMatch>
    <Directory /var/www/html/site74>
        AllowOverride All
        Options -Indexes
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/site74_error.log
    CustomLog /var/log/httpd/site74_access.log combined
</VirtualHost>

Configuration d'un serveur HTTPD et de PHP-FPM 8.2 sur CentOS 7

<VirtualHost *:80>
    ServerName site82.centos

    DocumentRoot /var/www/html/site82/public

    DirectoryIndex index.php index.html
    <FilesMatch \.php$>
        SetHandler proxy:fcgi://127.0.0.1:9082
    </FilesMatch>
    <Directory /var/www/html/site82/public>
        AllowOverride All
        Options -Indexes
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/site82_error.log
    CustomLog /var/log/httpd/site82_access.log combined
</VirtualHost>