Install nginx on centos

Source: Internet
Author: User

1. Install the basic environment package

Yum-y install GCC gcc-C ++ OpenSSL *
Yum-y install libjpeg-devel libpng-devel FreeType-devel
Yum-y install libxml2 libxml2-devel zlib-devel ncurses-devvel curl-devel
Yum-y install GD GD2 Gd-devel gd2-devel

Ii. Install PCRE

1. Download

Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz

2. Decompress

Tar zxvf pcre-8.35.tar.gz

3. Installation

CD pcre-8.35

./Configure

Make & make install

3. Install nginx

1. Download nginx

Wget http://nginx.org/download/nginx-1.7.3.tar.gz

2. Decompress

Tar zxvf nginx-1.7.3.tar.gz

3. Installation

CD nginx-1.7.3

./Configure -- prefix =/opt/nginx -- with-http_ssl_module -- with-http_stub_status_module

Make & make install

Note: -- prefix =/opt/nginx, nging installation directory; -- with-http_ssl_module, enable the http ssl module so that nginx can support HTTPS requests. This module needs to be installed with OpenSSL; -- with-http_stub_status_module, enable nginx nginxstatus function, to monitor the current state of nginx.

4. Start nginx

Echo "/usr/local/lib">/etc/lD. So. conf

Tail-1/etc/lD. So. conf

Ldconfig

/Opt/nginx/sbin/nginx

Lsof-I: 80

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.