I use a Docker image: https://github.com/docker-library/php/blob/fec7f537f049aafd2102202519c3ca9cb9576707/5.5/apache/Dockerfile
And i use it with docker-compose:
apache: build: ./site/docker/apachephp environment: - VIRTUAL_HOST=www.test.dev volumes: - ./site/code:/var/www/app expose: - "80" The code is a symfony app and uses symbolic link in the web folder, but for all assets in the symbolic links i get in the apache logs:
AH00037: Symbolic link not allowed or link target not accessible: /var/www/app/web/test
All other code runs fine.
I wonder if that Options +FollowSymLinks -SymLinksIfOwnerMatch is used correct and if there maybe other config files that override someting?
Or is it some Permission issue? The files on the host belong not to the apache user www-data but to another user, read rights are set however.
The Apache config is:
# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf Mutex file:/var/lock/apache2 default PidFile /var/run/apache2/apache2.pid Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 User www-data Group www-data HostnameLookups Off ErrorLog /proc/self/fd/2 LogLevel warn IncludeOptional mods-enabled/*.load IncludeOptional mods-enabled/*.conf # ports.conf Listen 80 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> <Directory /> AllowOverride None Require all denied </Directory> <Directory /var/www/app> Options +FollowSymLinks -SymLinksIfOwnerMatch AllowOverride All Require all granted </Directory> DocumentRoot /var/www/app/web AccessFileName .htaccess <FilesMatch "^\.ht"> Require all denied </FilesMatch> LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog /proc/self/fd/1 combined <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch> # Multiple DirectoryIndex directives within the same context will add # to the list of resources to look for rather than replace # https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex DirectoryIndex disabled DirectoryIndex app_dev.php index.php index.html IncludeOptional conf-enabled/*.conf IncludeOptional sites-enabled/*.conf
docker exec -ti <container name>to inspect the path inside the container and see what's there and where the links are set. You can get the container name fromdocker ps.