Upload files to "Apache+PHP"

This commit is contained in:
2026-09-16 21:07:25 +02:00
parent 7891aa394d
commit c1f4a0b16e
3 changed files with 39 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
services:
apache:
image: httpd:2.4
container_name: apache2.4
command: >
sh -c "echo 'Include conf/extra/vhost.conf' >> /usr/local/apache2/conf/httpd.conf && httpd-foreground"
ports:
- "51180:80"
volumes:
- ./vhost.conf:/usr/local/apache2/conf/extra/vhost.conf
- ./html:/var/www/html
depends_on:
- php
php:
image: php:8.2-fpm
container_name: php8.2
volumes:
- ./html:/var/www/html
+2
View File
@@ -0,0 +1,2 @@
<?php
phpinfo();
+18
View File
@@ -0,0 +1,18 @@
# Délégation des fichiers .php à PHP-FPM via FastCGI
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
ServerName apache.php
<VirtualHost *:80>
DocumentRoot /var/www/html
DirectoryIndex index.php
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
# Transmet les requêtes .php au conteneur "php" sur le port 9000
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
</VirtualHost>