Linux下安装Nginx
来源:互联网 发布:还珠格格3知画圆房 编辑:程序博客网 时间:2024/06/07 05:23
# 什么是Nginx?
Nginx(发音同engine x)是一个网页服务器,它能反向代理HTTP, HTTPS, SMTP, POP3, IMAP的协议链接,以及一个负载均衡器和一个HTTP缓存。
Nginx的安装
模块依赖性Nginx需要依赖下面3个包
gzip 模块需要 zlib 库 ( 下载: http://www.zlib.net/ )
rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ )
ssl 功能需要 openssl 库 ( 下载: http://www.openssl.org/ )
Nginx包下载: http://nginx.org/en/download.html
依赖包安装顺序依次为:openssl、zlib、pcre, 然后安装Nginx包.
第一步: 下载安装所需包
openssl-fips-2.0.16.tar.gz
zlib-1.2.11.tar.gz
pcre-8.41.tar.gz
nginx-1.12.1.tar.gz
第二步:依次安装openssl、zlib、pcre、nginx
1.安装openssl-fips-2.0.16.tar.gz
[root@localhost mrms]# tar -zxvf openssl-fips-2.0.16.tar.gz [root@localhost mrms]# cd openssl-fips-2.0.16[root@localhost openssl-fips-2.0.16]# ./config [root@localhost openssl-fips-2.0.16]# make[root@localhost openssl-fips-2.0.16]# make install
2.安装zlib-1.2.11.tar.gz
[root@localhost mrms]# tar -zxvf zlib-1.2.11.tar.gz[root@localhost mrms]# cd zlib-1.2.11[root@localhost zlib-1.2.11]# ./configure [root@localhost zlib-1.2.11]# make[root@localhost zlib-1.2.11]# make install
3.安装pcre-8.41.tar.gz
[root@localhost mrms]# tar -zxvf pcre-8.41.tar.gz[root@localhost mrms]# cd pcre-8.41[root@localhost pcre-8.41]# ./configure [root@localhost pcre-8.41]# make[root@localhost pcre-8.41]# make install
4.安装 nginx-1.12.1.tar.gz
[root@localhost mrms]# tar -zxvf nginx-1.12.1.tar.gz [root@localhost mrms]# cd nginx-1.12.1[root@localhost nginx-1.12.1]# ./configure --with-pcre=../pcre-8.41 --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-fips-2.0.16[root@localhost nginx-1.12.1]# make[root@localhost nginx-1.12.1]# make install
至此Nginx的安装完成!
第三步:检测是否安装成功
[root@localhost nginx-1.12.1]# cd /usr/local/nginx/sbin[root@localhost sbin]# ./nginx -t
出现如下所示提示,表示安装成功
启动nginx
[root@localhost sbin]# ./nginx
查看端口
[root@localhost sbin]# netstat -ntlp
结果如下
参考:
http://nginx.org/en/docs/configure.html
- nginx--linux下安装nginx
- linux 下nginx安装
- Linux下安装Nginx
- linux下安装nginx
- linux下安装nginx
- linux下安装nginx
- Linux下安装Nginx
- linux 下安装 nginx
- Linux下Nginx安装
- Linux下安装Nginx
- linux下安装nginx
- Linux下Nginx安装
- linux下nginx安装
- Linux下安装nginx
- linux下安装nginx
- linux下安装nginx
- linux下nginx安装
- linux 下安装nginx
- LeetCode (11)-- Container With Most Water
- 用Python处理邮件,全文完
- 心情杂记之2017年7月17号
- 【模拟高清】RN6752芯片简介
- @RequestBody, @ResponseBody 注解详解
- Linux下安装Nginx
- 18. 排序--堆排序
- Windows搭建ngrok服务器、Linux搭建ngrok服务器、支持用户管理
- 转载:ubuntu清理内核方法
- mysql的日期函数以及应用
- 【中间件】-通俗易懂的理解方式
- 待学习的博客
- 懒加载的使用
- 算法<含相同元素数组的全排列>