Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos 7 Nginx 安装教程 #1

Open
dengchengchao opened this issue Dec 14, 2019 · 0 comments
Open

Centos 7 Nginx 安装教程 #1

dengchengchao opened this issue Dec 14, 2019 · 0 comments

Comments

@dengchengchao
Copy link
Owner

依赖

首先明白Nginx的依赖:

  • PCRE pcre-devel :NginxHttp模块使用的pcre模式解析的正则表达式,所以需要在Linux上安装pcre库,pcre-devel是使用pcre二次封装的一个库,Nginx也依赖于它

    yum install -y pcre pcre-devel

  • zilb : Nginx使用zlibhttp包的内容进行gzip压缩。

    yum install -y zlib zlib-devel

  • OpenSSL : Nginx使用OpenSSL支持Https协议

    yum install -y openssl openssl-devel


下载二进制文件

安装好以上依赖之后,上官网下载最新的二进制包,虽然一般yum源也有Nginx,但是这个源可能很久没有更新了,因此最好直接去官方下载最新的二进制包,编译安装。

https://nginx.org/en/download.html

同时,也可以使用命令进行安装下载

wget -c https://nginx.org/download/nginx-1.10.1.tar.gz

解压

下载了二进制包之后,接下来就是解压:

tar -zxvf nginx-1.4.2.tar.gz

配置

接下来是配置Nginx,默认情况下我们使用默认配置即可

./configure

编译安装

一切准备就绪后,就可以进行编译安装了

make

make install

make 为编译 make install 为安装

安装完成后,一般默认安装位置为/usr/local/nginx


到这里Nginx基本安装完毕。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant