云深处 发表于 2018-11-15 06:29:54

Nginx-Super

  Nginx:
  一、高性能的,能支持百万级别连接数的,轻量级的http 服务器;
  源码安装Nginx:
  1、wget http://nginx.org/download/nginx-1.8.1.tar.gz
  2、tar xzvf nginx-1.8.1.tar.gz
  3、./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= option.
  4. yum -y install pcre pcre-devel
  5. ./configure
  6. make
  7. make install
  设置终端brower缓存失效时间:
  jpg|png|swf|gif
  expires 30d
  css|js
  expires 1h
  设置gzip功能:
  gzip on;
  gzip_min_lenth 1k;#(小于1k的文件不压缩)
  gzip_buffers 4 16k;
  gzip_http_version 1.1;
  gzip_vary on;#gzip技术需要客户端、server端都有支持,所以需要判断
  应该禁用“自动列目录”功能
  #autoindex on;
  二、反向代理服务器,可以实现负载均衡;
  upstream
  hash_ip
  server weight
  port
  nginx.conf
  user nobody#低权限用户
  worker_processes 1 #与cpu的core匹配
  三、邮件服务器;
  ========================================================================================
  web server(http server),如Apache,Nginx只能解析静态html页面,对于动态页面,web server需要交由第三方服务器来解析。
  如果动态页面是由PHP实现,对于php页面的请求,都交由PHP来解析;
  如果动态页面是JSP实现,对于JSP页面的请求,都转发至JSP服务器(Tomcat,WAS,Weblogic),由JSP服务器来解析。
  同理,如果动态页面由Python实现,则对于Python页面的请求,都转由Python来解析;
  因此,需要配置Nginx + PHP(Nginx不支持对第三方程序的直接调用,需要经由fastCGI接口。需要由fastCGI接口调用PHP程序,PHP-FPM就是一款开源的用于调用PHP的fastCGI,新版的php已经集成了PHP-FPM),Nginx + JSP,Nginx + ASP,Nginx + Python。
  Nginx支持不停机升级(平滑升级)

页: [1]
查看完整版本: Nginx-Super