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)?
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.
Elastic Beanstalk can now be configured using config files. Java/Python/Ruby are supported. PHP and .NET support are coming soon.
Recently I have to disallow the request having invalid HTTP_HOST header by modifying Apache configurations.
To do this I have added custom .ebexternsion/wsgi.conf file and used following command to update the /etc/httpd/conf.d/wsgi.conf file
command: "cp .ebextensions/wsgi.conf /etc/httpd/conf.d/wsgi.conf"
And this doesn't work. But apparently when I used relative path to update the wsgi.conf as below, it started working.
command: "cp .ebextensions/wsgi.conf ../wsgi.conf
I am not sure how this started working, and weather its a prominent solution or not, but yes its working.
** Updated **
So in next deployment I lost my Apache configurations. So no need to try this method.