Install nginx in linux

Source: Internet
Author: User
: This article describes how to install nginx in linux. if you are interested in the PHP Tutorial, refer to it. For your own use, do not spray. The installation is successful. The content is excerpted from the network.

1. install necessary tools:

$ Yum-y install gcc-c ++ autoconf automake

$ Yum-y install zlib-devel openssl-devel pcre-devel
Note:
Pcre: used for address rewriting.

Zlib: gzip module of nginx, which package transmission data and saves traffic (but consumes resources ).

Openssl: provides ssl encryption protocol.
II. Nginx compilation and installation:

1 download Nginx: http://nginx.org/en/download.html
The installation directories are generally stored in:/usr/local/nginx.

2. decompress and compile:
$ Tar-zxvf nginx-1.9.2.tar.gz/

$ Mv nginx-1.9.2 nginx

$ Cd/usr/local/nginx

$./Configure-prefix =/usr/local/nginx // pre-compile

3. installation:
$ Make & make install
Problems occurred during the first installation:
conf/koi-win' and/Usr/local/nginx/conf/koi-win 'are the same file
Then re-install it and run the command during pre-compilation.
./Configure-prefix =/usr/local/nginx
Change
./Configure-prefix =/usr/local/nginx-conf-path =/usr/local/nginx. conf
The installation is successful.

4. start:
Make sure that Port 80 of the system is not occupied by other programs,
$ Nginx-c/etc/nginx. conf

Check whether startup is successful:
Netstat-ano | grep 80 indicates that the startup is successful.

Open the browser to access the IP address of this machine. if the browser displays Welcome to nginx! Nginx has been installed and runs successfully.

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above describes how to install nginx in linux, including some content, and hope to help those who are interested in the PHP Tutorial.

    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.