NGINX安装

1.官网下载http://nginx.org/en/download.html
   Stable version:nginx-1.20.1 

2.上传到/usr/local目录下

3.安装依赖(如系统已安装,可跳过)
  shell>yum -y install gcc
  shell>yum -y install  pcre pcre-devel
  shell>yum -y install  openssl openssl-devel

4.解压
   shell>tar -zxvf nginx-1.20.1.tar.gz

5.编译
  shell>cd nginx-1.20.1
  shell>./configure --prefix=/usr/local/nginx  --with-http_stub_status_module --with-http_ssl_module
  shell>make
  shell>make install

6.配置环境变量
  shell>vi /etc/profile
  添加内容:
    export PATH=/usr/local/nginx/sbin:$PATH
  shell>source /etc/profile ##刷新配置

7.启动/停止命令
   shell>nginx

   shell>nginx -s stop


8.访问
  shell>curl http://127.0.0.1
 

你可能感兴趣的:(linux,服务器,运维,nginx)