Nginx 笔记与总结(1)编译安装
2023-09-11 14:17:03 时间
Nginx 可以承受 3 万并发连接数,Apache 默认最大连接数是 256 个。
编译安装
① 下载
在 Nginx 的主页 http://nginx.org/ 下载最新的 stable version(稳定版)Nginx 1.8.0(http://nginx.org/en/download.html-http://nginx.org/download/nginx-1.8.0.tar.gz),ftp 传输到 /usr/local/src 目录下(CentOS 6.6)
② 解压
tar zxvf nginx-1.8.0.tar.gz
③ 进入目录
cd nginx-1.8.0
④ 配置
./configure --prefix=/usr/local/nginx
如果报错:
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
解决方案:
PCRE library 是正则表达式库,安装 pcre 包(二进制包):
mount /dev/cdrom /mnt/cdrom #挂载光盘
yum install pcre
如果还是报同样的错,可以安装相应的 develop(头文件):
yum install pcre-devel
重新配置:
./configure --prefix=/usr/local/nginx
没有报错。
⑤ 编译、安装
make && make install
完毕。
此时在 /usr/local 下能看到 nginx 目录:
进入nginx 目录:
cd nginx
ll
conf:配置文件目录
html:网页文件目录
logs:日志文件目录
sbin:主要二进制程序
sbin/nginx:主程序
启动 Nginx:
[root@localhost sbin]# cd ../
[root@localhost nginx]# ./sbin/nginx
查看 80 端口的使用情况:
netstat -antp
或者
netstat -tunpl | grep 80
相关文章
- 简述C#中IO的应用 RabbitMQ安装笔记 一次线上问题引发的对于C#中相等判断的思考 ef和mysql使用(一) ASP.NET/MVC/Core的HTTP请求流程
- c#实例化继承类,必须对被继承类的程序集做引用 .net core Redis分布式缓存客户端实现逻辑分析及示例demo 数据库笔记之索引和事务 centos 7下安装python 3.6笔记 你大波哥~ C#开源框架(转载) JSON C# Class Generator ---由json字符串生成C#实体类的工具
- Django学习笔记(一)——安装,创建项目,配置
- Dubbo -- 系统学习 笔记 -- 安装手册
- Nexus学习笔记--安装使用教程
- App Store上下载和安装Xcode
- Nginx 笔记与总结(16)nginx 负载均衡
- Nginx 笔记与总结(11)Nginx + php-fpm + MySQL 安装 ecshop
- tensorflow学习笔记一:安装调试
- linux 安装mysql数据库——yum安装法
- 《Python数据可视化编程实战》——1.6 安装图像处理工具:Python图像库(PIL)
- 转 pygame学习笔记(1)——安装及矩形、圆型画图
- Nginx安装lua-nginx-module模块
- 《Linux嵌入式实时应用开发实战(原书第3版)》——2.3 安装方案
- ubuntu 安装imagepick笔记
- docker 安装 jenkins 笔记
- Docker 尝试安装rabbitmq实践笔记
- nginx图片过滤处理模块http_image_filter_module安装配置笔记
- LINUX安装源码软件经典三部曲
- 《 STM32 ST-LINK Utility 》__代码下载工具下载、安装和使用说明(小白也能懂)
- kail安装资产收集神器-ARL灯塔(安装方法笔记)
- raspberry树莓派安装CUPS实现打印服务器共享HP P1007打印机