Score:0

Host multiple websites on AWS Auto-Scaling Group with EFS

cn flag

I hope this is a simple question. Currently I have an Apache2 webserver on Ubuntu with multiple websites. The basic structure of the Apache is

/etc
  /apache2
     /sites-available  --> the .conf files for the websites
     /sites-enabled    --> the enabled .conf file links for the websites
/var
  /www
    /html
      /sites-admin     --> the location of the websites code

My task is to create an auto-scaling group that will be adjusting with the load. My thought is to mount an EFS drive under /var/www/html/efs_mount and store the websites code there

However, this creates two issues:

  1. this approach does not accommodate adding websites as i will have to update AMI and launch template, as well as instance refresh every time I add a website
  2. when adding the website configuration to /etc/apache2/sites-available, in order to enable it we run a2ensite webiste.conf. as in the issue #1 this requires an update to the AMI and launch template, as well as instance refresh

Is there a way to work around this issue? I know there's an option to use code deploy with the in-place or replace approach. Are there any other options?

Thanks Igal

Score:0
cn flag

This was resolved by mounting EFS under /mnt/efs/fs1, setting the Apache root directory to /mnt/efs/fs1/www/html, and configuring bitbucket pipelines to trigger AWS CodeDeploy to deploy to the root directory and, as part of the script, run sudo systemctl reload apache2

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.