I read it in few bitnami docs and bitnami community forums that the above file can be used for creating a sub domain. Once you configure the virtual host entries in the above file properly, you need to replace "Include "/opt/bitnami/apps/wordpress/conf/httpd-prefix.conf" with "Include "/opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf" in /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf. This is what you guys said in https://docs.bitnami.com/virtual-machine/infrastructure/lamp/configuration/configure-custom-application/
Now, my doubts are:
1) In the file /home/bitnami/apps/wordpress/conf/httpd-vhosts.conf, there are VirtualHost entries, but this file will be included in the virtualhost of the file /opt/bitnami/apache2/conf/bitnami/bitnami.conf. Virtual host inside another virtual host is not possible. Explain this please.
2) Lets say, I removed the virtual host directive from /home/bitnami/apps/wordpress/conf/httpd-vhosts.conf and added ServerName directive for sub domain and DocumentRoot location. If I replace /home/bitnami/apps/wordpress/conf/httpd-prefix.conf file with /home/bitnami/apps/wordpress/conf/httpd-vhosts.conf file in the file /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf, then how will my main domain load?
3) Let's say, I added two Document root locations with ServerName in /home/bitnami/apps/wordpress/conf/httpd-vhosts.conf file, one for main domain and other one for sub domain. In this case, apache will serve content only from the last DocumentRoot, no matter what the ServerName is. This is because even if we specify different DocumentRoots, both are in same virtual host of <VirtualHost default:80> in bitnami.conf file.
So tell me. What is the use of httpd-vhosts.conf file? From what I see, you have to include the file location /home/bitnami/apps/wordpress/conf/httpd-vhosts.conf outside the Virtualhost in bitnami.conf file. But we already have a file for that, bitnami-apps-vhosts.conf. Please explain.