Category Archives: amazon-elastic-beanstalk

AWS elastic beanstalk 100.0 % of the requests are erroring with HTTP 4xx

My AWS Elastic Beanstalk account keeps getting down with the error: "Environment health has transitioned from Ok to Severe. 100.0 % of the requests are erroring with HTTP 4xx" On a daily basis.

When looking at the server logs, it keeps getting down after access to several odd web pages (which do not exist). Part of the log:

/var/log/httpd/error_log-XXX
[XXX] [:error] [pid XXX] [client XXXX] script '/var/www/html/w.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/sheep.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/qaq.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db_session.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db__.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/wp-admins.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/m.php' not found or unable to stat
[XXX] [:error] [pid XXX] [XXX] script '/var/www/html/db_dataml.php' not found or unable to stat
...
[XXX] [XXX] [pid XXX] XXX: Graceful restart requested, doing restart

Does anyone know whats going on? Thanks!

Apache Rewrite Rule not working on server

I am using an AWS Elastic Load Balancer, and have set up the following rule to convert http traffic to https.

$ cat /etc/httpd/conf.d/ssl_rewrite.conf 
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent][[email protected] conf.d]$ 

However, when I access my website via its domain (www.thewhozoo.com), I can see the protocol is http and not https.

Any ideas why the rewrite rule is not working?

Thanks

More info

The above is created on deployment by:

.ebextensions/myapp.config

container_commands:
      01_setup_apache:
          command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"
files:
    "/etc/httpd/conf.d/ssl_rewrite.conf":
        mode: "000644"
        owner: root
        group: root
        content: |
            RewriteEngine On
            RewriteCond %{HTTP:X-Forwarded-Proto} =http
            RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]

How to implement HTTPS in AWS Elastic Bean Stalk using PHP/Apache

Have seen many threads on this topic which all seems active few years back. Bit confused on how this can be done.

Following is the environment config: 64bit Amazon Linux 2015.03 v2.0.1 running PHP 5.6 I'm assuming the installation comes default with Apache.

I gather it can be done code level and also Webserver level. I got an impression that web server level approach would be generic and probably the best approach. Is there a step by step help to install a digital certificate and redirect http to https in AWS Elastic Bean Stalk?

Thanks so much as it would incredibly help me to secure the website.

How to implement HTTPS in AWS Elastic Bean Stalk using PHP/Apache

Have seen many threads on this topic which all seems active few years back. Bit confused on how this can be done.

Following is the environment config: 64bit Amazon Linux 2015.03 v2.0.1 running PHP 5.6 I'm assuming the installation comes default with Apache.

I gather it can be done code level and also Webserver level. I got an impression that web server level approach would be generic and probably the best approach. Is there a step by step help to install a digital certificate and redirect http to https in AWS Elastic Bean Stalk?

Thanks so much as it would incredibly help me to secure the website.

How to implement HTTPS in AWS Elastic Bean Stalk using PHP/Apache

Have seen many threads on this topic which all seems active few years back. Bit confused on how this can be done.

Following is the environment config: 64bit Amazon Linux 2015.03 v2.0.1 running PHP 5.6 I'm assuming the installation comes default with Apache.

I gather it can be done code level and also Webserver level. I got an impression that web server level approach would be generic and probably the best approach. Is there a step by step help to install a digital certificate and redirect http to https in AWS Elastic Bean Stalk?

Thanks so much as it would incredibly help me to secure the website.

How to implement HTTPS in AWS Elastic Bean Stalk using PHP/Apache

Have seen many threads on this topic which all seems active few years back. Bit confused on how this can be done.

Following is the environment config: 64bit Amazon Linux 2015.03 v2.0.1 running PHP 5.6 I'm assuming the installation comes default with Apache.

I gather it can be done code level and also Webserver level. I got an impression that web server level approach would be generic and probably the best approach. Is there a step by step help to install a digital certificate and redirect http to https in AWS Elastic Bean Stalk?

Thanks so much as it would incredibly help me to secure the website.

How to implement HTTPS in AWS Elastic Bean Stalk using PHP/Apache

Have seen many threads on this topic which all seems active few years back. Bit confused on how this can be done.

Following is the environment config: 64bit Amazon Linux 2015.03 v2.0.1 running PHP 5.6 I'm assuming the installation comes default with Apache.

I gather it can be done code level and also Webserver level. I got an impression that web server level approach would be generic and probably the best approach. Is there a step by step help to install a digital certificate and redirect http to https in AWS Elastic Bean Stalk?

Thanks so much as it would incredibly help me to secure the website.

AWS EC2 t2.micro boxes sending 503 error

I have a service running on t2.micro boxes configured via ElasticBeanStalk. The number of requests coming on each box is roughly 100ps and average response time is under 100ms.

During high traffic the some of the http requests are failing with 503 error.

503 Error on service call

There are lot of such spikes while monitoring the service in cloudwatch. The traffic is dropped from the boxes because the errors are listed under HTTP 5xxs and not ELB 5xxs (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-cloudwatch-metrics.html). This led me to testing the access logs on the box. On checking the httpd access logs I see a lot of 503 errors but there is not a single 503 error in the tomcat's access log.

Is there a way in which I can fix this?