Issue on stoping and starting aws Ec2 wordpress(centos 6.9) vm - linux

I have configured wordpress in a lamp setup in centos 6.9 server.
It's an aws ec2 instance. When i stop the vm and start it again database connectivity of wordpress is lost.How do i resolve this?
I tested by rebooting from inside vm. At that time everything is working fine. But not when i stop and start from aws dashbord.. any solution?

I think the issue might be with your mysql service , after rebooting if you have not specified that it should run at start of server it would not run.
Also Make sure you have connection string as localhost and Elastic (Static) IP assigned to it.
If that is the case you can resolve it by adding the service to run every time instance start by this command:
sudo chkconfig mysqld on

Related

How to install kubernetes using kubeadm on a host walready running docker multi container application

I'm trying to install kubernetes on one of my centos host using kubeadm. But in the same host, there is already running microservices multicontainer application. When i enable the firewalld service while installing kubernetes to allow the ips which are required to the kubernetes, my docker multicontaier application is flushing off its connections. Could anyone please help me to install kubernetes on the same host while my docker application running smooth ? I've tried sequentially starting the applications such as starting docker demon after the firewalld and vice versa but it also not working.
I've done this by switching off the firewalld and letting kubern8s to choose its own ports.

Network Error when I try to run React web on AWS

Sorry maybe it is a dump question but I could not go further.
I got a website which already built with ReactJS and working on AWS Ec2
When I run on localhost
First; in terminal which in file directory run node server.js
yarn start
then I can see the localhost:3000 then when I make any changing just send with SSH and run server with PM2 which pm2 restart server
My question is I want to create a second AWS EC2 instance and run the code there as well when I change config.json which domain is store there I can see a NETWORK ERROR
I created a ec2 instance copied all my files there and I installed NodeJS npm and pm2 but I could not managed see my website on localhost:3000()
What Do I have to do?
You need to use the EC2 public address/IP not localhost

Connecting app to AWS EC2 instance

I'm pretty new to DevOps and I'm trying to set up my Node.js app on a AWS server instance. Steps I've taken:
Set up Elastic IP
Launched EC2 instance with Ubuntu server
Connected IP to instance
Allowed incoming connections on port 3000
SSH'd into the server with a .pem file
Now I'm at the point where I need to get my files uploaded to the server. I've used FileZilla (and like it) in the past to upload files but the initial part was already set up. When I set up the site on FileZilla there is no /var/www folder on the remote site.
Don't know how to connect these dots.
Also not sure what I need to run once I successfully upload the files. I imagine npm install when I'm ssh'd into the server? Most of the tutorials out there only go through the basic instance setup.
Thanks!
You don't need to have /var/www. Also, it's better that you use a version control and a remote repository like Github and then SSH to your EC2 and then clone your repository there.
Then cd into your repo and run npm install and then start your app.
And check.
Once you connect to the EC2 instance then clone your code in there. It not mandatory to be in /var/www/html but, it's best practice to keep it there. Once you clone npm install into your project home directory so all the required packages get installed. Then for running your node application in production you have to run it on service as pm2, supervisor, forever, passenger, etc. You can use any of these services and configured appropriately to run your application on desired port. As with pm2, you can follow this guide, install pm2 Then you can run with the following command w.r.t. your environment, like I want to run my application on port 5555 for production
$ PORT=5555 pm2 start app.js --name API --env production -f
Check the status using pm2 list Now, your application is running on http://server-ip:5555/ But, you won't be typing port number every-time. So, you need to configure the web server in front of your application like apache or nginx which will forward all request to your application running port. You could find the best guide to their home page. Then your application is available at http://server-ip/ You can follow this for single configuration of multiple node apps
Hope this helps.

First time setting up Ghost blog on Amazon Ec2 various noob questions

Ok so here's some quick info about my setup:
-Amazon Ec2 instance with an elastic IP associated to it
- Latest versions of node and Ghost
- Using Windows 8 with Putty
- Domain from Namecheap
So I installed ghost and node on my Amazon EC2 instance using this guide: http://www.bybigs.com/setup-ghost-on-amazon-web-services/
Everything went well(I think). Just at the part where I have to change the IP addresses I'm not sure I did everything correctly. Do I have to change every IP address I see? I found a lot of 127.0.0.1 adresses that I went ahead and changed to my private IP from AWS. I also changed the link to my domain.
The problem I've run into now is the last step: So, type npm install forever -g and once that's done you can start the server by typing NODE_ENV=production forever start index.js, and you can close the SSH window.
I seem to get quite a few error messages when I type in npm install forever -g so I don't even move on. But when I type in npm start everything seems to be ok.
Now my other problem is with my domain. I bought it on namecheap and read online I need to change the A record to point to my elastic IP. I've done that for the A www and # record. Is there anything else I need to do?
When I go on my domain it shows up as this page cannot be displayed. So something must have gone wrong along the way. Can anybody help a noob out?
Can you post the output when you run npm install forever -g?
You only have to change the IP address in the production section.
Is there a particular reason you want to use Forever? If the only reason is because of the tutorial you linked to checkout out my post on running Ghost with pm2.
Lastly, if you do not want to do the setup to get Ghost running on an EC2 instance you can use our AWS AMI. The AMI has everything pre installed and running so you just have to launch it.

Couldn't resolve host 'bucket.s3.amazonaws.com' on virtual machine

Serving static pdfs from S3. Have a production environment on AWS and a development environment on my local Vagrant Virtual Machine. Everything was working fine until today.
When I try to access S3 files from my Vagrant development environment, I get
Couldn't resolve host 'bucket.s3.amazonaws.com'
I can still access the files as normal in my AWS production environment. The code to access is the exact same.
Other notes that may or may not be relevant
The VM was reset this morning. It has not worked since.
I've tried to flush the DNS -> ipconfig /flushdns
I've cleared the browser cache
Thanks for any help.
What do you mean by "the VM was reset" ? I've run into problems when I forget to put the VM into suspend and then change networks on the host machine. I won't be able to resolve anything after that. To fix I just did a vagrant suspend && vagrant up to have it refresh its network.
I faced a similar issue when tried to fetch S3 files using vagrant on openstack, solved it by configuring DNS on my openstack subnet.
(meaning the DNS issue wasn't related to the vagrant vm configuration, it was related to the openstack configuration, you can verify it by running: cat /etc/resolv.conf from your vagrant vm)

Resources