Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

Use both the ServerName and ServerAlias directives in your virtualhost definition. You would do something like:

<VirtualHost *:80>

    Servername wiki.lan 
    ServerAlias wiki

    [...]

</Virtualhost>

See Apache Docs – ServerAlias Directive.

share|improve this answer
    
Thats right! I had forgotten about ServerAlias... –  Soviero Jul 27 '11 at 6:41

Add the other names with ServerAlias.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.