Is it possible to enable the UserDir Directive for just one VirtualHost rather than have it on for all and then disable it (with "UserDir disable") for each VirtualHost you don't want it on?
I have tried by putting this inside a <VirtualHost>
and comment out everything in the global config (/etc/apache2/conf.d/userdir.conf). No luck though.
<IfModule mod_userdir.c>
UserDir public.www
UserDir disabled root
<Directory /home/*/public.www>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
</IfModule>
I only removed the
UserDir public.www
(in my caseUserDir public_html
) from theuserdir.conf
. Then I added that line to my site configurations where I wantedmod_userdir
to be active.That should work, however there is a defect reported here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=44076
That prevents "normal" merging which is ironically what you're trying to avoid -- maybe because it's not working?
What exactly happens with your current configuration? Is mod_userdir loaded?