So I rebooted an EC2 instance. When I went to pull that website up that links to that instance it is now down with a 521 error saying the website is down. We used Nginx as a web server.
I haven't tried much as I am not familiar with this issue. I do know that I should be trying to restart nginx I just do not know in what directory.
If everything was working fine for you then you can simply bring up the ngnix on ec2 machine using below command :
sudo service nginx restart
Config file for NGINX was not pointing to the correct website. I guess someone changed the file and me rebooting it enabled the changes. Just went into config file and changed the site back to the one I was using rebooted and bingo.
Related
I developed a Ruby website and in order to deploy it, I followed this tutorial. Everything went well, but I skipped all user switching operations because I really didn't see the point of it, and to be honest maybe this is the problem.
My problem is that the server is running, as we can see
And I can do a successful curl on it using the local machine, but I can't access it online.
To be honest, it's the first time I'm deploying a website ever so I'm sure I'm just missing an obvious thing (a DNS maybe), but I don't really know what.
The problem might also come from the fact that I'm using the passenger and Nginx binaries given by the passenger gem installed. I didn't install passenger and Nginx on my system so it's using the binaries from the gem.
EDIT:
Thanks all for the current answers, I think the problème, as stated by the first comment under this question is that I'm not using the default server port configured by Nginx but another one, so I'm gonna try to add my port in the Nginx config file.
And to clarify a bit, because I don't have a server name, I'm running my tests using :
curl ipaddress:port
EDIT 2:
I just tried looking at the config file and it appears that the passenger is generating an Nginx config file (because it uses its own Nginx standalone binary to run) that looks like that, so the port must not be not the problem.
Maybe I really have no choice but to use port:80 but now I'm not even sure if I can ping the Nginx standalone from outside my VM, I'm a total beginner with Nginx
EDIT 3:
A netstat gives me this
So the nginx server is really running, but how can I access it? Because curl ipaddress:8080 (I changed the port since the first try with 90 and replaced it with 8080) is not working. But on the local machine a curl on 0.0.0.0:8080 is still working.
This is my first experience with Forge. So I created DigitalOcean account, had Bitbucket from before, made repository. Added .env to environment variables in Forge.
On server IP adress getting
This site can’t be reached
Try:
Reloading the page
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
What am I missing?
Somehow when server was installed it did not install nginx, and all what was necessary. In Forge was listed what was installed and that was clearly missing. So I decided to destroy it and install new server. New one works like it should.
I have to do part of a college project on amazon instance. The lecturer set up the instances for the year, supplying us with the public DNS and KEY.
Having downloaded WINSCP to make it easier etc. I find that after i have created my html pages etc i cannot access them from the web.
IM assuming that that http://ec2----.compute-1.amazonaws.com/home.html should open the file ???
Any help would be apprciated
A few things.
httpd -v will tell you what version of http is installed. But it doesn't tell you whether or not its running. Use service httpd status to see if its running.
Check the apache config file and make sure you put the index.html file in the correct directory.
Verify that you can access port 80 from outside the instance. Its possible there is a firewall in amazon that the professor has not unlocked.
Download PuTTy and configure it to access your ec2 instance on terminal. Install any web server e.g Apache or you can install LAMP directly to make your file accessible on web.
Today is my second day of trying to use amazon and i have started to pull my hairs. I want to set up ftp with amazon. I have signed up with them and and created an instance with amazon EC2. I have downloaded the key and I am able to login with ssh using the through Terminal in my mac. I can create files in the instance through terminal.
The instance is something like following:
Public DNS: ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com
I have created a index.html file at this location via terminal. But I am not able to view it in the browser using following url:
ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com/index.html
I just want to create web services here which I will be using in iPhone.
Also I am not sure how to go forward. How will I get to my local files and upload them to server. In other ftps I could do it using lcd, get, put etc but these commands are not working here. can some one please help me how should I go ahead because at this moment I am just banging my head to wall. Someone please help me.
Thanks
Pankaj
Use scp to copy files over ssh:
scp -i key-pair-file file-to-upload ec2-user#instance-public-DNS:
Notice the colon at the end!
With plain EC2 instances, you also need to install some sort of Web server software to power your Web service, and open the HTTP port in the firewall.
Just in case you plan to write your Web service in Java, I have put together a series of articles (Part I, Part II, Part III) guiding through the basics of installing Apache Tomcat on an Amazon Linux EC2 instance.
EDIT 2014/11/20
Dmitry Leskov is actually the better one. You should use his approach.
Answer from 2012
You first have to setup a LAMP (Linux, Apache, mySQL, PHP) stack on your EC2 instance to run any kind of web service.
This means you have to go trough the following steps:
Create an EC2 instance
Setup EBS Storage for mySQL data
Install mySQL
Configure mySQL
Install Apache
Configure Apache
Install PHP
Configure PHP
If you need a detailed instruction, I'd recommend you to take a look at this: Building EC2 with LAMP.
To transfer files to your EC2 instance you can use any FTP client, which supports SFTP and key pairs (you can also enable PasswordAuthentication for SSH to login with credentials). I'm using Transmit with no problems.
On a related note, I encountered a strange problem where I could not FTP from a PHP script running under apache - but I could if I ran the PHP script as root from the command line. After a day of googling, I found this, which solved the problem.
Disable SELinux. (Security Enhanced Linux)
The temporary solution is:
echo 0 >/selinux/enforce
..which will prove the concept, but will not survive a reboot. There are plenty of resources out there that describe how to permanently disable SELinux.
I am having trouble browsing to my team city(JetBrains) from a remote machine. I have followed the install directions and the install went smoothly. I can browse the to application locally on the server, no problem at all. I changed the default server url in the config file to be http://my servername . I can browse to http://my server name and the application shows up no problem locally. The application is alos installed on the default 80 port of the server with no other web server installed.
If I browse to http://my servername from my laptop on the same domian nothing happens. When I run diagnostics it seems to pick up the webserve but it fails to respond.
As a test I uninstalled the app and installed IIS to see if I could browse to the default IIS page remotely. This worked no problems at all. I uninstalled IIS, ensured nothing was hogging port 80 on the server. Reinstalled the applicaiton, configured it exactly the same, still nothing. The application works fine locally, but I get nothing remotely.
I was just wondering if anybody knows anything else I can try? or is there a setting in tomcat I need to tweak?
I just updated TeamCity from 7.0 to 7.1, and now I have the exact same issue.
However, what turned out to be the cause had nothing to do w/ the TeamCity upgrade. It turns out our system administrators had setup a policy update to block all incoming connections other than port 80. When I started my upgrade, I noticed the server wanted to do some system updates. So I let that go first.
I suspect that had I tried to access the TeamCity server after the system update, I'd have realized I could no longer access the website remotely.
But since I only noticed it after the TeamCity update, I assumed it to be the culprit and wasted a bunch of time on that red herring.
The solution for me was to
Open Windows Firewall on the server
Click on the root level option in the left-hand pane
Make sure under each of the profile sections, that inbound connections are allowed.
(#3) was my problem.
Hope this helps someone else out in the future...
Verify that the server is running on port which is not blocked by the firewall. Change the port if necessary.
Tomcat also supports binding to specific IP addresses, in case your machine has multiple IPs, you can configure which one to use in server.xml, like:
<Connector port="80" address="10.10.10.10" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Where 10.10.10.10 is the IP of the server which can be accessed from the remote machine.
Check the server logs to ensure that it's started on the correct IP/port and is accepting connections.
I just faced the same issue when evaluating TeamCity v10.0.
I solved it by changing the 'Server URL' value with the name of my computer that can be used from remote computer.
As they say, "make sure the server is accessible by the URL specified".
To reach this setting:
- Login to TeamCity interface then
- Click on the 'Administration' link
This is well explained in the TeamCity support page:
https://confluence.jetbrains.com/display/TCD10/Configuring+Server+URL
The problem is that TeamCity's default server.xml has localhost as the host name. You need to add an alias for it answer that name as well, as described here:
http://tomcat.apache.org/tomcat-4.0-doc/config/host.html#Host%20Name%20Aliases
Ryan