Tag: aws

subdomain-virtual-host-on-bitnami-ubuntu-aws-ec2

How to setup subdomain and virtual host in ubuntu 16.04 bitnami server

Introduction

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.

subdomain-virtual-host-on-bitnami-ubuntu-aws-ec2

Steps to create virtual host and create subdomain in bitnami based ubuntu server

  1. Login on your sever via terminal window with bitnami as the user
  2. Copy demo directory from /home/bitnami/stack/docs/demo to a new location ( You may rename the directory “demo” as something else )
  3. 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 )
  4. Include the path /home/bitnami/htdocs/demo/conf/httpd-vhosts.conf  on the /home/bitnami/stack/apache2/conf/bitnami/bitnami-apps-vhosts.conf file
  5. Restart the apache2 server ( sudo /opt/bitnami/ctlscript.sh restart )
    (  Virtual host creatio has been completed )
  6. Create a subdomain record ( ‘A’ Record ) on aws route53
  7. Check the sub domain on the browser after 5 minutes
  8. Upload your files to your subdomain root directory
  9. Hire me if you need more help ( optional  🙂

Please watch this video to get more clarity on this.