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

How to install NGINX on RHEL6

WBOY
Release: 2023-05-13 11:52:22
forward
1341 people have browsed it

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
Copy after login
  • -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版本
Copy after login

3. Unzip

tar xzf nginx-1.12.2.tar.gz
Copy after login

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 安装
Copy after login

5. Run

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

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template