Skip to content

Instantly share code, notes, and snippets.

@peter-mcconnell
Last active November 16, 2022 15:10
Show Gist options
  • Save peter-mcconnell/10394636 to your computer and use it in GitHub Desktop.
Save peter-mcconnell/10394636 to your computer and use it in GitHub Desktop.
Elastic Beanstalk - Password protect
files:
"/etc/httpd/conf.d/allow_override.conf":
mode: "000644"
owner: ec2-user
group: ec2-user
encoding: plain
content: |
<Directory /var/www/html/myproject/>
AllowOverride AuthConfig
</Directory>
"/etc/httpd/conf.d/auth.conf":
mode: "000644"
owner: ec2-user
group: ec2-user
encoding: plain
content: |
<Directory /var/www/html/myproject/>
AuthType Basic
AuthName "Myproject Prototype"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</Directory>
"/etc/httpd/.htpasswd":
mode: "000644"
owner: ec2-user
group: ec2-user
encoding: plain
content: |
myusername:mypassword
@rentrop
Copy link

rentrop commented Oct 27, 2015

+1

@klausbreyer
Copy link

found it via google, will try it! but looks good - thanks :)

@klausbreyer
Copy link

Hi, sadly i can not use if for symfony with its very own /www directory. Any Ideas?
http://stackoverflow.com/questions/41673870/elastic-beanstalk-basic-http-auth-for-php-symfony

@nitishxp
Copy link

Hi how to enable AllowOverride in beanstalk (php 7.3) when i am enabling it my php code is visible to brower? any help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment