Get the App
SLTechnology News&Howtos  ›  Servers  › 

LNMP-Nginx deployment (suitable for newcomers)

Shulou Source: shulou.com Published: 2022-06-02 23:49:43 10月04日 Update

I. Installation Support Library (Two Ways)

Quick Install Support Library

yum install pcre-devel pcre openssl-devel

Compile installation support libraries (recommended)

Install PCRE (regular)

wget tar zxvf pcre-8.42.tar.gz cd pcre-8.42/./ configure --prefix=/usr/local/pcremake && make installln -sv /usr/local/pcre/lib/libpcre.so.1 /usr/lib64/libpcre.so.1ln -sv /usr/local/pcre/lib/libpcre.so.1.2.9 /usr/lib64/libpcre.so.1.2.9

Install OPENSSL (ssl)

wget https://www.openssl.org/source/openssl-1.1.0i.tar.gztar zxvf openssl-1.1.0i.tar.gzcd openssl-1.1.0i/yum install perl./ config --prefix=/usr/local/opensslmake make install

Install zlib (Gzip dependency)

wget http://www.zlib.net/zlib-1.2.11.tar.gztar zxvf zlib-1.2.11.tar.gzcd zlib-1.2.11/./ configure --prefix=/usr/local/zlibmakemake install

Second, Nginx installation:

Download Nginx source package:

wget http://nginx.org/download/nginx-1.14.0.tar.gz

Create User:

groupadd wwwuseradd -g www www -s /sbin/nologin

Create directory:

mkdir -p /data/{www,logs,mysql}chmod +w /data/wwwchown -R www:www /data/www/

Compile and install Nginx:

tar zxvf nginx-1.14.0.tar.gzcd nginx-1.14.0/./ configure --prefix=/usr/local/nginx \--user=www --group=www \--with-http_ssl_module \--with-http_realip_module \--with-http_sub_module \--with-http_gzip_static_module \--with-http_stub_status_module \--with-http_v2_module \--with-openssl=/usr/local/src/openssl-1.1.0i \--with-zlib=/usr/local/src/zlib-1.2.11 \--with-pcre=/usr/local/src/pcre-8.42 \--with-streammake && make install

Tags: Support compile suggest method regular source code user directory newcomer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Shulou Tech Info Xiaomi Apple