几个小概念:
nginx:Nginx 是一个高性能的 HTTP 和反向代理服务器,是一款轻量级的 Web 服务器,可以实现负载均衡等功能。
负载均衡:当同时有N多用户访问服务器时,为减少服务器的压力,需要将用户分别引入各个服务器,分担服务器的压力。
nginx优点:实现高并发,部署简单,内存消耗少,成本低
ngnix缺点:rewrite 功能一般,模块没有Apache多;
nginx搭建:
下载:http://nginx.org/en/download.html
filezilla上传一下,有点多此一举, 因为我的是虚拟机有点卡,
然后就是解压了 tar -zvxf 加上.tar文件
进入到nginx中,执行.、./configure 我的出现
./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.
缺少文件,安装
sudo apt-get install pcre-devel
安装http://www.pcre.org
回到nginx 继续./configure-->make--->make install
到 usr/local查看安装成功
常见问题:防火墙问题,缺少gc++,缺少pcre库,缺少zlib库