Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question
I've had a response from the AWS support team. – Ian Apr 2 '12 at 16:11

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

share|improve this answer
up vote 4 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.