一、Nginx的安装

1.下载nginx软件
2.安装依赖包
[root@client ~]# useradd -s /sbin/nologin nginx 创建nginx用户
[root@client ~]# yum -y install gcc pcre-devel openssl-devel         
[root@client lnmp_soft]# tar -xf nginx-1.10.3
[root@client nginx-1.10.3]# ./configure \
> --prefix=/usr/local/nginx \  //指定安装路径
> --user=nginx \   //指定用户
> --group=nginx \  //指定用户组
> --with-http_ssl_module  //开起SSL加密
[root@client nginx-1.10.3]# make && make install
[root@client nginx-1.10.3]# ln -s /usr/local/nginx/sbin/nginx /sbin/  #个人习惯方便后期使用
[root@client nginx-1.10.3]# nginx
[root@client nginx-1.10.3]# ss -antulp | grep nginx
tcp    LISTEN     0      128       *:80                    *:*                   users:(("nginx",pid=10264,fd=6),("nginx",pid=10263,fd=6))
[root@client nginx-1.10.3]# nginx -s reload  #重启
[root@client nginx-1.10.3]# nginx -s stop   #停止
[root@client nginx-1.10.3]# nginx -V   查看软件版本信息
posted @ 2021-06-07 09:32  落樰兂痕  阅读(19)  评论(0编辑  收藏  举报