EC2 instance not working after stop and start - amazon-web-services

I am new to AWS and learning through hands on labs. As per the instructions in the lab, I launched an EC2 instance, installed apache and displayed a simple index.html file when the instance IP was accessed. This worked great and when I was done for the day I stopped the instance. Now when I select the instance, go to Actions > Instance State > Start it shows me that the instance is running but when I enter the IP address in the browser I get an error message that says:
This page isn’t working
[IP ADDRESS] didn’t send any data.
ERR_EMPTY_RESPONSE
Why is this happening when I have not changed anything else in the instance? How can I get it to work and show the index.html file again? I see no errors in the AWS console. I tried creating a new instance, which worked, stopped it and started again and faced the same problem.

Based on the comments.
The issue was that apache was not starting automatically after instance re-start.
The solution was to enable the automate start of the web server.

Related

After SSH tunneling into localhost:6688 I get "site can`t be reached - ERR_CONNECTION_RESET"?

I finally decided to run a chainlink node on kovan, so I followed this link https://www.youtube.com/watch?v=t9Uknfw27IU&list=LL&index=8&t=555s on how to set up the node and after a few hours of work I made it happen. So after SSH tunneling into localhost:6688 I got the GUI for the chainlink operator and wrote in the password and got in.
So the next day I decided to program some jobs on the node and did the same thing as last day and got the
site can`t be reached - ERR_CONNECTION_RESET when SSH tunneling in localhost:6688 and I can see that the CL node is running in the linux box with no errors and note I dont own a router.
What I tried so far:
-switching browsers
-temporarily disabled the windows firewall
-manually opening up the port 6688
-deleting the VM instance on Google cloud platform and creating a new one
-double checking the .env file if database and other info from GCP and infuras
WSS were correct
-check the proxy settings
-cleared browser history and cookies
-deleted Winsock catalog entries
None of this has helped to resolve this issue, any help or suggestions would really be appreciated...
Managed to fix the issue myself, If anyone has the same error try this: go to your GCP and go to VM istances - firewall and add an exception for port 6688, then copy the externalIP , add it as your localhost= externalIP :6688...worked for me.

AWS EC2 address port not working all of the sudden. Node server

I'm not sure what's going on. I can SSH into my EC2 instance and start the node server. It starts with a console log of "started on port: 3000". Great. But when I try to connect to it from my website I keep receiving an error:
GET http://ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com:3000/socket.io/?EIO=3&transport=polling&t=MVhTWi5 net::ERR_ADDRESS_UNREACHABLE
Is this a problem with socket io file not being found?
Note that I was not having any problems for a month. Now all of the sudden I check my website out and boom this error. Any suggestions?
Error is being logged from the browser.
EDIT:
For some reason on one computer at my job I'm having the problem. When I go home to test it out on my other computer. No problems, the website works as intended

I can't connect to my aws instance anymore

I've been running tomcat on my Amazon EC2 instance for a few weeks just fine but all of a sudden, I became unable to connect to it. When I use putty I can connect to it fine but when I try to connect with my browser by using ip:8080 , I can't connect anymore. I've tried restarting the instance (and of course, adjusting my input ip accordingly), restarting the tomcat server within the instance, and checking the security groups. Nothing seems to work. I have no idea why it stopped working out of the blue. How should I proceed?
There are many reasons to why you cannot connect. The best way to solve this is to follow Amazons troubleshooting tips, found here.
I had the same issue. The amazon troubleshooting did not help. Then I remembered that I ad a line in my system32/driver/etc host file when I did some site migration.
Deleted that line and I was back in business again.
Hope that helped

EC2 Database through Laravel Forge has stopped being accessable

I've been running an instance EC2 through Laravel forge for about 2000 hours and this morning got this error while trying to reach it:
SQLSTATE[08006] [7] could not connect to server: Connection refused Is
the server running on host "172...***" and accepting TCP/IP
connections on port 5432?
After SSHing into the server I've getting a similar error when trying to run a command. I've dug through AWS but don't see any errors being throw. I double checked the ip address for the instance to make sure the IP hadn't changed for any reason. Of course I'm a little behind on my backups for the application so I'm hoping someone might have some ideas why else I can do to try and access this data. I haven't made any changes to the app in about 10 days, but found the error while I was pushing an update. I have six other instances of the same app that weren't affected (thankfully) but makes me even more confused with the cause of the issue.
In case anyone comes across a similar issue, here's what had happened. I had an error running in the background which had filled up the EC2 harddrive's log. Since the default Larvel/Forge image has a DB running within in the EC2 instance, once it ran out of room everything stopped working. I was able to SSH in and delete the log though, and everything started working again.
To prevent the issue from happening again I then created an amazon RDS and used that rather than the EC2 instance. It's about three or four times the price of just an EC2 instance, but still not that much and the confidence I now have in the system is well worth it.

Scheduling the opening of Chrome on EC2 startup

I currently am using the ec2 API to launch an instance of windows server. When the instance has started, I want to open up chrome to a specific webpage before I need to RDP into the server for a specific profile. I have tried setting up a task scheduler and working with user scripts to do this, but I haven't had any luck getting to work properly. What would be the best way to start up a program right when an instance starts?
Thanks
It might be better to not launch chrome when the instance starts (having chrome running serves no purpose if no user is logged in), more likely you want to run a program when a user starts an RDP connection:
http://technet.microsoft.com/en-us/library/cc770821.aspx