• Hi there,

    I will try to describe the situation as accurately as I can, but please forgive any misuse of terminology.

    I have been attempting to configure a WP Multisite powered by Bitnami-4.7.1-1 on Ubuntu 14.04.3 on AWS EC2.

    I had set up a pressable account and with the help of someone migrated the site over to AWS.

    As part of the process I wanted to configure my site to connect my website domain – I assigned an elastic IP adddress which seemed to change the EC2 Instance of the and also meant I could not connect to the WP database.

    I can still connect via SSH and via my FTP client with the new Public DNS.

    I understand the problem is to do with wp-config.php, but I am not sure how I can configure that correctly, because I dont know what details to put in for DB_NAME, DB_USER, DB_PASSWORD, DB_HOST.

    This is because I dont know which DB to refer to, or where to look to find the necessary details. I tried connecting with phpMyAdmin, but Im not sure if I was doing this correctly and couldnt find the original DB listed there.

    When I examined the previous wp-config.php (which used to correctly connect with my site), it seems like it was pointing to a different directory which did not have standard EC2-XX-XX-XX-XX- etc configuration- and I can not see where to find that on the AWS Console.

    My Original DB_HOST was :
    mysite.c8iotvcyrnsp.ap-northeast-2.rds.amazonaws.com:3306

    The DB was from my original installation (migrated to AWS).

    Have read a few different guide but unable to work out until now. My site was working fine (despite not being fully configured) before I created the Elastic IP which threw everything into disarray…

    Im still struggling to successfully configure my WP multisite, subdirectories, domains, etc which seems to be quite challenging with AWS.

    Sorry for the lack of understanding – only being doing this for a few days now (although they have been very tiring days). Would appreciate any help/pointers! ??

Viewing 1 replies (of 1 total)
  • I am having the same exact issue. After you associate the elastic IP with your AWS instance that is running WP, Amazon puts the public ip addr back into the pool. That is, that ip addr is no longer valid. However, WP seems to think it is. I can FTP/SSH into the new machine fine. WP works fine *before* I assign the elastic IP.

    After I assign my elastic IP, things stop working. And I cannot seem to get back to my WP installation either.

    For some reason Apache is doing a redirect based on some WP (or possibly MySQL) config. Here’s what happens when I telnet:

    % telnet 123.123.123.123 80 <———– HERE’S THE NEW MACHINE AS PER AWS
    Trying 123.123.123.123…
    Connected to ec2-123-123-123-123.compute-1.amazonaws.com.
    Escape character is ‘^]’.
    GET / HTTP/1.1
    Host: ec2-123-123-123-123.compute-1.amazonaws.com

    HTTP/1.1 301 Moved Permanently <—— REDIRECT???? WHY?
    Date: Sun, 16 Apr 2017 03:39:28 GMT
    Server: Apache/2.4.25 (Amazon) PHP/7.0.16 <—- APACHE IS WORKING
    X-Powered-By: PHP/7.0.16
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    X-Pingback: https://ec2-999-888-777-666.compute-1.amazonaws.com/xmlrpc.php
    Location: https://ec2-999-888-777-666.compute-1.amazonaws.com/
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8

    Connection closed by foreign host.

Viewing 1 replies (of 1 total)
  • The topic ‘WP-Config.php Cannot Connect to Database after Assigning Elastic IP’ is closed to new replies.