Wordpress on Bitnami and AWS unavailable

0

On AWS EC2 instance I've installed Bitnami and on top of that I've installed Wordpress and a Wordpress theme.

After few months of customization few days ago I stopped and started the instance. Since then my site is unavailable.

I am trying to bring the site up and for this I've found this tutorial: https://www.youtube.com/watch?v=xvtoVxk8kWA

Following the tutorial I can say the following:

  • Status check for sys. reachability successfully passed
  • Status check for instance reachability successfully passed
  • Security groups look ok from my perspective
  • Network ACL looks ok from my perspective (all traffic allowed)

In the tutorial (time 4:20) it says to start the following command: sudo systemctl status httpd When I run this command I get the following output Unit httpd.service could not be found.

I tried running this command as "root" and as "bitnami" user. In both cases I am getting the same error message.

In the aforementioned tutorial in the comments someone wrote that "sudo systemctl restart httpd" worked for him. But when I run this command I still get "Unit httpd.service not found.".

Bottom line is - I am trying to bring the site up. This way or any other way. All checks which video describes until 4:20 minute look same/similar on my end. That's why I am trying to bring it up with "sudo systemctl...". can anyone please help me with this? Thanks!

Following the video (4:41) I've run this command to check if the traffic is received on port 80/443:

netstat -tunlp | grep -i http I don't get any result (at least not the result as shown in the video). Based on this I conclude that the site is NOT listening on port 80/443

I tried running this command and here is the result

sudo firewall -cmd --state sudo: firewall: command not found If I run

sudo /opt/bitnami/ctlscript.sh status Then I get this result apache already running mariadb already running php-fpm already running Can anyone please help me to bring the site back up? The matter is urgent and critical. Thanks for support and understanding.


If I run this command: sudo /opt/bitnami/bndiagnostic-tool

I get the following output ` An updated version is available. Would you like to download it? You would need t o run it manually later. [Y/n]: n

Welcome to the Bitnami Diagnostic tool.

Please read the following information carefully.

Press [Enter] to continue: This tool collects system information and files from a Bitnami stack into a diagnostic bundle file to be uploaded and reviewed by the Bitnami Team, for the sole purpose of providing you support for any issue you may find.

The uploaded information will be automatically removed from our systems after 1 month. In case you have any doubt regarding our privacy policy please check:

https://www.vmware.com/help/privacy.html Press [Enter] to continue:

Do you accept? [y/n]: y

| The bndiagnostic tool has finished searching for errors and has found some issues that might be related to yours. The output will be shown on the next page:

Press [Enter] to continue:

===== Begin of bndiagnostic tool output =====

? Resources: Found possible issues ? Connectivity: Found possible issues ✓ Mariadb: No issues found ✓ Processes: No issues found ? Wordpress: Found possible issues ? Apache: Found possible issues ✓ Php: No issues found [Resources]

Your instance has little available RAM memory.

total used free shared buff/cache available Mem: 975 386 63 1 524 420 Swap: 634 12 622 You could try to increase your instance's memory. Please check your cloud provider's documentation for more information. Press [Enter] to continue:

[Connectivity]

Server ports 22, 80 and/or 443 are not publicly accessible. Please check the following guide to open server ports for remote access:

https://docs.bitnami.com/general/faq/administration/use-firewall/

[Wordpress]

Found recent WordPress plugin related error messages in the Apache error log.

[Sun Feb 26 21:00:44.149415 2023] [proxy_fcgi:error] [pid 952:tid 140330003298048] (70007)The timeout specified has expired: [client ip_address:20346] AH01075: Error dispatching request to : (polling), referer: https://www.<my-domain-name.com>/wp-admin/plugins.php?s=&plugin_status=all

Please check the following guide to deactivate plugins:

https://developer.wordpress.org/cli/commands/plugin/deactivate/

[Apache] Press [Enter] to continue:

Found recent error or warning messages in the Apache error log.

[Sun Feb 26 20:59:56.709925 2023] [proxy_fcgi:error] [pid 952:tid 140329768302336] (70007)The timeout specified has expired: [client ip_address:32977] AH01075: Error dispatching request to : (polling), referer: https://www.<my-domain-name.com>/wp-admin/admin.php?page=w3tc_dashboard&_wpnonce=521586fa3b& w3tc_note=flush_all [Sun Feb 26 20:59:43.844511 2023] [proxy_fcgi:error] [pid 952:tid 140330158352128] (70007)The timeout specified has expired: [client ip_address:28814] AH01075: Error dispatching request to : (polling), referer: https://www.<my-domain-name.com>/wp-admin/admin.php?page=w3tc_dashboard&_wpnonce=521586fa3b [Sun Feb 26 21:00:29.519343 2023] [proxy_fcgi:error] [pid 689:tid 140329474819840] (70007)The timeout specified has expired: [client ip_address:51737] AH01075: Error dispatching request to : (polling)

Please check the following guide to troubleshoot server issues:

https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-erro rs-apache/ Press [Enter] to continue:

===== End of bndiagnostic tool output =====

Press [Enter] to continue: The diagnostic bundle was uploaded successfully to the Bitnami servers. Please copy the following code:

68c41c59-2922-1493-7306-970580d0b299

And paste it in your Bitnami Support ticket._`


Re. "connectivity":

this is how my inbound rules are defined: https://prnt.sc/ieCq2NSsX6B6


This video (https://www.youtube.com/watch?v=uLmjoHDCkag) shows how the issue with unreachable site is resolved (14:56 min). However, when I connect as bitnami user I can't run the commands show in the video. On the other hand, if I try to connect with the instance over console-aws either as "admin" or "ec2-user", I get the following error Failed to connect to your instance Error establishing SSH connection to your instance. Try again later.

Why can't I connect with the instance?

asked a year ago819 views
6 Answers
0

Connection error:

It appears to me that you should check your security group's inbound rules. Please check the source either it is My IP or 0.0.0.0/0. If you get the public IP dynamically, then you have to change the My IP, and I believe you know the 0.0.0.0/0 source which is not secure, but you may try it. By stopping and restarting the ec2 could replace the EIP or Auto enabled public IP. If this the case you should reassociate the EIP with the VPC/EC2.

If I am not wrong "sudo apachectl configtest" will tell you line by line, if there is any apache server problem.

The wider part is DNS configuration with your new EIP or public IP and check the NS server. There are a few commands to check those. There is a publication on AWS "How do I troubleshoot issues with DNS record resolution for my public hosted zone in Route 53?" could help you.

Before you do anything, please make a snopshot of the instance, in case you may create more problem with the current instance.

I hope this will help you.

answered a year ago
  • Thanks for your reply. This is how inbound rules in the security group are defined: https://prnt.sc/ieCq2NSsX6B6 I am using public hosted zone. I also noticed that elastic IP is associated with VPC. "sudo apachectl configtest" returns "Syntax OK".

    I am really running out of options here, so I'd appreciate any help. Please consider I am not an infrastructure expert. Thanks.

    I'd appreciate if we can proceed more structurally. Please let me know how and what I need to check and I will send you the infos. Thanks.

0

Your security group inbound rules, look fine. As you have mentioned that you are not an AWS infrastructure expert, that's a concern. So, I an not sure whether you have created the VPC and its dependencies manually or dynamically. If you have created the VPC and its dependencies manually, then it will be hard for you to check the association of subnets, IG, and IG's association with the VPC. You will get there, no worries. As I have said before when you have stopped the instance, your instance is no longer with the EIP any more. What you can do, just select that EIP and under Action on the top, release that EIP and reassociate it with the EC2. Action > Release Elastic IP addresses Action > Associate Elastic IP addresses On Associate Elastic IP address Info - Page Click refresh icon under the Instance and click inside the box, you will see the Instance/s, select the correct instance to associate the EIP. Afer all click the "Associate" button.

Or you can delete the EIP, and allocate a new EIP and associate the new EIP with the EC2. Select "Elastic IPs" on the left side of the dashboard. Click "Allocate Elastic IP address" top right corner of the page.

Now follow the "Action" menu to associate this EIP with your correct instance. I hope this will help you, and again you have reedit the DNS A recored. Because your DNS A record still have the old EIP. You have to replace the old EIP with the new one, if you have created a new noe. If you have not created a new EIP then you do not need to edit the DNS A record.

Let me know, I am happy to assist you.

answered a year ago
  • Thank you for your reply. I did not create anything manually. I used Bitnami image and I believe that took care of everything automatically and resources were created dynamically. Before I make changes to elastic IP can you please have a look at the current settings I described (with screenshots) in this question. https://stackoverflow.com/questions/75624841/site-unavailable-on-ec2-instance-bitnami-image Please let me know afterwards if you think I should proceed with the changes regarding elastic IP you recommended.

    Just one more quick comment regarding elastic IP. I see the same IP in DNS A records in "Route53 -> DNS Management, Hosted zone -> My Domain Name". Can you please explain how adding a new elastic IP could resolve the issue? Are you sure I don't need to update anything else except DNS A record after I create a new elastic IP?

    Thanks again for your support!

    UPDATE: if I try to release the EIP, I get this message: https://prnt.sc/hxpmArxuXfPg Additionally, I don't see where I can delete the EIP: https://prnt.sc/yVumPxORTYUg (since I am not infra. expert, as you can see, I am being super cautious regarding the changes)

0

In the tutorial (time 4:20) it says to start the following command: sudo systemctl status httpd When I run this command I get the following output Unit httpd.service could not be found.

I am back again, its probably you have installed "apache2" instead of httpd, even though both are apache server. Type-

sudo systemctl status apache2

sudo systemctl start apache2

sudo systemctl enable apache2

sudo apachectl configtest

Let me know with the update.

answered a year ago
  • If I run "sudo systemctl status apache2" then I get the following output "Unit apache2.service could not be found.".

    If I run "sudo /opt/bitnami/ctlscript.sh status" then I get this output: apache already running mariadb already running php-fpm already running

    I posted this question on Bitnami forum https://github.com/bitnami/vms/issues/720 and to my question whether an issue is on Bitnami side, Bitnami says the following: "That's not possible. Bitnami pre-configures, packs, and publishes applications which can be deployed by end-users. Our applications are tested to work out of the box so it's unlikely that the issue is related to Bitnami configuration itself. Most of the time when the applications fail after deployment, it's due to either changes in the configuration or a lack of machine resources."

    (I did not experience any issues with performance)

0

It appears everything is fine by looking at the screenshots. I did not get which security group is attached with your EC2 whether it is default or other two-security group. There are many cURL and dig commands to troubleshot the DNS, HTTP, HTTPS, NS, SOA and the correct IP address maped with the FQDN. You are right, there is no EIP delete option.

Before that I would say clear your Browser cache, and flush dns cache from the system. Turn off your router for a moment and reset it. And even you can restart your computer. Without getting the full access of the system, I am unable to investigate any further. You can approach to AWS. Please take a snapshot, you can make an instance from the snapshot - before you make any changes of the current EC2. If you have any further questions, please do not hesitate to ask me. Finally, I apologise for any inconvience.

answered a year ago
  • Thanks for your quick response.

    I am very much stuck with this and don't have any ideas on what to do next. As you could see I posted the issue on multiple forums, but it did not bring me any further.

    Cache is emptied and routed is restarted. Site is still unreachable and it's been like this for 6 days already.

    Do you have any other concrete ideas regarding resolving the issue? I'd appreciate any help I can get.

0

I have an Amazon Linux 2 AMI with httpd, MySQL, and WordPress installed. I have activated a theme. All on a sudden, I could not access the website. I tried all the avenues, nothing worked. Then I thought, as I am trying so many times, may be my network treat it as a DDoS attack. I had stopped for a few days to open the website, you will be surprused that my website came back after a day or two. It is from my own experience.

One thing I did extra which was I added the IP with the server host's folder. In my case it is: "sudo nano /etc/hosts"

x.x.x.x domain name

Saved it and restarted the server.

You can have a look at the link: https://aws.amazon.com/premiumsupport/knowledge-center/route-53-fix-dns-record-resolution/

Please let me know. Thanks again.

answered a year ago
  • I found a solution - when I ran this command "sudo /opt/bitnami/ctlscript.sh restart" my site was up again. Hope this helps someone in the future.

    Many thanks for your help and guidance! I really appreciate it

0

I found a solution - when I ran this command "sudo /opt/bitnami/ctlscript.sh restart" my site was up again. Hope this helps someone in the future

answered a year ago
  • Thanks for letting me know, when you provided me the full details of your post, I saw this command in the bitname documents, and I thught you already applied this command. Good luck.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions