How to set and serve main and sub domain from a single AWS Lightsail instance

Keywords: LAMP/MAMP/WAMP - AWS - How to - Domain Name (DNS)
I have deployed a Laravel application on AWS LightSail LAMP stack. The app is serving under the main domain e.g. . Now I want move it t and use as marketing and company profile purposes. The current codebase is under htdoc directory, not in any subdirectory.

My queries are:

  • How do I achieve the above explained domain structure so that in future i can add more subdomains if necessary?
  • Do I need to make any changes in the DNS records?
  • Is the current SSL certificate issued for is usable for future subdomains?

Hi @jhondoedo,

Thanks for using Bitnami. We have a guide on how to install multiple PHP applications on top of your LAMP stack. Can you check it?

About the domain, you will need to create a new DNS entry for pointing to It is usually called a CNAME, but it may have a different name on your DNS provider.

For the SSL certificate, you will need to create a new SSL certificate including both domains or two different certificates, one for each site, and configure Apache to use one of them for each virtualhost.

1 Like

Hi Mr. @gongomgra following this guideline able to serve content from but the issue now is i am seeing the same content from if accessed from Do I need some extra configuration anywhere else? Thank you.

Hi @jhondoedo,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Decryption code generate by support tool:


For there is no .conf file in vhost directory. Could it be the reason according to the below clause from Apache documentation.

The default name-based vhost for an IP and port combination
If no matching ServerName or ServerAlias is found in the set of virtual hosts containing the most specific matching IP address and port combination, then the first listed virtual host that matches that will be used.

Hi @jhondoedo,

I’m afraid I’m not fully understanding your question. Can you give us more details and also the actual domain names so we can check them? We will remove them from your message afterwards.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.