查找nginx安装的路径以及相关安装

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

[root@rabbit01 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及对应目录:

[root@rabbit01 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
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值