If I now visit domain.com it shows content of domain.com, when I visit domain2.com it shows content of domain2. That’s perfect.
But when I visit server’s IP address it gives me content of domain.com. How can I change that? Specify what is the default content if (domain is not provided) OR (domain is not specified on server)?
How to setup default domain on apache?
I set up first domain:
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName domain.com ServerAlias www.domain.com DocumentRoot /var/www/domain.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Then I did exactly the same for domain2.com
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName domain2.com ServerAlias www.domain2.com DocumentRoot /var/www/domain2.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
If I now visit domain.com it shows content of domain.com, when I visit domain2.com it shows content of domain2. That’s perfect.
But when I visit server’s IP address it gives me content of domain.com. How can I change that? Specify what is the default content if (domain is not provided) OR (domain is not specified on server)?