查找nginx

Linux环境下,怎么确定Nginx是以那个config文件启动的?

[[email protected] nginx]# ps  -ef | grep nginx
nobody    6568 27854  0 Jun15 ?        00:00:00 nginx: worker process
root     27854     1  0 May26 ?        00:00:00 nginx: master process ./nginx
root     30468 30237  0 18:32 pts/1    00:00:00 grep --color=auto nginx

检查是否已经安装有nginx及对应目录:

[[email protected] nginx]# find /|grep nginx.conf

/software/openresty/nginx/conf
/software/openresty/nginx/conf/koi-win
/software/openresty/nginx/conf/koi-utf
/software/openresty/nginx/conf/win-utf
/software/openresty/nginx/conf/mime.types
/software/openresty/nginx/conf/mime.types.default
/software/openresty/nginx/conf/fastcgi_params
/software/openresty/nginx/conf/fastcgi_params.default

或者采用一下方式

netstat -tnlp|grep nginx
ps -aux |grep pid(对应的值)

Ubuntu下安装nginx,直接apt-get install nginx就行了
CentOS 下安装nginx:如下

centos7系统库中默认是没有nginx的rpm包的,所以我们自己需要先更新下rpm依赖库
(1)使用yum安装nginx需要包括Nginx的库,安装Nginx的库
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm包的安装:
1.安装一个包
# rpm -ivh
2.升级一个包,没安装过的不能使用升级命令
# rpm -Uvh
3.移走一个包
# rpm -e

安装准备依赖lib库
yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

(2)使用下面命令安装nginx
#yum install nginx

(3)启动Nginx
#service nginx start
或
#systemctl start nginx.service
(4)重启nginx
service nginx restart
文章来源: 查找nginx

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:查找nginx