Linux下nginx安装和配置

编译安装Nginx

1、下载安装包,***.tar.gz
2、解压缩
    tar zxvf ***.tar.gz
3、进入目录安装
    ./configure 【成功后 记录Configuration summary信息】
    make
    make install

4、修改配置文件 nginx.conf
5、启动服务
    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
------------------------    

【FAQ】
出现:./configure:  error: the HTTP rewrite module requires the PCRE library.

终极解决方案:yum -y install openssl-devel ,之后可继续 configure

-------------------------
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + md5: using system crypto library
  + sha1: using system crypto library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"    【nginx的启动bin文件】
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"    【nginx默认的配置文件】
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
-------------------------

你可能感兴趣的:(Linux下nginx安装和配置)