Nginx installation method

Source: Internet
Author: User
Tags gz file
: This article describes how to install Nginx. if you are interested in the PHP Tutorial, refer to it. Introduction: This article briefly introduces how to install and start Nginx on Linux.

Note: Because Nginx on Windows platform is inferior to Nginx on Linux platform in terms of performance and widely used, this tutorial is mainly for Linux platform.

First visit Nginx official website http://nginx.org/, download nginxsource code (link http://nginx.org/download/nginx-1.8.0.tar.gz ).
Next, start the installation process. To facilitate version management and differentiate different versions, use root to log on to the system and create the Nginx_180 directory in the system root directory '/'. the code is as follows:

[root@localhost ~]# mkdir /Nginx_180

After that, copy the downloaded nginx-1.8.0.tar.gz file to the/Nginx_180 directory and use the following code:

[root@localhostDownloads]# cp nginx-1.8.0.tar.gz /Nginx_180

Next, extract the package, locate the directory to/Nginx_180, and use the following code:

[root@localhostNginx_180]# tar xf nginx-1.8.0.tar.gz

In this way, under the Nginx_180 Directory, a nginx-1.8.0 folder is generated, the file is nginx1.8.0 version of the source code. The directory structure is as follows:

The configure file is an automatic script program of the Nginx software. run configure to check the runtime environment and generate the Makefile file. then, run the following code:

[root@localhost nginx-1.8.0]# ./configure --prefix=/Nginx

The prefix option after configuring configure is to specify the software installation path for Nginx. you can set it by yourself.
After the configure file is executed, the Nginx Makefile will be obtained and then compiled using the make command:

[root@localhost nginx-1.8.0]# make

If no error message is displayed, it indicates that the compilation is successful. Next, you can perform the next installation operation.

Note: During the first compilation, I encountered a prompt that the pcre library was missing. Run yum-y install pcre-devel.

Run the make install command and install it to the system. the code is as follows:

[root@localhost nginx-1.8.0]# make install

To check whether Nginx is successfully installed, locate the current working directory to/Nginx and see the following file:

Note: The four directories are the results after Nginx compilation. after the first run, a folder marked with temp will appear.

Run Nginx with the following code:

[root@localhostNginx]# ./sbin/nginx

In this case, Nginx is started with the default configuration. open the browser and access localhost. if the following page is displayed, the installation is started successfully.

So far, Nginx installation is complete.

'). 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 introduces the Nginx installation method, including some content, and hope to be helpful to friends 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.