Restart centOS lead to the loss of nginx.pid not start nginx solution


tags:

  • centOS
  • linux
  • nginx
    categories:
  • server

Found nginx

First, if you forget your nginx installation directory, you may wish to use the following command to find your nginx:

find / -name nginx

This time, no accident, then, your screen will appear a bunch of nginx path, but in general the executable file is /sbin/or /bin/directory. Of course, if your shell tool support for syntax highlighting, then, one can distinguish the directory or an executable file, the following is an example of the directory:

/run/nginx
/usr/lib64/nginx
/usr/sbin/nginx
/usr/share/nginx
/usr/libexec/initscripts/legacy-actions/nginx
/etc/logrotate.d/nginx
/etc/sysconfig/nginx
/etc/nginx
/var/lib/yum/repos/x86_64/7/nginx
/var/cache/nginx
/var/cache/yum/x86_64/7/nginx
/var/log/nginx

The list above, with /sbin/or /bin/directory is only one, that is:

/usr/sbin/nginx

Nginx configuration files found

That is, find nginx.conf file, again using the Find command:

find / -name nginx.conf

This usually only occurs when a configuration file path, as follows:

/etc/nginx/nginx.conf

Splicing command to start nginx

The directory /usr/sbin/nginxplus parameters -c, plus the profile directory:/etc/nginx/nginx.conf

Eventually it becomes:

/usr/sbin/nginx -c /etc/nginx/nginx.conf

Press Enter to perform at this time, the screen will prompt no other means nginx program starts successfully.

nginx -c It is set up a profile. In fact, nginx -c It also has a default configuration file path. It is the default path: /etc/nginx/nginx.confso after correcting the above command is:

/usr/sbin/nginx -c

Nginx know how there are other commands it?

You only need to enter the following command:

/usr/sbin/nginx -?

Nginx command expand knowledge (bilingual):

-?,-h           : this help (这个帮助)
-v              : show version and exit (显示版本并退出)
-V              : show version and configure options then exit (显示版本和选项,然后退出)
-t              : test configuration and exit (测试配置和退出)
-T              : test configuration, dump it and exit (测试配置,转储并退出)
-q              : suppress non-error messages during configurationtesting (在配置非错误期间,禁止显示非错误消息)
-s signal       : send signa1 to a master process: stop, quit, reopen, reload  (向主进程发送信息:停止;退出;重新打开;重新加载)
-p prefix       : set prefix path (default: /etc/nginx/)  (设置前缀路径,默认:/etc/nginx/)
-c filename     : set configuration file (default: /etc/nginx/nginx. conf)  (设置配置文件,默认为:/etc/nginx/nginx. conf )

-g directives   : set global directives out of configuration file (将配置文件设置为全局指令)

Guess you like

Origin www.cnblogs.com/gobyte/p/10995710.html