Home  >  Article  >  Operation and Maintenance  >  How to install NGINX on RHEL6

How to install NGINX on RHEL6

WBOY
WBOYforward
2023-05-13 11:52:221276browse

How to install NGINX on RHEL6

1. Install dependent packages (select the installation directory and execute the command)

yum -y install make gcc gcc-c++ openssl openssl-devel pcre-devel zlib-devel
  • -y The default is yes for all questions

  • install automatic installation

  • make dependencies used to compile binary files

  • gcc and gcc-c compile c/c language need to use

  • PCRE The http module of nginx uses pcre to parse regular expressions

  • openssl nginx supports http and https protocols. openssl is a secure socket layer cryptographic library. It has cryptographic algorithms, common key and certificate encapsulation management functions, and SSL protocol

  • zlib-devel nginx uses zlib to perform the content of the http package. gzip

2. Download the nginx installation package

Choose the version you want

wget -c http://nginx.org/download/nginx-1.12.2.tar.gz# 我选择1.12.2版本

3. Unzip

tar xzf nginx-1.12.2.tar.gz

4. Enter the nginx-1.12.2 directory and install

cd nginx-1.6.3  # 进入目录./configure  --prefix=/usr/local/nginx #configure脚本做了很多工作,例如环境监测,参数解析,目录生成,Makefile文件的生成等# --prefix指定了软件的安装位置make && make install# make 是编译的意思。就是把源码包编译成二进制可执行文件# && 当 make (前面) 编译成功,再执行后面的命令# make install 安装

5. Run

cd /usr/local/nginx  # 切换configure指定的目录./sbin/nginx # 启动服务ps aux | grep nginx #查看进程

The above is the detailed content of How to install NGINX on RHEL6. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete