在centos上编译安装nginx

install nginx on centos:

  • sudo yum -y install pcre pcre-devel
  • download the src code
  • NGINX_HOME=/opt/nginx
  • sudo mkdir $NGINX_HOME
  • sudo chown $(id -u) $NGINX_HOME -R
  • ./configure –prefix=$NGINX_HOME
    • 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: “/opt/nginx”
    •   nginx binary file: “/opt/nginx/sbin/nginx”
    •   nginx configuration prefix: “/opt/nginx/conf”
    •   nginx configuration file: “/opt/nginx/conf/nginx.conf”
    •   nginx pid file: “/opt/nginx/logs/nginx.pid”
    •   nginx error log file: “/opt/nginx/logs/error.log”
    •   nginx http access log file: “/opt/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”
  • make
  • make install
  • ln -sv $NGINX_HOM/sbin/nginx /usr/local/sbin/nginx
  • vi $NGINX_HOME/conf/fastcgi_params
    • fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

发表评论