Forum Moderators: phranque
<VirtualHost *:443>
ServerAdmin alert@example.net
ServerName www.example.co.uk
DocumentRoot /srv/site
Header edit Set-Cookie ^(.*)$ __Host-$1;HttpOnly;Secure;SameSite=Strict
<Directory "/">
AllowOverride None
Require all denied
</Directory>
<Directory "/srv/site">
DirectoryIndex index.php
AllowOverride All
Include /etc/apache2/use-setenv.conf
</Directory>
<Directory "/srv/site/cp">
Require all denied
Require ip (my IP) # always allow me access
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/apsec/apas
Require user auth-user-name
</Directory>
SSLEngine on
<FilesMatch "\.(php)$">
SSLOptions +StdEnvVars
</FilesMatch>
SetEnv nokeepalive ssl-unclean-shutdown
Include/etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.example.co.uk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.example.co.uk/privkey.pem
</VirtualHost>
When I commented out the include it worked correctly (for me - not contacted the client yet).Doesn't that point to the problem being something in the file-to-include (which I don’t see here)?
I tried switching the order of the <directory> blocks with no effect.:: detour to apache dot org to confirm that I remembered right ::
If multiple ... <Directory> sections match the directory (or one of its parents) containing a document, then the directives are applied in the order of shortest match firstIt's always reassuring when Apache does what you expect it to do: The actual order of the <Directory> sections doesn’t matter; what matters is the length of the path (or depth of nesting). “This rules applies to /A, unless it is /A/B, which in turn can be overridden by specific rules for /A/B/C.”
Doesn't that point to the problem being something in the file-to-include (which I don’t see here)?
Why is the include in a <Directory> section?
The actual order of the <Directory> sections doesn’t matter