1.1nginx installation

  • 1. Necessary software preparation
    Install pcre In order to support the rewrite function, we need to install pcre # yum install pcre* // If you have already installed it, please skip this step Installing openssl requires ssl support, if you do not need ssl support, Please skip this step # yum install openssl* 




  •   gzip compression is required to install zlib,yum install zlib* 

  • 2. Execute the following command to install nginx : # ./configure --prefix=/usr/local/nginx-1.5.1 \ --with-http_ssl_module --with-http_spdy_module \ --with-http_stub_status_module --with-pcre --with -http_stub_status_module: supports nginx status query –with-http_ssl_module: supports https –with-http_spdy_module: supports google’s spdy, if you want to know about Baidu spdy, this must have ssl support –with-pcre: in order to support the rewrite function, it must be formulated The final output of pcre is as follows, indicating that configure is OK.








  • # make //Make sure your server has make installed, if not, please execute yum install make
    # make install
  • 3. Start, shut down, reset nginx
    startup: directly execute the following command, nginx will start, no need to change any configuration files, try to access
    /usr/local/nginx-1.5.1/sbin/nginx : I do not
    map, directly use curl command to read web information
    [root@ns conf]# curl -s http://localhost
    shutdown:
    /usr/local/nginx-1.5.1/sbin/nginx -s stop
    reset: when you When the configuration file is modified, you only need to reload the following
    /usr/local/nginx-1.5.1/sbin/nginx -s reload
    The whole nginx installation is over here


  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324879118&siteId=291194637