PhpMyadmin not working on AWS EC2 instance - wordpress

I created an EC2 instance on AWS and hosted Wordpress powered by Bitnami.
I used t2 micro to select free tier and successfully published with custom keyfile.
Anyhow, I need to host existing code to this hosting and I have issues accessing phpmyadmin.
It says "For security reasons, this URL is only accessible using localhost(12.0.0.1) as the hostname.
I have tried several solutions but cannot find the exact conf file.
Thanks in advance, please help me.

I don't know what your current setup, but while a year before I face the same issue while setting up my company website.
edit config.inc.php file in your phpmyadmin installed folder .
Default path is :
sudo vi /opt/bitnami/apps/phpmyadmin/htdocs/config.inc.php
search for
$cfg['PmaAbsoluteUri'] ='http://127.0.0.1:80/phpmyadmin';
edit the 127.0.0.1 to your domain IP or domain name
hope it resolve your issue.
I forgot the reference link where I got these detail I will add it later.
Restart apache after all

Below is one of the solutions I found.
ssh -N -L 8888:127.0.0.1:80 -i *.pem #...*
This maps the phpmyadmin on user's localhost so the user can access using http://localhost:8888/phpmyadmin.
Hope this helps.

Related

How to fix a cloned AMI with another domain SSL certificate on it for Wordpress on AWS?

In 2018 I made a Wordpress site by using a Bitnami AMI for a AWS EC2. Fine developed a site and created another custom AMI of the finalized Wordpress site. This was for domain X.
Now in 2020 I wanted to duplicate that website by using this custom AMI for domain Y. I have created an EC2 based on that custom AMI and instance went online without problems.
The problem is now that I can not reach the site by its url, I got blocked by "This connection is invalid", I also see that certificate is still based on the domain of 2018, thus is invalid. So I think that the issue is caused by the SSL configuration based on domain X while it is iinitiated for domain Y. But since I am not able to reach the site neither the admin panel, I am wondering how I can disable the SSL/HTTPS enforcement so that I can reach the site and admin panel?
I do have access to SSH, so probably I should be able to do something from there? But totally not known with that type OS and usage via SSH.
Bitnami Engineer here,
As you created a snapshot of the 2018 instance, the new instance has the same configuration you had at that time. Please check the following items so you can update the certificates and the app's configuration to work properly using your new domain name:
The certificates are configured in the /opt/bitnami/apache2/conf folder by default. You probably substituted the ones we include with valid certificate files for your domain in 2018. You will need to substitute the server.crt and server.key now with the new ones.
https://docs.bitnami.com/aws/apps/wordpress/administration/enable-https-ssl-apache/
Regarding the WordPress configuration, we have configuration tool that takes care of updating the domain name in the database. Can you take a look at this guide?
https://docs.bitnami.com/aws/faq/configuration/configure-custom-domain/
You will basically need to run sudo /opt/bitnami/apps/wordpress/bnconfig --machine_hostname my-new-domain.com.
I also suggest you check the WordPress' configuration file (/opt/bitnami/apps/wordpress/htdocs/wp-config.php) to see if you edited the WP_HOME and WP_SITE parameters there.

How to install Wordpress on subdirectory of my domain using Aamazon Web Server

Hi, I am trying to install a WordPress in a subdirectory
"domain.com/wordpres". But I don't know anything about Amazon Web
Server. I tried youtube and google. but they only show that how to
install WordPress on AWS. nothing more in deep detail.
Please help me, if anyone knows how to install WordPress on a subdirectory of my domain on the AWS server, or suggest me any proper post/tutorial.
Thanks.
like say the guys, you need install wordpress normally.
First your need connect with your instance, this is a virtual server, the ssh protocol is commonly used.
I recommend read the documentation.
For linux instance: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html
For Windows instance: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html
Second step is install your web server normally, LAMP or WAMP depending your instance, i recommend apache, mysql or MariaDB and the last version of php, but exist a lot web servers softwares for your choice. If you have not a experiencie read this: https://docs.aws.amazon.com/es_es/AWSEC2/latest/UserGuide/install-LAMP.html
Finally your need download the need version of wordpress, edit config file (wp-config.php) and run.
If you have not a experiencie read this: https://docs.aws.amazon.com/es_es/AWSEC2/latest/UserGuide/hosting-wordpress.html
Note: If you need "domain.com/wordpress" is possible with VirtualHost in apache.
Documentation: https://httpd.apache.org/docs/2.4/vhosts/examples.html

AWS: Wordpress install

I hope you can help.
I'm trying to setup a wordpress blog. In the past I've been using HostGator but now making the switch to AWS. However, I'm having problems with the basics.
I have created an instance and managed to login to the instance via putty.
In S3 I have created 2 buckets. lmof.uk and www.lmof.uk (following one of the AWS guides) and uploaded a php file to lmof.uk
In Route 53, I have added the Domain to the Hosted Zone, created A record and CNAME as well.
Updating my Nameservers from my register and if you visit lmof.uk it downloads the php file.
When I log into my Putty, I can't seem to find the php file anywhere. I followed this guide: https://www.youtube.com/watch?v=PbQSs-_d-yM but when it came to looking at my public ip address, the connection times out.
I'm sure I'm missing something fundamental, but at this stage I'm just looking to install wordpress, see the files, edit them and see the changes on the website.
you forgot to open port 80 on security groups.follow the link below
Opening port 80 EC2 Amazon web services

Wordpress on AWS EC2 - broken after assigning elastic IP

So, I got Wordpress installed and working just fine. I can access the site and the wp-admin via the public DNS that I get from the instance.
However, once I create an elastic IP and associate it with the instance, I can no longer access wp-admin and the home page style sheets and JavaScript files are not loaded.
I am attempting to access the site and the wp-admin using the new public IP from the elastic IP. Same thing is true if I try to use the public DNS from either the elastic IP or the EC2 instance.
When I view the page source I see that the reason things aren't loaded is because the URL for all of the assets (.css, .js. etc,) is pointing to the bold public DNS
When I disassociate the elastic IP things do not go back to working again.
I'm missing something but don't know what.
Any help would be appreciated
Your wordpress admin is already associated with your publicDNS. This is because, when you have logged-in the wp-admin console, you have created a new admin user. This information with respect to your publicDNS was saved in the mysql db. So you won't be able to access wp-admin from the elastic IP.
What you can do ?
You can log-in to your wordpress mysql and update all the references of the publicDNS to Elastic IP. Once it is done, you will be able to access the wp-admin from the static IP.
I run into the same problem. A quick fix is to hardcode your site URL into the wp-config.php which you can edit via FTP.
define('WP_HOME','http://yoursite.com');
define('WP_SITEURL','http://yoursite.com');
Worked fine for me.
See also https://codex.wordpress.org/Changing_The_Site_URL for guideline.
I too faced the same issue, followed the steps in this page to get my issue fixed.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html
Follow steps under this section:
"Help! My Public DNS Name Changed and now my Blog is Broken"
Pasting it here for quick reference: Login via ssh to your ec2 instance then run the below commands:
Download the wp-cli with the following command
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Search and replace the old site URL in your WordPress installation with the following command. Substitute the old and new site URLs for your EC2 instance and the path to your WordPress installation (usually /var/www/html or /var/www/html/blog)
php wp-cli.phar search-replace 'old_site_url' 'new_site_url' --path=/path/to/wordpress/installation --skip-columns=guid

Change default URL on bitnami EC2 application

I'm running wordpress on a micro EC2 instance using a bitnami AMI (ami-8333ffea to be exact) but I think this question applies to any bitnami cloud application. I've designated an Elastic IP and mapped a subdomain to the instance (e.g., blog.example.com). So far, so good.
Now I can access the blog but the URLs all contain '/wordpress' (blog.example.com/wordpress/.../). Bitnami has documentation (click 'Cloud Image/Bitnami Hoting' tab) for fixing this but I've tried following it several times without success. I make the changes, the site still works but '/wordpress' is still there taunting me. The machine is running Apache2 and the instructions all seem to make sense. I'm not sure what I'm doing wrong. Please help.
Probably the WordPress siteurl setting was not updated. The following command has to be executed:
sudo /opt/bitnami/mysql/bin/mysql -u root -p -e "use bitnami_wordpress; update wp_options set option_value='http://blog.example.com' where option_name='siteurl' or option_name='home'"
Make sure that you substitute "blog.example.com" in the example above with your own domain name.
And after changing the httpd.conf file, the Apache web server should be restarted:
sudo /opt/bitnami/ctlscript.sh restart apache
You can take a look at the BitNami Cloud Hosting article explaining how to assign a custom domain to your server, you can directly jump to the 6th section.
If you have BitNami specific questions, consider visiting BitNami Support page bitnami.org/support.

Resources