1

This configuration was working on Apache version 2.3 however, when I updated to Apache/2.4.34 (Unix) PHP/7.2.11 its not longer working. Only the first and second directives are, but the third isn't, its only showing index of the root of the folder, when its supposed to add the folder in the DEFINE as defined. Has anything changed in Apache/2.4.34, can't find any thing to resolve the issue or maybe am missing something.

PS. I have checked other Q&A the had a similar issue but none of the solutions worked.

This question is different due to the following:

  1. Its addressing dynamic vitual host and not static
  2. This is using apache version 2.4 not 2.2 as the indicated answer is.
  3. The entire configuration of this vhost file is different to the indicated answer

Thanks

Define USER currentUser
Define PATH "/Users/${USER}/Sites"
Define CRAFT2 public
Define CRAFT3 web

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot ${PATH}
</VirtualHost>

<VirtualHost *:80>
    ServerAlias *.dv
    UseCanonicalName Off
    VirtualDocumentRoot ${PATH}/%1
</VirtualHost>

<VirtualHost *:80>
    ServerAlias *.dv
    UseCanonicalName Off
    VirtualDocumentRoot ${PATH}/%1/${CRAFT3}
</VirtualHost>
9
  • Your virtual hosts are missing the ServerName directive. Without it, ServerAlias is ignored. Nov 3, 2018 at 13:18
  • @MichaelHampton, Adding the ServerName does not solve the issue either and this same config was working without the ServerName in version 2.2 but not in version 2.4
    – Said
    Nov 4, 2018 at 0:11
  • Then please edit your question to show your actual virtual hosts, because it shows your virtual hosts do not have ServerName. Nov 4, 2018 at 0:36
  • But the point of my question is that, this exact configuration worked in version 2.2, without the ServerName, and not in 2.4 so adding the ServerName would not have made any difference.
    – Said
    Nov 4, 2018 at 0:56
  • Yes, it did work in 2.2 without ServerName. But 2.4 is not 2.2. It doesn't work that way anymore. You must have a ServerName now. Nov 4, 2018 at 0:58

0

Browse other questions tagged .