Is it possible to have two ServerName in the one virtualhost?

Hi All,

Is it possible to have two ServerName in the one virtualhost?

e.g. www.mydomain.net and www.mydomain2.net

<VirtualHost 192.168.0.2:80>
ServerName www.mydomain.net
DocumentRoot /var/www/mydomain.net/
</VirtualHost>
LVL 2
detox1978Asked:
Who is Participating?
 
Jan SpringerConnect With a Mentor Commented:
Yes.

ServerName www.mydomain.net
ServerAlias www.mydomain2.net

As long as the IP of the two is the same.
0
 
detox1978Author Commented:
Yeah, it's the same.  Can you have more than two?
0
 
Jan SpringerCommented:
With multiple ServerAlias statements.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
detox1978Author Commented:
Is there any limit.  I wanted to add around 100.
0
 
crazyn3wfConnect With a Mentor Commented:
I dont think there is a limit. Just use

ServerAlias domain1.com domain2.com domain3.com domain4.com ....
0
 
Jan SpringerConnect With a Mentor Commented:
I don't think that's a problem.  You can also aggregate similar domains with the wildcard (*):

www.domain*.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.