up to today I used name-based virtual hosting, but without the NameVirtualHost
directive. It worked. Now, I read about the directive, and added it - no change. So - is NameVirtualHost
really necessary at all, or will Apache 2.4 set this automatically, when not set?
Asked
Active
Viewed 1.4k times
7
smat88dd
- 279
- 1
- 2
- 5
1 Answers
9
Ok, it really seems to be not necessary anymore:
Nov 10 13:55:05 hostname apache2[1718]: Starting web server: apache2: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:6
smat88dd
- 279
- 1
- 2
- 5
-
1Correct it's the default in Apache 2.4 and above: https://httpd.apache.org/docs/2.4/mod/core.html#namevirtualhost – Barry Pollard Nov 10 '15 at 21:11
-
Actually, I have read that documentation. At least in the german language, there is the following written: "NameVirtualHost is _required_ for virtual hosts" ... Nothing that this directive is deprecated or not needed anymore. – smat88dd Nov 10 '15 at 23:22
-
2True. German version looks like the 2.2 version and that it was never updated for 2.4. There is a notice at the top though saying that this documentation is not maintained and to refer to the English version: "Diese Übersetzung ist möglicherweise nicht mehr aktuell. Bitte prüfen Sie die englische Version auf die neuesten Änderungen." Still, easily missed and a bit poor to keep an out of date 2.2 page up there at all for 2.4 for other languages when there were so many changes between the two versions. – Barry Pollard Nov 11 '15 at 02:45
-
3Thanks BazzaDP for the link. The official apache documentation has NameVirtualHost directive marked as "deprecated," and says it has no effect. Prior to apache 2.3.11, it was necessary. – Edward Ned Harvey Jan 02 '16 at 20:04