Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed nginx by doing sudo yum install nginx and I'm unable to connect to it on port 80.

I tried stopping iptables by doing sudo service iptables start and was still unable to connect.

I'm testing this out by doing telnet localhost 80. Here's the output I'm getting back:

Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

When I try telnet localhost 22 it works as I'd expect it to:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3

Any ideas?

share|improve this question
up vote 4 down vote accepted

Are you actually running it?

I'd do:

netstat -lnt | grep 80

and see if something is actually running. If you're root, you could do:

netstat -lntp | grep 80

And it would show you the PID as well.

If you just brought it down, I wouldn't guarantee it's configured to run on port 80 anyway. It may be configured for another port, for testing.

share|improve this answer
    
That did the trick! Apparently I didn't do "sudo nginx". idk... on Ubuntu when I do "sudo apt-get install openssh-server" it's started automatically and the keys are auto-generated. Kinda figured nginx / yum would behave similarly. Guess not. Thanks! – neubert Mar 26 '13 at 20:55
    
Fedora/RHEL do not activate services just because you install them. – vonbrand Mar 26 '13 at 23:54

Try:

http{
  server {
    listen 80;
    listen localhost;  # <-probably will fix your problem. 
    location / {
      root /data/www;
    }
    location /images/ {
      root /data;      
    }
  }
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .