Reputation: 1189
I am migrating an internal server that hosts muliple "apps" to AWS. On the internal server, hosting the muliple apps is accomplished through httpd.conf with VirtualHosts and DocumentRoots. We currently deploy revisions to this server using Bitbucket and DeployHQ. Creating a new deployment strategy is where I am struggling. Here are the issues I am running into:
Elastic Beanstalk. I have one of the apps created and can successfully deploy to the var/www/html directory. However there doesn't seem to be any way to change the default deployment directory. For instance, I would prefer to deploy to /home/[user directory]/[app directory]. There also doesn't appear to be any way to deploy a different app to the same environment in a different directory. Some of these apps are very small and having their own server/environment would be way overkill.
The app server itself is in a private subnet within the VPC which requires me to have a middle man to SSH to it. DeployHQ doesn't seem able to handle a middle man deployment.
I can't seem to find any resources that would assist me in pushing to an S3 instance (or the middle man EC2 instance) with access to the app server and then setting up some sort of automated deployment from S3 to the EC2 app server.
Is there some simple option I am not seeing here? I am looking in to AWSCodeDeploy right now but wondering if someone has already run into this issue and has any suggestions.
Upvotes: 1
Views: 286
Reputation: 1189
In case anyone else comes across this, we have decided to put all of these small projects into one repository. We then edited the httpd.conf file (similar to the way it is on the current non-AWS server) with different domains directing to the appropriate directories. The edited httpd.conf was placed into an .ebextensions folder in the root directory of the project repo. Also in this folder is a file called 01httpd.config with the following:
container_commands:
replace_config:
command: "cp .ebextensions/httpd.conf /etc/httpd/conf/httpd.conf"
More info: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
While this works, ultimately I wish there were a more elegant solution to allow one EC2 server that is not exposed to direct traffic to host multiple domains and still be able to have managed deployments. If anyone has one, I am all ears!
Upvotes: 1