Install nginx in centos

Source: Internet
Author: User

NginxThe server will not go into details. In the case of high traffic and high concurrency, this software has superior performance and extremely low CPU and memory resources!

Check whether there is a PCRE Library. If not, install it because the rewrite module of nginx needs it.

[Plain]View plaincopyprint?
  1. Yum-y install PCRE-devel
yum -y install pcre pcre-devel

 

Install nginx as follows:

 

[Plain]View plaincopyprint?
  1. Wget http://nginx.org/download/nginx-1.0.2.tar.gz
  2. Tar zxvf nginx-1.0.2.tar.gz
  3. CD nginx-1.0.2
  4. ./Configure -- prefix =/usr/local/nginx
  5. Make
  6. Make install
wget http://nginx.org/download/nginx-1.0.2.tar.gztar zxvf nginx-1.0.2.tar.gzcd nginx-1.0.2./configure --prefix=/usr/local/nginxmakemake install

Of course, you can also choose a simpler installation method:

 

 

[Plain]View plaincopyprint?
  1. Yum install nginx
yum install nginx

After the installation is complete, perform the following operations on nginx:

 

[Plain]View plaincopyprint?
  1. /Usr/local/nginx/sbin/nginx start nginx
  2. /Usr/local/nginx/sbin/nginx-S Stop nginx
  3. /Usr/local/nginx/sbin/nginx-s reload restart nginx
/Usr/local/nginx/sbin/nginx start nginx/usr/local/nginx/sbin/nginx-S Stop nginx/usr/local/nginx/sbin/nginx-s reload restart nginx

 

Enter:

 

 

[Plain]View plaincopyprint?
  1. Http: // 127.0.0.1 or http: // localhost
Http: // 127.0.0.1 or http: // localhost

Page display"OK", Indicating that the installation is successful!

 

For more information about the nginx configuration file, refer to the nginx official website documentation and configure your own configuration!

Related Article

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.