Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Elastic Beanstalk instance not using .htaccess

I'm having a weird issue I've not encountered before: My new Elastic Beanstalk environment is not respecting my .htaccess files. It's odd because I don't recall this ever being a problem before. In fact I have an older EB environment that I set up years ago and it's fine with the game code.

This new environment is 64 bit Amazon Linux 2.

Looking elsewhere there are guides saying you need to edit your /etc/httpd/conf/httpd.conf file, but my EC2 instance doesn't have one. (I also don't have an /etc/apache2 directory.) The closest it has is a /etc/httpd/conf.d/php.conf file.

I don't recall ever having to do this previously, and obviously I'm a bit concerned that my EC2 instance will forget any changes to any .conf files if I have to spawn new instances are created in the future.

How do you get my EB/EC2 instance to implement my .htaccess files?

like image 826
Chuck Le Butt Avatar asked Oct 19 '25 11:10

Chuck Le Butt


2 Answers

From v3.0.0 onwards, Amazon changed their Elastic Beanstalk PHP Platforms to use nginx as their server instead of Apache. This is not mentioned anywhere when you're creating your platform, so it can catch you unawares.

If you want to use Apache, you need to select a platform version of v2.x.x.

See the full history of Elastic Beanstalk PHP platforms for specific details.

like image 86
Chuck Le Butt Avatar answered Oct 22 '25 04:10

Chuck Le Butt


An update to the other answer, you can now change the server in versions 3+ to apache by updating the proxy server in the configuration.

like image 36
Ben Gooding Avatar answered Oct 22 '25 05:10

Ben Gooding



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!