Installing Nginx under Linux

Source: Internet
Author: User

I. Installing a dependency package

Each installation of the software must, by default, a few packages, must be installed

Yum install autoconf automake zlib zlib-devel OpenSSL openssl-devel pcre pcre-devel gcc

Two. Download Nginx and related modules

nginx: You can go to the official website http://nginx.org/Download the latest version

wget http://nginx.org/download/nginx-1.7.8.tar.gz

Cache Module Ngx_cache_purge: can go to http://labs.frickle.com/nginx_ngx_cache_purge/download the latest version

wget http://labs.frickle.com/files/ngx_cache_purge-2.2.tar.gz
# Unzip the tar zxvf nginx-1.7.8. Tar.gztar zxvf ngx_cache_purge-2.2.tar.gz

Three. Compiling the installation

./--user=www--group=--with---with---with---with---with-  --add-module=. /ngx_cache_purge-2.2& make Install

After installation, the default nginx root directory is /usr/local/nginx

Four. Cache Configuration Example

Nginx configuration is a lot of examples, do not repeat, directly asked degrees Niang bar.

For example, use a cache:

Proxy_cache_path   /tmp/cache   keys_zone=/ {  proxy_pass        http://127.0.0.1:8000 ;  Proxy_cache        Tmpcache;    Proxy_cache_key        $uri $is_args$args;  Proxy_cache_purge    127.0.0.1;}

Installing Nginx under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.