I have domain on name.com and I created two subdomain from DNS record
Type, Host, Answer, TTL
A, subdomain1.domain.com , EC2 IP, 300
A, subdomain2.domain.com , EC2 IP same as above, 300
<VirtualHost *:80>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName subdmain1.domain.com
ServerAlias www.subdmain1.domain.com
Project related Configuration....
</VirtualHost>
<VirtualHost *:80>
ServerName subdomain2.domain.com
ServerAlias www.subdomain2.domain.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Second project code ....
</VirtualHost>
I did above configuration in apache2 of my EC2 server but When I access any subdomain that automatic always goes to first VirtualHost and second Virtualhost not working.
please Help me for configure both subdomain on ec2
Note: I'm using main domain.com on name.com website