T
T
tutnet2014-02-27 17:38:10
Nginx
tutnet, 2014-02-27 17:38:10

Centos 6+NGINX+Rails+PHP-FPM: why can't I configure NGINX?

There is a server On CentOS 6.
Installed Ruby+Gems+Passenger+PHP5+PHP-FPM.
Initially, the server had the old nginx 1.0.x and Apache behind it.
Took out Apache. Launched passenger-install-nginx-module.
Compiled from source 1.5 nginx with a passenger.
Launched through service nginx start - everything works. The version of nginx shows the correct one, everything is ok with PHP, the progress did not reach the test of the passenger and the rails, but it does not swear at the config.
And then the questions begin:
1. When I try to stop or restart nginx via service start/restart, I get an error

[[email protected] ~]# service nginx status
nginx (pid 5600 5599) is running...
[[email protected] ~]# service nginx restart
Stopping nginx:                                            [FAILED]
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
                                                           [FAILED]

as a result, I can only restart nginx by killing process
2. I see on the 80th port 2 nginx-a, one running from under the root, the second from under the correct user. And when I kill the process of nginx-a launched from under the root, the second one disappears.
~]# lsof -i -P | grep *:80
nginx    5599  root    6u  IPv4 61531659      0t0  TCP *:80 (LISTEN)
nginx    5600 nginx    6u  IPv4 61531659      0t0  TCP *:80 (LISTEN)

Nothing else lives on port 80.
The question is almost rhetorical - what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
T
tutnet, 2014-03-06
@tutnet

The problem was solved by editing the file /etc/init.d/nginx

K
kenny_opennix, 2014-02-28
@kenny_opennix

attach the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question