mardi 13 octobre 2015

Reconfigure apache in elastic beanstalk without environment reload

I am experimenting trying to migrate a Java application to EB,

We had a similar structure, with JBoss being proxied by Apache through AJP. In our apache config we had some custom rewrites and configurations through an vhost file.

So, currently in order to support this, the application passes this vhost configuration to Apache through an .ebextensions config file deployed inside the war:

files:
    "/etc/httpd/conf.d/elasticbeanstalk.conf":
    mode: "000644"
    owner: root
    group: root
    encoding: plain
    content: | 
       <VirtualHost *:80>
            ServerName "domain.com"
            ServerAlias "www.domain.com"
            ...
       </VirtualHost>

We periodically need to modify this vhost configuration, but is it not application code related. So it feels weird that in order to change Apache's configuration , we need to redeploy the application.

Is there a better way to do this?

I read that some people prompt you to ssh to some instance, apply the configuration and then wait for aws to replicate it eventually when it creates other instances, however, while this may work in a single instance configuration, I'm not clear on how would to make it work with multiple instances deployed on the Beanstalk...Also, this solution feels like a hack that totally misses the point of using an automated versioned tool like Beanstalk.




Aucun commentaire:

Enregistrer un commentaire