LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-05-2016, 03:27 AM   #1
hilou
Member
 
Registered: May 2013
Posts: 93

Rep: Reputation: Disabled
Why nginx listening on worker


Hi All,

I just find that my nginx is listening on worker. But why ?

Code:
# netstat -tlnp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      23620/nginx: worker
I can see that some listening on master, some on worker.
 
Old 07-05-2016, 07:56 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,666

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by hilou View Post
Hi All,
I just find that my nginx is listening on worker. But why ?
Code:
# netstat -tlnp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      23620/nginx: worker
I can see that some listening on master, some on worker.
Since you tell us ABSOLUTELY NOTHING about how you have things configured, version of nginx, version/distro of Linux, etc., what do you think we'll be able to tell you? Read the "Question Guidelines" link in my posting signature....and perhaps the Beginners guide to nginx:

http://nginx.org/en/docs/beginners_guide.html

Pay particular attention to the second paragraph.
 
2 members found this post helpful.
Old 07-06-2016, 01:25 AM   #3
hilou
Member
 
Registered: May 2013
Posts: 93

Original Poster
Rep: Reputation: Disabled
Sorry, it's absolutely my fault.

Code:
nginx version: nginx/1.8.0
Linx distro: CentOS Linux 7 (Core)

Nginx main config:

user  nobody;
worker_processes  100;
events {
    worker_connections  1024;
}
http {
    server_tokens off;
    include       mime.types;
    default_type  application/octet-stream;
    server_names_hash_bucket_size  64;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
 
Old 07-06-2016, 01:28 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,925

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
probably this helps:
http://nginx.org/en/docs/beginners_guide.html
I think it is the "default" design
 
1 members found this post helpful.
Old 07-06-2016, 02:24 AM   #5
hilou
Member
 
Registered: May 2013
Posts: 93

Original Poster
Rep: Reputation: Disabled
Could you please explain more about "default design" ?

The worker process is running with nobody user which should not have the authority to listen on a port lower than 1024.

I have tested this with version 1.6.2 and 1.9.2, and both listen on master process.

Code:
------1.6.2------
OS: debian

# /usr/sbin/nginx -v
nginx version: nginx/1.6.2

# netstat -tlnp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      5578/nginx      
# ps aux | grep master            
root      5578  0.0  0.3  91184  3092 ?        Ss   15:19   0:00 nginx: master process /usr/sbin/nginx

------1.9.2------
OS: centos 7

# /usr/local/nginx/nginx -v
nginx version: nginx/1.9.2

# netstat -tlnp | grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      13347/nginx               
# ps aux | grep master
root     13347  0.0  0.1  50580  5028 ?        Ss   Mar12   0:15 nginx: master process /usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf
 
Old 07-14-2016, 01:03 AM   #6
hilou
Member
 
Registered: May 2013
Posts: 93

Original Poster
Rep: Reputation: Disabled
Ok, maybe you guys think this question is too stupid to ask and answer, I will close this thread. Thank you all for your help.
 
Old 07-15-2016, 07:55 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Meh ... don't easily take offense.

It could simply be that nginix was installed on this machine by default, or as a side-effect of installing something else. If you don't need it here, you should uninstall it.

Distro writers sometimes try to be a little too "helpful." If, for instance, you choose a "LAMP Server" configuration, they might well "helpfully" install both Apache and Nginix, complete with "helpful" default web-pages. You can find tens of thousands of these on the Internet.

Port-scan the box to see which ports are open, and be certain that you can account for every service that is running.
 
Old 07-17-2016, 09:04 PM   #8
hilou
Member
 
Registered: May 2013
Posts: 93

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
Meh ... don't easily take offense.

It could simply be that nginix was installed on this machine by default, or as a side-effect of installing something else. If you don't need it here, you should uninstall it.

Distro writers sometimes try to be a little too "helpful." If, for instance, you choose a "LAMP Server" configuration, they might well "helpfully" install both Apache and Nginix, complete with "helpful" default web-pages. You can find tens of thousands of these on the Internet.

Port-scan the box to see which ports are open, and be certain that you can account for every service that is running.
Thank you. I will figure this out and share it here.
 
  


Reply

Tags
nginx



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Nginx not passing the PHP scripts to FastCGI server listening on 127.0.0.1:9000 dreamcoder Linux - Server 8 08-02-2012 08:46 AM
LXer: Nginx+Varnish compared to Nginx LXer Syndicated Linux News 0 04-27-2011 02:30 PM
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 06:39 PM
[SOLVED] Warning worker http://192.168.1.5/ already used by another worker Apache problem tkmsr Linux - Server 2 06-30-2010 06:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration