Configuring the connection in AWS with a Database - php

recently I made an account in AWS, uploaded my project in github and installed it in EC2. When I run the link - http://ec2-54-213-242-40.us-west-2.compute.amazonaws.com/BlueDrive/bluedrive/drive/public/ I get some errors. Well that's obvious because i haven't set a DB in AWS. Despite the fact that in config/database.php i editted some of the parameters such as host, in the error it still displays that the host is localhost. Why is that?! Also I would like to ask how to make a DB in AWS, create the tables and so on. Can I somehow import my db.sql with all the relations in the tables?

Related

Deploying application in elastic beanstalk AWS

I created multiple REST api's for my website on a local server(wamp) and now i am trying to move it to a online server(aws elastic beanstalk). My question is where do i build my database with the tables and rows etc just like in phpmyadmin? I figured that "upload and deploy" means upload the php file i made but when i do i get an error saying "health degraded". So what i want to do is basically move my local server to an online one with aws EB. I watched a bunch of videos and did a lot of research but can't seem to find the way to go about this problem.
My question is where do i build my database with the tables and rows
etc just like in phpmyadmin?
You can connect to the RDS instance created by beanstalk using a Database Management Client Tool like MySQL Workbench, Heidi SQL & etc using the DNS name, created for RDS instance. However one challenge you will face is to access the RDS instance from your client machine, since its not a good practice to make the Database publicly accessible. You can create a EC2 instance (Windows or Linux with GUI) inside the same VPC, connect to it (Remote Desktop or SSH) and install the tools so that you can use the tools inside the server, to connect to the RDS instance.
I figured that "upload and deploy" means upload the php file i made
but when i do i get an error saying "health degraded"
To understand the structure in code inside the Zip file, I would recommend to create a Beanstalk environment with a sample project available in Beanstalk and download the sample project artifact (Zip file) from S3 so that you can compare the project structure requirements.
If you prefer to go through the documentation, you can refer this. If nothing goes well, connect to the ElasticBeanstalk provisioned EC2 instance (Either using Remote Desktop for Windows or SSH to linux) and investigate the deployed artifacts.

Cannot connect to Sql Server in Amazon RDS with Codeigniter

I have an application that has been developed with Codeigniter. It uses an SQL Server database, hosted in an Amazon RDS Instance.
The application is using the mssql driver (I can't change it to sqlsrv, unfortunately).
The RDS instance is ok, I tried connecting to the database from an SQL Server client, and everything works perfect, but when I try to connect it in the CI application, I get the classic "Unable to connect to your database server using the provided settings." error.
Is there a way to have a more descriptive error thrown by CI? I have lost a lot of time trying to solve this issue and I really don't know what else I should look.
Notes:
This was working fine some days ago. I had to make a copy of the CI app (which is hosted on an Amazon EC2 instance). I shared the AMI to a different AWS account, and created a new instance with it, but didn't change anything in the volume. Everything has been exactly copied from one place to the other.
Php info tells me that the mssql driver is there and it is correct.
The Security Groups in the RDS instance and the EC2 instance, are open to the world (I deleted all the restrictions in order to see if that was the problem)
I will really appreciate any kind of help.

Deploying Codeigniter App on Amazon AWS

I recently enrolled to basic version of Amazon AWS. I was able to create a new instance and get it running state in the console. Can anyone please guide how to upload a sample php file and redirect to GoDaddy domain.
Read a lot of their online help but couldn't figure out the procedure.
Please follow the following steps. This is for Ubuntu 14.04
Setup an Web server with database and PHP
Refer: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
Install PhpMyAdmin for setting up database
Refer: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04
Upload your database through PhpMyAdmin dashboard.
Connect to sever using SFTP clients like FileZilla or WinSCP.
Goto your webroot directory (By default /var/www/html) and upload the code.
Change the database username, password & database name in the database configuration file of your app code.
Login to Godaddy domain section and create an A record for the domain and set value as the public ip of your AWS Instance.
It will take some time to reflect in DNS. Meanwhile you can test the working of application by going to the public ip of AWS Instance.

Wordpress Duplicator Installer on Heroku

I've built out a wordpress website locally and now I'd like to deploy it from localhost to an actual web address hosted on Heroku.
I've created a new sql database on my newly created Heroku site and am using the Wordpress Duplicator plugin to transfer everything over.
I've pushed all my files onto heroku master, and I've installed the Duplicator installer.php and .zip files.
However, when I actually try connecting to my Heroku data from the installer, it pauses for a while and gives the following error.
"An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!"
Am I missing something in regard to connecting to Heroku databases externally? What's the best way to get wordpress up on Heroku?
Note that the SQL connection string for your app deployed on heroku is very definitely not localhost. In particular:
If you've been using mysql for local deployment, you will need the ClearDB plugin added to heroku; instructions on how to optain the endpoint for the ClearDB database are here: Remote connect to clearDB heroku database
If you're planning to deploy wordpress using the postgresql database, you need to add the postgresql add-on, and configure wordpress to it. There's already instructions, and a full repo for wordpress-heroku that you may peruse
Hope this helps.

Laravel 4 Connect to EC2 MySQL from remote domain

Not sure if what I am attempting to do is possible or not. I just launched my very first EC2 instance running Ubuntu 12.04 and successfully installed Laravel 4. I have the database working just fine on the EC2 instance and I am able to connect to it with MySQL Workbench on my local machine using a .pem SSH key.
I will be using EC2 to handle certain aspects of a product that I am developing to ensure improved reliability - client side users will be interacting with this primarily through CURL. I want to be able to have my non-EC2 website, also running Laravel 4, use the MySQL database that I set up on my EC2 instance.
I tried changing my app/config/database.php file to include the EC2 instance IP address and MySQL credentials, when Laravel attempts to connect it returns a timeout error.
I modified my.cfn and commented out bind-address = 127.0.0.1, I do not seem to have the skip-network that I have seen mentioned. Still no joy.
Any suggestions?
In side MySQL (PhpMyAdmin if you installed it) -> Users overview -> Edit your user with Host is
%
That is mean, you can connect to MySQL in anywhere with command
mysql_connect($IpOfYourHost, $UserAbove, $Password)
Maybe this helps you. :)
Resolved
I changed bind-address to 0.0.0.0, created a new MySQL user - 'user'#'%', and had my host whitelist the IP. Done!

Categories