Linux-Centos7 install nginx, linux-centos7nginx

Source: Internet
Author: User

Linux-Centos7 install nginx, linux-centos7nginx

First, configure the linux environment. I just installed linux here, So I installed a series of environments I needed at one time;

Yum install

Pcre-devel zlib-devel openssl-devel gd-devel libjpeg-devel libpng-devel freetype-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel
Autoconf libxml2 libxml2-devel glibc-devel glib2 glib2-devel kernel bzip2-devel ncurses-devel curl-devel libidn-devel libtool-libs kernel-devel kernel openldap-clients -servers libtool-ltdl-devel bison libgcrypt php-mcrypt libmcrypt-devel cmake gcc-c ++ ncurses-devel perl-Data-Dumper libicu-devliblibquadmath-devel python-devel bzip2-devel

 

1. Download nginx from http://nginx.org/en/download.html.

2. Extract tar-zxvf nginx-1.13.4.tar.gz to/usr/local/nginx-1.13.4.tar.gz

3. cd nginx-1.13.4 into Directory

4. Compile and install and execute:

../Configure -- prefix =/usr/local/nginx-1.13
-- With-pcre
With-ipv6
With-http_v2_module
With-http_ssl_module
With-http_dav_module
With-http_sub_module
With-http_realip_module
With-http_addition_module
With-http_stub_status_module

-- Add-module =/mnt/root/src/nginx. package/ngx_log_if # specify some logs not written
-- Add-module =/mnt/root/src/nginx. package/ngx_devel_kit
-- Add-module =/mnt/root/src/nginx. package/form-input-nginx-module # obtain the POST parameter in the request
-- Add-module =/mnt/root/src/nginx. package/echo-nginx-module # facilitate debugging in nginx
-- Add-module =/mnt/root/src/nginx. package/set-misc-nginx-module # set value

In the preceding compilation command (-- add-module =), these modules must be pre-downloaded and placed in/mnt/root/src/nginx. package/(this path is not required and can be customized) can be compiled in the folder, if not, an error is reported;

If you do not need these modules (-- add-module =), you can compile them directly:

../Configure -- prefix =/usr/local/nginx-1.13
-- With-pcre
With-ipv6
With-http_v2_module
With-http_ssl_module
With-http_dav_module
With-http_sub_module
With-http_realip_module
With-http_addition_module
With-http_stub_status_module

After compilation, execute make & make install to complete installation!

 

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.