Full offline deployment of nginx

Keywords: RPM Nginx zlib OpenSSL

Some children's shoes participating in the actual project deployment know that it is a very painful thing to deploy Middleware in a completely offline process. Here is a record of the process of deploying an Nginx independently in Readhat.

1. Create nginx exclusive user

Users / user groups www/www

Create user group groupadd www

Create user useradd www -g www -p neusoft

2. Necessary for installation

2.1 gcc installation

Enter Packages

Execute the following installation commands

rpm -ivh kernel-headers-2.6.32-573.el6.x86_64.rpm

rpm -ivh glibc-headers-2.12-1.166.e16.x86_64.rpm

rpm -ivh glibc-devel-2.12-1.166.e16.x86_64.rpm

rpm -ivh mpfr-2.4.1-6.e16.x86_64.rpm

rpm -ivh ppl-0.10.2-11.e16.x86_64.rpm

rpm -ivh cloog-ppl-0.15.7-1.2.e16.x86_64.rpm

rpm -ivh cpp-4.4.7-16.e16.x86_64.rpm

rpm -ivh libgomp-4.4.7-16.e16.x86_64.rpm

rpm -ivh gcc-4.4.7-16.e16.x86_64.rpm

rpm -ivh libstdc++-devel-4.4.7-16.e16.x86_64.rpm

rpm -ivh gcc-c++-4.4.7-16.e16.x86_64.rpm

2.2 install zlib

rpm -ivh zlib-1.2.3-29.e16.x86_64.rpm

rpm -ivh zlib-devel-1.2.3-29.e16.x86_64.rpm

2.3 install openssl

rpm -ivh openssl-1.0.1e-42.e16.x86_64.rpm

rpm -ivh libcom_err-devel-1.41.12-22.e16.x86_64.rpm

rpm -ivh libsepol-devel-2.0.41-4.e16.x64_64.rpm

rpm -ivh libselinux-devel-2.0.94-5.8.e16.x86_64.rpm

rpm -ivh keyutils-libs-devel-1.4-5.e16.x86_64.rpm

rpm -ivh krb5-devel-1.10.3-42.e16.x86_64.rpm

rpm -ivh openssl-devel-1.0.1e-42.e16.x86_64.rpm

2.4 installing pcre

Find / opt/software/pcre-8.40.zip

decompression

Execute the following command:

./configure

make

make install

3. Install nginx

Find / opt/software/nginx-1.12.0.tar.gz

Extract to the appropriate directory

Execute the following command:

./configure

--prefix=/usr/local/nginx

--with-http_stub_status_module

--with-http_ssl_module

--with-http_realip_module

make & make install

4. Copy the corresponding configuration file to the directory / usr/local/nginx/conf

/opt/conf/nginx.conf

/opt/conf/nginx_9093.conf

5. Start nginx

To create a soft connection:

ln -s /usr/local/lib/libpcre.so.1 /lib64/

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx_9093.conf

6. Turn off firewall

service iptables stop

chkconfig iptables off

Write at the end: welcome to leave a message to discuss, pay more attention and keep updating!

Posted by Zephyr_Pure on Sat, 28 Dec 2019 08:00:39 -0800