Skip to content

Server is not connected through bitnami

1

Need help urgently Website was working fine but found CORS error so tried to enable on bitnami using below solution. https://repost.aws/knowledge-center/lightsail-activate-cors-wordpress

After that server not responding status displaying Cannot find any running daemon to contact. Please help As soon as possible how to resolve

asked 10 months ago71 views
1 Answer
0

Greeting

Hi Viral!

Thank you for reaching out. I understand you followed some guidance to enable CORS on your Bitnami WordPress site hosted on Amazon Lightsail, but now your server is unresponsive and showing the error "Cannot find any running daemon to contact." That’s a frustrating situation, and I’m here to help you troubleshoot and resolve it. Let’s get everything back up and running smoothly! 😊


Clarifying the Issue

From what you’ve shared, your website was functioning correctly until you tried to activate CORS using the referenced guide. After editing the configuration file and restarting Apache, the server stopped responding. This issue likely stems from an incorrect configuration or syntax error in the file, which prevents Apache from restarting. Don’t worry—we’ll verify the configuration, fix any issues, and ensure CORS is enabled securely.


Why This Matters

CORS allows your website to share resources like APIs or assets with other domains. Misconfigurations can cause service disruptions, making your website inaccessible to users. Addressing this ensures your site can communicate securely with external services while staying functional for your visitors.


Key Terms

  • CORS (Cross-Origin Resource Sharing): A mechanism that allows resources on your website to be accessed from other domains.
  • Apache: The web server software running your WordPress site.
  • Daemon: A background process, like Apache, that handles requests on your server.
  • Bitnami: A pre-configured stack for running WordPress and other apps on Lightsail.

The Solution (Our Recipe)

Steps at a Glance:

  1. Verify Apache is running.
  2. Check the configuration for errors.
  3. Back up configuration files before editing.
  4. Correct the vhosts.conf file if needed.
  5. Restart Apache and confirm functionality.
  6. Verify CORS activation.
  7. Check Apache logs (if necessary).

Step-by-Step Guide:

  1. Verify Apache Status
    Run this command to check if Apache is running:
    sudo /opt/bitnami/ctlscript.sh status
    If Apache isn’t running, proceed to the next step.

  1. Check the Configuration for Errors
    Use this command to test the Apache configuration for syntax issues:
    sudo apachectl -t
    If there’s an error, the output will indicate the problematic line. Take note of it before moving forward.

  1. Back Up Configuration Files
    Before making changes, create a backup of the vhosts.conf file:
    sudo cp /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf.bak
    This ensures you can restore the original file if needed.

  1. Correct the vhosts.conf File
    Open the file with a text editor like vi:
    sudo vi /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf
    Ensure the Header set Access-Control-Allow-Origin directive is placed correctly within the <Directory> block:
    <Directory "/opt/bitnami/wordpress">
        Options Indexes FollowSymLinks
        AllowOverride All
        Header set Access-Control-Allow-Origin "*"
        Require all granted
    </Directory>
    Save and exit by pressing Esc followed by :wq!.

  1. Restart Apache
    Apply the changes by restarting Apache:
    sudo /opt/bitnami/ctlscript.sh restart apache
    If this fails, check the syntax and logs for further clues.

  1. Verify CORS Activation
    Test if CORS is active by running:
    curl -I <your-website-domain>
    Replace <your-website-domain> with your actual domain. The response should include the header Access-Control-Allow-Origin: *.

  1. Check Apache Logs (If Necessary)
    If Apache still won’t restart or the issue persists, examine the logs to find the root cause:
    sudo tail -n 20 /opt/bitnami/apache2/logs/error_log

Closing Thoughts

Here are some final tips and helpful links to ensure success:

  • Always back up configuration files before editing them.
  • Avoid using Access-Control-Allow-Origin "*" in production for security reasons. Replace it with your specific domain once verified.
  • Consult the logs for error details if Apache fails to restart.

Helpful links:


Farewell

Best of luck resolving this issue, Viral! You’ve got this, and we’re here to help if you need any additional support. Let me know how it goes. Wishing you success with your WordPress project! 🚀😊


Cheers,

Aaron 😊

answered 10 months ago
AWS
EXPERT
reviewed 10 months ago

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.