This article will be helpful for those who is using Ubuntu 16.04 – bitnami based server on amazon aws EC2 instance only. I’m writing this blog post because, i did’t find any best blogs which explain how to create a subdomain in aws ec2 instance and which also using bitnami based image to configure the instance. I can see, so many blogs and stackoverflow results about this topic, but most of those are talking about creation of virtual host on the standard ubuntu server only. Actually creation of the virtual host was the complex task for me at first and subdomain creation is almost easy.
Steps to create virtual host and create subdomain in bitnami based ubuntu server
- Login on your sever via terminal window with bitnami as the user
- Copy demo directory from /home/bitnami/stack/docs/demo to a new location ( You may rename the directory “demo” as something else )
- Change the path and hostname on the config files on the new demo directory with new file paths ( in my example, it is located in /home/bitnami/htdocs/demo )
- Include the path /home/bitnami/htdocs/demo/conf/httpd-vhosts.conf on the /home/bitnami/stack/apache2/conf/bitnami/bitnami-apps-vhosts.conf file
- Restart the apache2 server ( sudo /opt/bitnami/ctlscript.sh restart )
( Virtual host creatio has been completed )
- Create a subdomain record ( ‘A’ Record ) on aws route53
- Check the sub domain on the browser after 5 minutes
- Upload your files to your subdomain root directory
- Hire me if you need more help ( optional 🙂
Please watch this video to get more clarity on this.