I am configurating my apache2 server and I wonder whats the difference between ServerName and ServerAlias.
Is the ServerName always a name without www as like google.de and the ServerAlias is www.google.de
Even if it's like this, I don't get it :) sorry.
I am not a professional (now) so thank you for your help! Every help will upvoted immediately.
From the Documentation:
Most people simply use
ServerName
to set the 'main' address of the website (eg. 'mywebsite.com') andServerAlias
to add additional addresses the website will be bound to (eg. 'www.mywebsite.com').Yet, there are subtle differences between the two:
ServerName
can accept port numbers as well, whileServerAlias
cannot.ServerAlias
can accept wildcards (eg. *.mywebsite.com), whileServerName
cannot.Read the documentation to understand why.