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!