RHEL/CentOS 7.0-ലെ ഉറവിടങ്ങളിൽ നിന്ന് Nginx 1.10.0 (സ്ഥിരമായ റിലീസ്) ഇൻസ്റ്റാൾ ചെയ്ത് കംപൈൽ ചെയ്യുക


സ്വതന്ത്ര ഓപ്പൺ സോഴ്uസ് മോഡുലാർ മോഡൽ, ഉയർന്ന-പ്രകടനം, സ്ഥിരത, ലളിതമായ കോൺഫിഗറേഷൻ ഫയലുകൾ, അസിൻക്രണസ് ആർക്കിടെക്ചർ (ഇവന്റ്-ഡ്രൈവൺ) എന്നിവയും കുറഞ്ഞ ഉറവിടങ്ങളും കാരണം പൊതു ഇന്റർനെറ്റ് അഭിമുഖീകരിക്കുന്ന സെർവറുകളിൽ ഇന്ന് ഏറ്റവും വേഗത്തിൽ വളരുന്ന വെബ്uസെർവറാണ് Nginx. ഓടാൻ.

  1. RHEL 7.0-ന്റെ ഏറ്റവും കുറഞ്ഞ ഇൻസ്റ്റലേഷൻ
  2. RHEL 7.0-ൽ സജീവമായ RedHat സബ്uസ്uക്രിപ്uഷനും ശേഖരണങ്ങളും

  1. CentOS 7.0-ന്റെ ഏറ്റവും കുറഞ്ഞ ഇൻസ്റ്റാളേഷൻ

  1. RHEL/CentOS 7.0-ൽ സ്റ്റാറ്റിക് IP വിലാസം സജ്ജീകരിക്കുക

ഔദ്യോഗിക RHEL/CentOS 7 ശേഖരണ മിററുകൾ ഒരു ബൈനറി പാക്കേജ് നൽകാത്തതിനാൽ, ഉറവിടങ്ങളിൽ നിന്ന് Red Hat Enterprise അല്ലെങ്കിൽ CentOS 7-ൽ Nginx 1.10.0-ന്റെ ഏറ്റവും പുതിയ സ്ഥിരതയുള്ള പതിപ്പ് ഇൻസ്റ്റാൾ ചെയ്യാൻ ഈ ട്യൂട്ടോറിയൽ നിങ്ങളെ സഹായിക്കും. നിങ്ങൾക്ക് ഉറവിടങ്ങളുടെ ഇൻസ്റ്റാളേഷൻ ഒഴിവാക്കണമെങ്കിൽ, കാണിച്ചിരിക്കുന്നതുപോലെ Yum പാക്കേജ് മാനേജറിന്റെ സഹായത്തോടെ നിങ്ങൾക്ക് ഔദ്യോഗിക Nginx ശേഖരം ചേർക്കാനും ബൈനറി പാക്കേജ് ഇൻസ്റ്റാൾ ചെയ്യാനും കഴിയും (ലഭ്യമായ പതിപ്പുകൾ 1.9.x).

RHEL/CentOS 7-നായി nginx ഔദ്യോഗിക yum റിപ്പോസിറ്ററി പ്രവർത്തനക്ഷമമാക്കാൻ, ഇനിപ്പറയുന്ന ഉള്ളടക്കങ്ങളുള്ള ഒരു ഫയൽ /etc/yum.repos.d/nginx.repo സൃഷ്ടിക്കുക:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1

നിങ്ങൾ ഉപയോഗിക്കുന്ന വിതരണത്തെ ആശ്രയിച്ച് \centos പകരം rhel ഉപയോഗിച്ച് മാറ്റി, കാണിച്ചിരിക്കുന്നതുപോലെ yum പാക്കേജ് മാനേജർ ഉപയോഗിച്ച് nginx ഇൻസ്റ്റാൾ ചെയ്യുക:

# yum install nginx

പ്രധാനം: ദയവായി ശ്രദ്ധിക്കുക, മുകളിലുള്ള ഔദ്യോഗിക nginx yum റിപ്പോസിറ്ററികൾ നിങ്ങൾക്ക് nginx-ന്റെ പഴയ പതിപ്പ് നൽകും, നിങ്ങൾക്ക് Nginx-ന്റെ ഏറ്റവും പുതിയ പതിപ്പ് നിർമ്മിക്കാൻ താൽപ്പര്യമുണ്ടെങ്കിൽ, ചുവടെ കാണിച്ചിരിക്കുന്നതുപോലെ ഉറവിട ഇൻസ്റ്റാളേഷൻ പിന്തുടരാൻ ഞാൻ നിങ്ങളോട് നിർദ്ദേശിക്കുന്നു.

ഉറവിടങ്ങളുടെ സമാഹാരവും ഇൻസ്റ്റാളേഷനും ഉപയോഗിക്കുന്നതിന് ചില നേട്ടങ്ങളുണ്ട്, നിങ്ങൾക്ക് ലഭ്യമായ ഏറ്റവും പുതിയ പതിപ്പ് ഇൻസ്റ്റാൾ ചെയ്യാൻ കഴിയും എന്ന വസ്തുത കാരണം, മൊഡ്യൂളുകൾ ചേർക്കുകയോ നീക്കം ചെയ്യുകയോ ചെയ്തുകൊണ്ട് നിങ്ങൾക്ക് Nginx കോൺഫിഗറേഷൻ മാറ്റാം, ഇൻസ്റ്റാളേഷൻ സിസ്റ്റം പാത്ത് മാറ്റുക അല്ലെങ്കിൽ മറ്റ് പ്രധാന ക്രമീകരണങ്ങൾ, മറ്റൊരു രീതിയിൽ പറഞ്ഞാൽ, നിങ്ങൾക്ക് ഒരു ഇൻസ്റ്റലേഷൻ പ്രക്രിയയുടെ പൂർണ്ണ നിയന്ത്രണം.

ഘട്ടം 1: Nginx ഡൗൺലോഡ് ചെയ്യുക, കംപൈൽ ചെയ്യുക, ഇൻസ്റ്റാൾ ചെയ്യുക

1. Nginx കംപൈലേഷനും ഇൻസ്റ്റാളേഷൻ പ്രക്രിയയും ആരംഭിക്കുന്നതിന് മുമ്പ്, നിങ്ങൾക്ക് C/C++ കമ്പൈലർ, PCRE (Perl Compatible Regular Expressions), Zlib Compression Library, OpenSSL< എന്നിവ ഉണ്ടെന്ന് ഉറപ്പാക്കുക. (നിങ്ങൾ എസ്എസ്എൽ പിന്തുണയോടെ Nxing പ്രവർത്തിപ്പിക്കാൻ ഉദ്ദേശിക്കുന്നുവെങ്കിൽ) താഴെ പറയുന്ന കമാൻഡ് നൽകി നിങ്ങളുടെ മെഷീനിൽ പാക്കേജുകൾ ഇൻസ്റ്റാൾ ചെയ്തിട്ടുണ്ട്.

# yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.net.in
 * extras: centos.mirror.net.in
 * updates: centos.mirror.net.in
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: libgomp = 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: cpp = 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: libgcc >= 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-4.el7.x86_64
---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-4.el7 for package: gcc-c++-4.8.5-4.el7.x86_64
--> Processing Dependency: libstdc++ = 4.8.5-4.el7 for package: gcc-c++-4.8.5-4.el7.x86_64
---> Package openssl-devel.x86_64 1:1.0.1e-51.el7_2.4 will be installed
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-51.el7_2.4 for package: 1:openssl-devel-1.0.1e-51.el7_2.4.x86_64
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.1e-51.el7_2.4.x86_64
---> Package pcre-devel.x86_64 0:8.32-15.el7 will be installed
--> Processing Dependency: pcre(x86-64) = 8.32-15.el7 for package: pcre-devel-8.32-15.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-15.el7 will be installed
--> Processing Dependency: zlib = 1.2.7-15.el7 for package: zlib-devel-1.2.7-15.el7.x86_64
...

2. ഇപ്പോൾ Nginx ഔദ്യോഗിക പേജിലേക്ക് പോയി wget കമാൻഡ് ഉപയോഗിച്ച് ലഭ്യമായ ഏറ്റവും പുതിയ സ്റ്റേബിൾ പതിപ്പ് (nginx 1.10.0) നേടുക, TAR ആർക്കൈവ് എക്uസ്uട്രാക്റ്റ് ചെയ്uത് Nginx എക്uസ്uട്രാക്uറ്റുചെയ്uത ഡയറക്uടറി നൽകുക. ഇനിപ്പറയുന്ന കമാൻഡുകൾ ക്രമം.

# wget http://nginx.org/download/nginx-1.10.0.tar.gz
# tar xfz nginx-1.10.0.tar.gz
# cd nginx-1.10.0/
# ls -all
--2016-03-21 09:30:15--  http://nginx.org/download/nginx-1.10.0.tar.gz
Resolving nginx.org (nginx.org)... 206.251.255.63, 95.211.80.227, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org (nginx.org)|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 908954 (888K) [application/octet-stream]
Saving to: ‘nginx-1.10.0.tar.gz’

100%[=====================================================================================================================================================>] 9,08,954    81.0KB/s   in 11s    

2016-03-21 09:30:27 (77.4 KB/s) - ‘nginx-1.10.0.tar.gz’ saved [908954/908954]

3. Nginx ഇൻസ്റ്റാളേഷൻ പ്രക്രിയ ഇച്ഛാനുസൃതമാക്കുക എന്നതാണ് അടുത്ത ഘട്ടം. ഇനിപ്പറയുന്ന കമാൻഡ് ഉപയോഗിച്ച് നിങ്ങളുടെ കംപൈലേഷൻ പ്രക്രിയയ്ക്ക് ആവശ്യമായ കോൺഫിഗറേഷൻ ഓപ്ഷനുകളും മൊഡ്യൂളുകളും ദൃശ്യവൽക്കരിക്കാൻ configure ഫയൽ ഉപയോഗിക്കുക കൂടാതെ നിങ്ങൾ nginx-1.6.0/ പാതയിലാണെന്ന് ഉറപ്പാക്കുക.

# ./configure --help
-help                             print this message

  --prefix=PATH                      set installation prefix
  --sbin-path=PATH                   set nginx binary pathname
  --modules-path=PATH                set modules path
  --conf-path=PATH                   set nginx.conf pathname
  --error-log-path=PATH              set error log pathname
  --pid-path=PATH                    set nginx.pid pathname
  --lock-path=PATH                   set nginx.lock pathname

  --user=USER                        set non-privileged user for
                                     worker processes
  --group=GROUP                      set non-privileged group for
                                     worker processes

  --build=NAME                       set build name
  --builddir=DIR                     set build directory

  --with-select_module               enable select module
  --without-select_module            disable select module
  --with-poll_module                 enable poll module
  --without-poll_module              disable poll module

  --with-threads                     enable thread pool support

  --with-file-aio                    enable file AIO support
  --with-ipv6                        enable IPv6 support

  --with-http_ssl_module             enable ngx_http_ssl_module
  --with-http_v2_module              enable ngx_http_v2_module
...

4. നിങ്ങളുടെ നിർദ്ദിഷ്ട കോൺഫിഗറേഷനുകളും പ്രവർത്തനക്ഷമമാക്കിയ അല്ലെങ്കിൽ പ്രവർത്തനരഹിതമാക്കിയ മൊഡ്യൂളുകളും ഉപയോഗിച്ച് Nginx കംപൈൽ ചെയ്യാനുള്ള സമയമാണിത്. ഈ ട്യൂട്ടോറിയലിനായി ഇനിപ്പറയുന്ന മൊഡ്യൂളുകളും സ്പെസിഫിക്കേഷനുകളും എവിടെയാണ് ഉപയോഗിച്ചിരിക്കുന്നത്, എന്നാൽ നിങ്ങളുടെ ആവശ്യങ്ങൾക്ക് അനുയോജ്യമായ രീതിയിൽ നിങ്ങൾക്ക് കംപൈലേഷൻ മാറ്റാവുന്നതാണ്.

  1. –user=nginx –group=nginx => സിസ്റ്റം ഉപയോക്താവും Nginx ആയി പ്രവർത്തിക്കുന്ന ഗ്രൂപ്പും.
  2. –prefix=/etc/nginx => സെർവർ ഫയലുകൾക്കുള്ള ഡയറക്uടറി (nginx.conf ഫയലും മറ്റ് കോൺഫിഗറേഷൻ ഫയലുകളും) – ഡിഫോൾട്ട് /usr/local/nginx ഡയറക്ടറിയാണ്.
  3. –sbin-path=/usr/sbin/nginx => Nginx എക്uസിക്യൂട്ടബിൾ ഫയൽ ലൊക്കേഷൻ.
  4. –conf-path=/etc/nginx/nginx.conf => nginx.conf കോൺഫിഗറേഷൻ ഫയലിനായി പേര് സജ്ജീകരിക്കുന്നു – നിങ്ങൾക്കത് മാറ്റാം.
  5. –error-log-path=/var/log/nginx/error.log => Nginx പിശക് ലോഗ് ഫയൽ ലൊക്കേഷൻ സജ്ജമാക്കുന്നു.
  6. –http-log-path=/var/log/nginx/access.log => Nginx ആക്uസസ് ലോഗ് ഫയൽ ലൊക്കേഷൻ സജ്ജമാക്കുന്നു.
  7. –pid-path=/var/run/nginx.pid => പ്രധാന പ്രോസസ്സ് ഐഡി ഫയലിന്റെ പേര് സജ്ജീകരിക്കുന്നു.
  8. –lock-path=/var/run/nginx.lock => Nginx ലോക്ക് ഫയലിനായി പേര് സജ്ജമാക്കുന്നു.
  9. –with-http_ssl_module => HTTPS മൊഡ്യൂൾ നിർമ്മിക്കുന്നത് പ്രവർത്തനക്ഷമമാക്കുന്നു – സ്ഥിരസ്ഥിതിയായി നിർമ്മിച്ചതല്ല കൂടാതെ OpenSSL ലൈബ്രറി ആവശ്യമാണ്.
  10. –with-pcre => PCRE ലൈബ്രറിയുടെ ഉറവിടങ്ങളിലേക്കുള്ള പാത സജ്ജീകരിക്കുന്നു – സ്ഥിരസ്ഥിതിയായി നിർമ്മിച്ചതല്ല, PCRE ലൈബ്രറി ആവശ്യമാണ്.

എല്ലാ Nginx മൊഡ്യൂളുകളുടെയും ഒരു ലിസ്റ്റ് കാണുന്നതിന് http://wiki.nginx.org/Modules എന്നതിൽ Nginx വിക്കി വെബ് പേജ് സന്ദർശിക്കുക.

നിങ്ങൾക്ക് Nginx-ൽ ഇൻസ്റ്റാൾ ചെയ്ത ഒരു നിർദ്ദിഷ്ട മൊഡ്യൂൾ ആവശ്യമില്ലെങ്കിൽ, ഇനിപ്പറയുന്ന കമാൻഡ് ഉപയോഗിച്ച് നിങ്ങൾക്ക് അത് പ്രവർത്തനരഹിതമാക്കാം.

--without-module_name

ഇപ്പോൾ താഴെ പറയുന്ന കമാൻഡ് നൽകി Nginx കംപൈൽ ചെയ്യാൻ ആരംഭിക്കുക, അത് മുകളിൽ ചർച്ച ചെയ്ത എല്ലാ കോൺഫിഗറേഷനുകളും മൊഡ്യൂളുകളും ഉപയോഗിക്കും (കമാൻഡ് ഒരു വരിയിൽ തന്നെ തുടരുന്നുവെന്ന് ഉറപ്പാക്കുക).

# ./configure --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --with-http_ssl_module --with-pcre
checking for OS
 + Linux 3.10.0-229.el7.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) 
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for poll() ... found
checking for /dev/poll ... not found
...

5. GNU C കമ്പൈലർ, PCRE, OpenSSL ലൈബ്രറികൾ പോലെയുള്ള സിസ്റ്റത്തിന് ആവശ്യമായ എല്ലാ യൂട്ടിലിറ്റികളും കംപൈലേഷൻ പ്രക്രിയ പരിശോധിച്ച ശേഷം, അത് make.conf ഫയൽ സൃഷ്ടിക്കുകയും എല്ലാ കോൺഫിഗറേഷനുകളുടെയും ഒരു സംഗ്രഹം ഔട്ട്പുട്ട് ചെയ്യുകയും ചെയ്യുന്നു.

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/etc/nginx"
  nginx binary file: "/usr/sbin/nginx"
  nginx modules path: "/etc/nginx/modules"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/var/run/nginx.pid"
  nginx error log file: "/var/log/nginx/error.log"
  nginx http access log file: "/var/log/nginx/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

6. അവസാന ഘട്ടം make കമാൻഡ് ഉപയോഗിച്ച് ബൈനറികൾ നിർമ്മിക്കുക എന്നതാണ്, ഇത് നിങ്ങളുടെ മെഷീൻ ഉറവിടങ്ങളെ ആശ്രയിച്ച് പൂർത്തിയാക്കാൻ കുറച്ച് സമയമെടുക്കും, കൂടാതെ make install ഉപയോഗിച്ച് നിങ്ങളുടെ സിസ്റ്റത്തിൽ Nginx ഇൻസ്റ്റാൾ ചെയ്യുക. കമാൻഡ്.

ഇൻസ്റ്റാളേഷൻ നടത്തുന്നതിന് ഇൻസ്റ്റാൾ ചെയ്യുന്നതിന് റൂട്ട് പ്രത്യേകാവകാശങ്ങൾ ആവശ്യമാണ് എന്നത് ശ്രദ്ധിക്കുക, അതിനാൽ നിങ്ങൾ റൂട്ട് അക്കൗണ്ട് ഉപയോഗിച്ച് ലോഗിൻ ചെയ്തിട്ടില്ലെങ്കിൽ sudo ഉള്ള ഒരു പ്രിവിലേജ് ഉപയോക്താവിനെ ഉപയോഗിക്കുക.

# make
# make install
make -f objs/Makefile
make[1]: Entering directory `/root/nginx-1.10.0'
make[1]: Warning: File `src/core/nginx.h' has modification time 3110036 s in the future
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/nginx.o \
	src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_log.o \
	src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_palloc.o \
	src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_array.o \
	src/core/ngx_array.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_list.o \
	src/core/ngx_list.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_hash.o \
	src/core/ngx_hash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_buf.o \
	src/core/ngx_buf.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_queue.o \
...
make -f objs/Makefile install
make[1]: Entering directory `/root/nginx-1.10.0'
make[1]: Warning: File `src/core/nginx.h' has modification time 3109935 s in the future
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/nginx.o \
	src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_log.o \
	src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_palloc.o \
	src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_array.o \
	src/core/ngx_array.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_list.o \
	src/core/ngx_list.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_hash.o \
	src/core/ngx_hash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_buf.o \
	src/core/ngx_buf.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_queue.o \
...

ഘട്ടം 2: Nginx തിരുത്തി INIT സ്uക്രിപ്റ്റ് സൃഷ്uടിക്കുക

7. ഇൻസ്റ്റലേഷൻ പ്രക്രിയ വിജയകരമായി പൂർത്തിയാക്കിയ ശേഷം, nginx സിസ്റ്റം ഉപയോക്താവിനെ ചേർക്കുക (/etc/nginx/ അവന്റെ ഹോം ഡയറക്uടറിയും സാധുവായ ഷെല്ലും ഇല്ലാതെ), Nginx എന്ന ഉപയോക്താവിനെ ചേർക്കുക ഇനിപ്പറയുന്ന കമാൻഡ് നൽകിക്കൊണ്ട് പ്രവർത്തിക്കും.

# useradd -d /etc/nginx/ -s /sbin/nologin nginx

8. കംപൈലേഷൻ പ്രക്രിയയിൽ, nginx സിസ്റ്റം ഉപയോക്താവിൽ നിന്ന് Nginx പ്രവർത്തിക്കുമെന്ന് ഞങ്ങൾ വ്യക്തമാക്കിയിരുന്നു, nginx.conf ഫയൽ തുറന്ന് ഉപയോക്തൃ പ്രസ്താവന nginx.

# nano /etc/nginx/nginx.conf

താഴെപ്പറയുന്ന ഓപ്uഷനുകൾ ഉപയോഗിച്ച് ഉപയോക്താവിനെ കണ്ടെത്തി മാറ്റുക, കൂടാതെ റൂട്ട് ലൊക്കേഷൻ സ്റ്റേറ്റ്uമെന്റുകൾ ഡോക്യുമെന്റ് ചെയ്യുക.

user nginx;
location / {
                root /srv/www/html;
                autoindex on;
                index index.html index.htm;

9. Nginx ആരംഭിക്കുന്നതിന് മുമ്പ്, നിങ്ങൾ വെബ് ഡോക്യുമെന്റ് റൂട്ട് പാത്ത് സൃഷ്ടിച്ചുവെന്ന് ഉറപ്പാക്കുക, തുടർന്ന് ഇനിപ്പറയുന്ന കമാൻഡ് ഉപയോഗിച്ച് nginx ആരംഭിക്കുക.

# mkdir -p /srv/www/html
# /usr/sbin/nginx

നിങ്ങളുടെ ഷെൽ പ്രോംപ്റ്റ് ഉപയോഗിച്ച് Nginx പ്രവർത്തിക്കുന്നുണ്ടോയെന്ന് പരിശോധിക്കണമെങ്കിൽ, ലിസൻ കണക്ഷനുകൾ പരിശോധിക്കാൻ netstat കമാൻഡ് പ്രവർത്തിപ്പിക്കുക.

# netstat -tulpn | grep nginx

10. ഒരു റിമോട്ട് സിസ്റ്റത്തിൽ നിന്ന് ഇത് സ്ഥിരീകരിക്കുന്നതിന്, 80 പോർട്ടിൽ പുറത്തേക്കുള്ള കണക്ഷൻ തുറക്കുന്നതിന് ഒരു ഫയർവാൾ റൂൾ ചേർക്കുക, ഒരു ബ്രൗസർ തുറന്ന് http://server_IP-ൽ നിങ്ങളുടെ സെർവർ IP വിലാസത്തിലേക്ക് URL നൽകുക. .

# firewall-cmd --add-service=http  ## For on-fly rule
# firewall-cmd --permanent --add-service=http  ## For permanent rule
# systemctl restart firewalld

11. Nginx പ്രോസസ്സ് നിയന്ത്രിക്കുന്നതിന് ഇനിപ്പറയുന്ന കമാൻഡുകൾ ഉപയോഗിക്കുക.

  1. nginx -V = Nginx മൊഡ്യൂളുകളും കോൺഫിഗറേഷനുകളും പ്രദർശിപ്പിക്കുന്നു
  2. nginx -h = സഹായ ഓപ്ഷനുകൾ
  3. nginx = Nginx പ്രോസസ്സ് ആരംഭിക്കുക
  4. nginx -s stop = Nginx പ്രോസസ്സ് നിർത്തുക
  5. nginx -s റീലോഡ് = Nginx പ്രോസസ്സ് റീലോഡ് ചെയ്യുക

# nginx -V
nginx version: nginx/1.10.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) 
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --with-http_ssl_module --with-pcre

12. നിങ്ങൾക്ക് ഒരു init RHEL/CentOS സ്uക്രിപ്റ്റ് വഴി Nginx ഡെമൺ പ്രോസസ്സ് മാനേജ് ചെയ്യണമെങ്കിൽ, ഇനിപ്പറയുന്ന nginx ഫയൽ /etc/init.d/ സിസ്റ്റം പാത്തിൽ സൃഷ്uടിക്കുക, കൂടാതെ, തുടർന്ന്, പ്രക്രിയ നിയന്ത്രിക്കുന്നതിന് നിങ്ങൾക്ക് service അല്ലെങ്കിൽ systemctl കമാൻഡുകൾ ഉപയോഗിക്കാം.

# nano /etc/init.d/nginx

ഇനിപ്പറയുന്ന ഫയൽ ഉള്ളടക്കം ചേർക്കുക.

#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#

# chkconfig:   - 85 15
# description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
#               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /etc/nginx/nginx.conf
# pidfile:     /var/run/nginx.pid
# user:        nginx

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/etc/nginx/nginx.conf"
lockfile=/var/run/nginx.lock

start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    configtest || return $?
    stop
    start
}

reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}

force_reload() {
    restart
}

configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
   *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac

13. Nginx init ഫയൽ സൃഷ്ടിച്ച ശേഷം, എക്സിക്യൂഷൻ പെർമിഷനുകൾ ചേർക്കുകയും താഴെയുള്ള കമാൻഡ് ഓപ്ഷനുകൾ ഉപയോഗിച്ച് ഡെമൺ മാനേജ് ചെയ്യുകയും ചെയ്യുക.

# chmod +x /etc/init.d/nginx
# service nginx start|stop|restart|reload|force_reload|configtest|condrestart
# systemctl start|stop|restart nginx

14. നിങ്ങൾക്ക് Nginx സിസ്റ്റം-വൈഡ് പ്രവർത്തനക്ഷമമാക്കണമെങ്കിൽ, ബൂട്ട് സമയത്ത് ആരംഭിക്കുന്നതിന് ഇനിപ്പറയുന്ന കമാൻഡ് ഉപയോഗിക്കുക.

# chkconfig nginx on

OR

# systemctl enable nginx

അത്രയേയുള്ളൂ! ഇപ്പോൾ നിങ്ങളുടെ RHEL/CentOS 7 സിസ്റ്റത്തിൽ Nginx-ന്റെ ഏറ്റവും പുതിയ പതിപ്പ് ഇൻസ്റ്റാൾ ചെയ്തിട്ടുണ്ട്. Nginx FastCGI ഗേറ്റ്uവേ ആണെങ്കിലും PHP-FPM പ്രോസസ്സ് മാനേജർ എങ്ങനെ ഇൻസ്റ്റാൾ ചെയ്യാമെന്നും പ്രവർത്തനക്ഷമമാക്കാമെന്നും അടുത്ത ട്യൂട്ടോറിയലിൽ ഞാൻ ചർച്ച ചെയ്യും.

ഇതും വായിക്കുക: Nginx വെബ് സെർവറിന്റെ പ്രകടനം സുരക്ഷിതമാക്കാനും കഠിനമാക്കാനും മെച്ചപ്പെടുത്താനുമുള്ള ആത്യന്തിക ഗൈഡ്