首页 > 编程知识 正文

shell重启服务命令,nginx常用命令

时间:2023-05-04 13:56:01 阅读:20045 作者:1372

文章目录1.1 nginx命令帮助结果1.2 nginx命令的常规相关参数总结

1.1 nginx命令的帮助获取结果

编译安装的Nginx后,nginx命令的帮助结果

[ root @ nod e21~] # nginx-hnginxversion : nginx/1.18.0 usage : nginx [ -? hvttq ] [-ssignal ] [-cfilename ] [-p prefix ] [-gdirectives ]选项3360 -?- h : thishelp-v : showversionandexit-v : showversionandconfigureoptionsthenexit-t : testconfigurationationanananandexit dumpitandexit-q 3360 suppress non-errormessagesduringconfigurationtesting-ssignal 3360 sendsignaltoamasterprocess 3360 stop操作系统reload-p prefix 3360 setprefixpath (默认:/data/apps/nginx-1.18.0/)=具有默认值的哈- cfilename : set configuration nginx.conf (=具有默认值的哈- gdirectives 3360 setglobaldirectivesoutofconfiguration

[ root @ nod e21~] # nginx-hnginxversion : nginx/1.16.0 usage : nginx [ -? hvttq ] [-ssignal ] [-cfilename ] [-p prefix ] [-gdirectives ]选项3360 -?- h : thishelp-v : showversionandexit-v : showversionandconfigureoptionsthenexit-t : testconfigurationationanananandexit dumpitandexit-q 3360 suppress non-errormessagesduringconfigurationtesting-ssignal 3360 sendsignaltoamasterprocess 3360 stop操作系统reload-p prefix 3360 setprefixpath (默认:/etc/nginx/)==具有默认值的哈- cfilename 3360 setconfigurationfile ) default33: nginx.conf(=具有默认值的哈- gdirectives 3360 setglobaldirdiration 示例:如果nginx是您使用nginx --help没有结果的哈-p#主配置文件(nginx.conf )的路径,则这是默认的#编译的nginx软件。 /data/apps/nginx-1.18.0/# yum安装的nginx软件: /etc/nginx/#此参数的默认值将由-c参数指定的值替换-c#主配置文件(这是具有默认值的#编译安装的nginx: conf/nginx.conf # yum安装的nginx :/etc/nginx/nginx.conf ## nginx #==这是使用- # # nginx-p/data/apps/nginx-1.18.0-c conf/nginx.conf #=是用-p和-c参数人为的是否在后台运行(人类难以阅读)以确定配置文件中有无DAE mom # # nginx-c/data/apps/nginx-1.18.0/conf/nginx . 是否在后台运行以查看配置文件# # nginx-c/data/apps/nginx-1.18.0/conf/nginx.conf #==配置配置是否在后台运行以查看配置文件。 我推荐这个。 向-s#nginx发送信号的master过程。 作为其可发送的信息,经常使用以下的# stop #停止服务# reload #顺利重新启动# #例reload# nginx -s reload #==顺利重新启动nginx服务。 -p和-c参数的默认值#==nginx-c/data/apps/nginx-1.18.0/conf/nginx.conf-s reload # # nginx-c/etc/-c参数的默认值被替换,-p参数的默认值# #示例stop # nginx-s stop #==停止nginx服务。 这是缩写。 -p或-c参数的默认值#==nginx-c/data/apps/nginx-1.18.0/conf/nginx.conf-s stop # # nginx-c/etc/通过替换-c参数的默认值和-p参数的默认值-t#检查主配置文件和相关配置文件(主配置文件中的包含文件)的格式。 不是检查内容的逻辑。 如果选中#,将生成pid文件。 此pid文件为空(nginx未启动)丙。 用shell编写脚本时请小心。 #生成的pid文件不会影响centos7中系统停止管理。

示例:如果查看nginx-t==nginx-c/etc/nginx/nginx.conf-t-v # nginx的版本,则只能看到nginx的版本#示例: nginx-v==nginx nginx版本、安装位置和安装的模块#示例: nginx-v==nginx-c/etc/nginx/nginx.conf-v-g #从配置文件获取全局命令#在#nginx后台启动。 # nginx-g-# nginx-c/data/apps/nginx-1.18.0/conf/nginx.conf-g ' daemon on;' #我在nginx前台# nginx -g 'daemon off;' 启动# nginx-c/data/apps/nginx-1.18.0/conf/nginx.conf-g ' daemon off;' :请注意您的配置文件中没有daemon on; 或daemon off; 的配置,否则启动错误; #反正不要在主配置文件中配置daemon on; 或daemon off;

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。