503 Service Unavailable - EC-2 / WordPress with NGINX and SSL Certified by Bitnami-4-9-8-1-r40 - wordpress

I have been trying to learn AWS EC-2 and installing WordPress by Bitnami. I was planning to move all my sites from cPanel to AWS in the future if I could pull this off.
I am having issues with constantly getting 503 Unavailable Error when I attached the Amazon Issued SSL.
I was able to create an Instance, Certificate, DNS via Route 53, Load Balancer, Security Group and Target successfully I just can't get the site up. :(
Public IP works though 54.237.218.136
What could go wrong?

503 gateway time out it is. well your configuration and services need a restart , As Amazon provided Certificate works with Load Balancer (Application or Classic)
503 is the gateway time out from php-fpm or Apache 2 As you haven't shared the logs to give you a more prise solution I would suggest to login on your EC2-Wordpress powered by Bitnami and run the following commands .
sudo /opt/bitnami/ctlscript.sh status
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/ctlscript.sh start
Please follow this document as well: https://docs.bitnami.com/aws/faq/administration/control-services/
I'm sure that committed changes with the configuration has not been loaded yet as your EC2 is even not responding on this IP ,
I'm sure about the Load Balancer and certificate is not the problem here.
You can ping me if you need help with this it's not a really tough job.
Thanks

Related

Google Cloud click to deploy wordpress is not working

Hello I need help with my wordpress site not loading. Currently I see a "site is taking too long to respond" error.
I am using a click-to-deploy wordpress instance in google cloud platform.
I also recently changed the size of the vm instance to E2 11GB, because google platform suggested it so I did exactly that. I think that could also be the problem.
I just recently setup certbot and I think it was installed correctly.
However, when I tried checking certbot renew dry run I got this...
sudo certbot renew --dry-run
Simulating renewal of an existing certificate for my-domain.com.mx and www.my-domain.com.mx
Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these probl
ems:
Domain: my-domain.com.mx
Type: connection
Detail: Fetching http://my-domain.com.mx/.well-known/acme-challenge/cPuhyf6nQTtqjbDf7FJ6LtF9-4o109ogsQS4vAwNNfI: Tim
eout during connect (likely firewall problem)
Domain: www.my-domain.com.mx
Type: connection
Detail: Fetching http://www.my-domain.com.mx/.well-known/acme-challenge/lbwGM8-Wf_zmRV5vTAC0hEuEfBA5g7lfxG49VOKk3ZI:
Timeout during connect (likely firewall problem)
Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure
that the listed domains point to this Apache server and that it is accessible from the internet.
Failed to renew certificate my-domain.com.mx with error: Some challenges have failed.
I pasted the actual response, I just replaced my actual domain with "my-domain".
As you can see, the renew command doesn't work :(.
I restarted apache like this sudo /etc/init.d/apache2 restart
These are the versions of everything that comes pre-intalled in the VM

Cloudflare Timeout Issue with Git pull and Curl Request in AWS EC2 instance

I have my WordPress project running in the AWS EC2 instance. I have my DNS managed in Cloudflare and it is proxied. When I did the setup of the project in AWS instance, for some days git pull and push and all the APIs were working fine. But suddenly after some time, I was not able to take the pull on the server due to a timeout issue.
Also from the WordPress form when I submit the form it should call the API but it gives me the 504 gateway timeout error.
So every time when I need to take a pull I have to reboot the server and then for 5 mins. everything works fine and then again it gives me the same error.
What should I do with Cloudflare? As per my knowledge, there must be something from Cloudflare as on the server-side I have tried everything for this kind of problem.

Wordpress not working after changing instance type on Google Cloud Platform

I changed my VM instance from "F1-micro" to "E2-micro". When I then restarted my machine, I couldn't access my webpage using the domain name, the webpage just shows an "Error 521" code - showing that my browser is working, CDN is working but the host has an erorr. When I paste the VMs IP address into my webpage, however, it show's the "Apache2 Debian Default Page".
Can somebody please help me with this?
The Error 521 message is caused by one of two situations:
First, check whether your WordPress site’s server is down. Even if everything else is configured properly, if your WordPress site’s server is offline, Cloudflare simply won’t be able to connect.
Second, your web server might be running fine but blocking Cloudflare’s requests. Because of how Cloudflare works, some server-side security solutions might inadvertently block Cloudflare’s IP addresses.
Cloudflare is a reverse proxy, all the traffic coming to your origin server will appear as if it’s coming from a small range of Cloudflare IPs (rather than each individual visitor’s unique IP address). Because of that, some security solutions will view high traffic from a limited number of IP addresses as an attack and block them.
Please check this link out in order to fix error 521 for Cloudflare and WordPress.
Turns out this problem was caused by my having installed the Debian Apache server package and it is causing collisions between it and the Apache shipped in the stack. Bitnami Stacks are completely self-contained and run independently of the rest of the software or libraries installed on your system.
So to fix this, all I had to do was run the following commands:
sudo systemctl stop apache2
sudo /opt/bitnami/ctlscript.sh restart

How do you install an SSL certificate on an AWS EC2 Wordpress server?

How can I install an SSL certificate to my EC2 instance running wordpress? I have tried the following links:
https://aws.amazon.com/blogs/aws/new-aws-certificate-manager-deploy-ssltls-based-apps-on-aws/
http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html
However I have been unable to successfully have any changes propagate.
Steps I followed:
-Request ACM SSL Certificate
-Create a Load Balancer with the SSL Certificate attached
-Attach load balancer to EC2 instance
As mentioned you cannot use AWS's certificate. But you can use another excellent free certificate provider - Let's Encrypt.
They provide an easy to install and use tool that supports Apache and Nginx - along with most flavors of Linux.
ANSWER:
I was able to use Let's Encrypt through the AWS CLI to add an auto renewing SSL certificate. The link below was very helpful despite being on Google Cloud. The instructions transfer over since both servers use bitnami for the Wordpress.
https://www.youtube.com/watch?v=DBnQkH1v-Xw&app=desktop
I only had to make one change to the instructions and that was to change the RewriteRule to be
RewriteRule https://(domain here) [R,L]
Another way to go is to manually set it up by logging in to your server. You should get some cheap SSL certificate and have it installed inside your /etc/apache2/ssl folder. Make sure your 443 port is opened and that openssl is installed on your server and enabled.
Here is a complete guide on how to do what I just said https://medium.com/#adnanxteam/how-to-add-ssl-certificate-to-laravel-on-ec2-aws-18104cc036d1
You can attach this certificate on load balancer and forward this to backend instance port 80
443->80
When applying certificate to elb you have two option to upload certificate into ACM or to IAM you can choose anyone and simply copy paste the certificate derails

Setting up SSL on AWS EC2

I'm trying to set up SSL on my wordpress site.
I've an EC2 instance running wordpress on nginx and ubuntu. Database running on RDS.
I've launched an application load balancer with listeners on ports 80 and 443 and attached the SSL certificate which I got via ACM. I've set my targets to point to the EC2 instance I am using.
At this point the how-to guides and information stops. Apparently that's all there is to it and it should now all be working. However it's not. I'm getting connection refused errors when I add the https to my site's URL.
When I put my URL into https://www.sslchecker.com/sslchecker I'm told that no certificates are found.
So clearly I need to something more to get this working - can anyone point me to the next step?
Using the ELB and ACB is the way to go here. It sounds like you might be using the wrong type of ELB though. You mentioned application load balancer, you should use a classic load balancer. Also make sure your security groups are setup correctly to allow your ELB to talk to the EC2 instance.
You didn't mention Route53 but I assume you have the DNS entry setup to point at the ELB as well.
Share more and I will help more. Good luck.

Resources