How to configure Apache on Amazon Elastic Beanstalk

My PHP5.3 application is currently running on a Windows 2003 server running XAMPP 1.7.7 I've decided it will be better if I can get it moved onto the cloud, and Amazon Elastic Beanstalk looks like the easiest way to go. I'm starting with a 64bit Amazon Linux running PHP 5.3 container. My next step is to limit access to the website with an htpasswd file. I'd rather not use .htaccess files. How do I configure Beanstalk Apache conf file settings (on Windows the settings are stored in httpd.conf)?


Solution 1:

Ryan at AWS said: We don't currently have support for allowing customers to modify the httpd.conf file via the Elastic Beanstalk service/console.

However, after you launch an Elastic Beanstalk environment, you can log onto the EC2 instance directly, make your modifications to /etc/httpd/sites/your-application (which is how site configurations are managed in the Apache installation for Amazon Linux). From there, you can create a new AMI from the running instance.

Take note of the AMI ID, then you can reconfigure your running environment to use your new AMI ID instead of the default one. For the people who want to customize their Elastic Beanstalk environments outside of what we provide in the service, this is the approach that we recommend.

http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/using-features.customami.html

Solution 2:

Elastic Beanstalk can now be configured using config files. Java/Python/Ruby are supported. PHP and .NET support are coming soon.

http://www.infoq.com/news/2012/11/elastic-beanstalk-config-files