In Apache2 is it possible to set multiple ServerNames in one VHost?
I want to setup a "wiki" vhost for an internal wiki.
My network has a ".lan" suffix. How do I get Apache to answer both "wiki" and "wiki.lan" on the same vhost?
In Apache2 is it possible to set multiple ServerNames in one VHost?
I want to setup a "wiki" vhost for an internal wiki.
My network has a ".lan" suffix. How do I get Apache to answer both "wiki" and "wiki.lan" on the same vhost?
Use both the
ServerName
andServerAlias
directives in your virtualhost definition. You would do something like:See Apache Docs – ServerAlias Directive.
Add the other names with
ServerAlias
.You can use any of those 2 formats or a mixture:
The directive is valid only in VirtualHost section.
See: http://httpd.apache.org/docs/current/mod/core.html#serveralias