• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

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>
0
detox1978
Asked:
detox1978
  • 3
  • 2
3 Solutions
 
Jan SpringerCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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

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

www.domain*.com
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now