I have a matomo container running with php-fpm
# docker-compose.yml
version: "3"
services:
app:
container_name: matomo
image: matomo:fpm-alpine
restart: unless-stopped
volumes:
- matomo:/var/www/html
environment:
- MATOMO_DATABASE_HOST=host.docker.internal
- PHP_MEMORY_LIMIT=2048M
env_file:
- ./db.env
ports:
- "9000:9000"
volumes:
matomo:
I want my local apache server to connect to this container so I wrote this a vhost conf
<VirtualHost *:80>
ServerAlias myserver.com
ErrorLog ${APACHE_LOG_DIR}/myserver.com/error.log
CustomLog ${APACHE_LOG_DIR}/myserver.com/access.log combined
<FilesMatch \.php$>
SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>
</VirtualHost>
Then when I call myserver.com it returns the "It works!" page.
And if I specify index.php it returns a 404 error
$ curl http://myserver.com/index.php
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 (Debian) Server at myserver.com Port 80</address>
</body></html>
Apache log says
[Tue Mar 01 12:09:11.732291 2022] [php:error] [pid 22242] [client 127.0.0.1:42424] script '/var/www/html/index.php' not found or unable to stat