{"id":280855,"date":"2016-11-12T17:20:03","date_gmt":"2016-11-12T14:20:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280855"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280855","title":{"rendered":"\u0421\u0431\u043e\u0440\u043a\u0430 nginx: CentOS 6.8, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0433\u0440\u0430\u0431\u043b\u0438"},"content":{"rendered":"<p>\u041d\u0435\u0434\u043e\u043b\u044e\u0431\u043b\u0438\u0432\u0430\u044e \u043f\u0430\u043a\u0435\u0442\u044b redhat. \u041e\u043d\u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b: \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435; \u043e\u043d\u0438 \u043d\u0435 \u0434\u0430\u044e\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0438 \u043a\u043e\u0435-\u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435, \u043e \u0447\u0451\u043c \u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0441\u043e\u0431\u0440\u0430\u043b \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440 \u2013 \u00ab\u043c\u043e\u043b\u043e\u0434\u0435\u0446\u00bb, \u0441\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0447\u0435\u043c? <br \/>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430 \u0443\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0440\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0435 \u0446\u0435\u043b\u044c\u043d\u044b, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u0441\u044b\u043b\u0430\u044e\u0442 \u043a \u0434\u0430\u043b\u0451\u043a\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439. \u042f <a href=\"https:\/\/gist.github.com\/stranger777\/b683dfb5055067c0e5f9070e07ff7d52#file-nginx_centos68_src_installation-sh\">\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0445, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 bash \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u0440\u044f\u0442\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0434\u0435\u043b\u0430\u044f \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0430 \u043d\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b server_tokens, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e?<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u043d\u0443 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 nginx. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0435\u0439 \u0432\u0435\u0440\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash wget ftp:\/\/ftp.csx.cam.ac.uk\/pub\/software\/programming\/pcre\/pcre-8.39.tar.gz tar -zxf pcre-8.39.tar.gz cd pcre-8.39 .\/configure make sudo make install  wget http:\/\/zlib.net\/zlib-1.2.8.tar.gz tar -zxf zlib-1.2.8.tar.gz cd zlib-1.2.8 .\/configure make sudo make install  wget http:\/\/www.openssl.org\/source\/openssl-1.0.2f.tar.gz tar -zxf openssl-1.0.2f.tar.gz cd openssl-1.0.2f<\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 OpenSSL \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 <a href=\"https:\/\/github.com\/openssl\/openssl\/blob\/master\/config\">\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f config<\/a>, \u0430 <a href=\"https:\/\/www.nginx.com\/resources\/admin-guide\/installing-nginx-open-source\/#dependencies\">\u0437\u0434\u0435\u0441\u044c<\/a>:  <\/p>\n<pre><code class=\"bash\">.\/configure darwin64-x86_64-cc --prefix=\/usr make sudo make install  wget http:\/\/nginx.org\/download\/nginx-1.10.2.tar.gz tar zxf nginx-1.10.2.tar.gz cd nginx-1.10.2  .\/configure --sbin-path=\/usr\/local\/nginx\/nginx --conf-path=\/usr\/local\/nginx\/nginx.conf --pid-path=\/usr\/local\/nginx\/nginx.pid --with-pcre=..\/pcre-8.39 --with-zlib=..\/zlib-1.2.8 --with-http_ssl_module --with-stream --with-mail=dynamic --add-module=\/usr\/build\/nginx-rtmp-module --add-dynamic-module=\/usr\/build\/3party_module  make sudo make install sudo nginx<\/code><\/pre>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0443\u0442\u0438\u043d\u0430: \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0438\u0445 \u043f\u0430\u043f\u043a\u0443. \u0412 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0443\u044e \u0432 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e bash, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0441 7z \u0438 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0430\u0440\u0445\u0438\u0432\u0430.  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash set -x sudo yum -y install p7zip wget tidy util-linux openssl-devel<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0435\u043d\u044c \u0430\u0440\u0445\u0438\u0432\u0430:  <\/p>\n<pre><code class=\"bash\">arroot () { 7z l &quot;$1&quot; | grep '^[0-9][0-9][0-9][0-9]' | head -n1  | gawk '{print $NF}' }<\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0430\u0440\u0445\u0438\u0432\u044b \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0434\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \/usr\/local\/src:  <\/p>\n<pre><code class=\"bash\">gotosrc () { cd &quot;$HOME&quot; echo &quot;$1&quot; &gt; \/var\/tmp\/gawk.temp arname=$(gawk -F\/ '{print $NF}' \/var\/tmp\/gawk.temp)  \tif ! test -f &quot;$arname&quot;; then { \twget -P &quot;$PWD&quot; &quot;$1&quot; \t} \tfi  7z x &quot;$arname&quot;  \tif test -f $(arroot &quot;$arname&quot;); then { \t7z x $(arroot &quot;$arname&quot;) \tsrcfold=$( arroot $(arroot &quot;$arname&quot;) ) \t} else { \tsrcfold=$( arroot &quot;$arname&quot; ) \t}  \tfi  cd &quot;$srcfold&quot;; ls -la }<\/code><\/pre>\n<p>  \u041a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0430\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f configure:  <\/p>\n<pre><code class=\"bash\">setconfex () { \tif ! test -x configure; then { \tsudo chmod +x configure \t} \tfi }<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 make. \u0412 \u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440e make -jn, n \u2013 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 make. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0437\u043d\u0430\u0451\u043c \u0447\u0438\u0441\u043b\u043e \u044f\u0434\u0435\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430:  <\/p>\n<pre><code class=\"bash\">getnumcores () { echo $(( $(lscpu -p=core | wc -l) - 4  )) } # ... make -j$(getnumcores); sudo make -j$(getnumcores) install<\/code><\/pre>\n<p>  \u041e\u043d\u0430 \u0436\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 nginx.<br \/>  \u0410 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0439 \u0430\u0440\u0445\u0438\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">getlatestlink_nginx () { # tidy \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b grep curl &quot;http:\/\/nginx.org\/en\/download.html&quot; | tidy -imc | grep &quot;\/download\/nginx&quot; | gawk -F'&quot;' '{print $2}' &gt; \/var\/tmp\/temp.file.gawk branchnum=$( head -n1 \/var\/tmp\/temp.file.gawk | gawk -F'.' '{print $2}' )  \tif [ &quot;$(( $branchnum % 2 ))&quot; = &quot;1&quot; ]; then { \tlatestlink=&quot;https:\/\/nginx.org&quot;$( grep &quot;$(($branchnum - 1))&quot; \/var\/tmp\/temp.file.gawk | head -n1 ) \techo &quot;$latestlink&quot; \t}  \tfi }<\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 git clone? \u0410\u0440\u0445\u0438\u0432\u044b \u043f\u0440\u043e\u0449\u0435, \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0439, \u0434\u0430 \u0438 github \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 zip-\u0430\u0440\u0445\u0438\u0432.  <\/p>\n<pre><code class=\"bash\">gotosrc $( getlatestlink_nginx )<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438 \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (<a href=\"https:\/\/gist.github.com\/stranger777\/b683dfb5055067c0e5f9070e07ff7d52#file-nginx_centos68_src_installation-sh\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0432\u0435\u0441\u044c \u043a\u043e\u0434<\/a>) \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 nginx, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u044f\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0443\u0441\u0442\u044b\u043c\u0438:  <\/p>\n<pre><code class=\"bash\">hidengxver () { read -r -p &quot;Your own http_server_string for safety: &quot; http_server_string first_string=&quot;static char ngx_http_server_string\\[\\] = \\&quot;Server: nginx\\&quot; CRLF;&quot; second_string=&quot;static char ngx_http_server_string\\[\\] = \\&quot;$http_server_string\\&quot; CRLF;&quot; sed -ire &quot;s\/$first_string\/$second_string\/g&quot; src\/http\/ngx_http_header_filter_module.c \t read -r -p &quot;Your own NGINX_VER const: &quot; nginx_ver third_string=&quot;\\#define NGINX\\_VER          \\&quot;nginx\\\/\\&quot; NGINX\\_VERSION&quot; forth_string=&quot;\\#define NGINX\\_VER          \\&quot;$nginx_ver\\&quot; NGINX\\_VERSION&quot; sed -ire &quot;s\/$third_string\/$forth_string\/g&quot; src\/core\/nginx.h \t real_nginx_version=$( grep '#define NGINX_VERSION' src\/core\/nginx.h | gawk -F'&quot;' '{print $2}' ) read -r -p &quot;Your own NGINX_VERSION const: &quot; new_nginx_version fifth_string=&quot;\\#define NGINX\\_VERSION      \\&quot;$real_nginx_version\\&quot;&quot; sixth_string=&quot;\\#define NGINX\\_VERSION      \\&quot;$new_nginx_version\\&quot;&quot; sed -ire &quot;s\/$fifth_string\/$sixth_string\/g&quot; src\/core\/nginx.h  }<\/code><\/pre>\n<p>  \u041b\u043e\u0432\u043a\u043e\u0441\u0442\u044c sed \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0438. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 nginx \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u043a\u0430\u0436\u0435\u0442 \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u043d\u043e \u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0435\u0451 \u0437\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f StackOverflow Martin M. <a href=\"http:\/\/serverfault.com\/a\/279389\/382998\">\u0437\u0430 \u0435\u0433\u043e \u043f\u043e\u0441\u0442<\/a> \u2013 \u043e\u0441\u043d\u043e\u0432\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  \u0418 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0427\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445? \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0418 \u0435\u0441\u043b\u0438 \u0431\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b service nginx start \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c, \u0442\u043e \u0431\u0435\u0437 \u0440\u043e\u0442\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u043e\u0432\u2026 \u0421\u0430\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043f\u0430\u043a\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043c\u0435\u0441\u0442\u0430\u043c.  <\/p>\n<pre><code class=\"bash\">gotorpm () { cd &quot;$HOME&quot; echo &quot;$1&quot; &gt; \/var\/tmp\/gawk.temp rpmname=$(gawk -F\/ '{print $NF}' \/var\/tmp\/gawk.temp)  \tif ! test -f &quot;$rpmname&quot;; then { \twget -P &quot;$PWD&quot; &quot;$1&quot; \t} \tfi  7z x &quot;$rpmname&quot; rpmname_size=${#rpmname} rpmfold=${rpmname:0:($rpmname_size-4)} mkdir &quot;$rpmfold&quot;; mv &quot;$rpmfold&quot;&quot;.cpio&quot; &quot;$rpmfold&quot; cd &quot;$rpmfold&quot; 7z x &quot;$rpmfold&quot;&quot;.cpio&quot; ls -la }<\/code><\/pre>\n<p>  \u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u2013 \u0437\u043b\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0441\u043d\u0430 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0435\u043b\u043e.<br \/>  <b>\u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/b>: \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u044b \u043d\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \/usr, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0440\u0434\u0430\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \/usr\/local\/nginx \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0434\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443:  <\/p>\n<pre><code class=\"bash\">modify_nginx_init () { first_init_string=&quot;NGINX\\=\\\/usr\\\/sbin\\\/nginx&quot; second_init_string=&quot;NGINX\\=\\\/usr\\\/local\\\/nginx\\\/sbin\\\/nginx&quot; sudo sed -ire &quot;s\/$first_init_string\/$second_init_string\/g&quot; etc\/sysconfig\/nginx  third_init_string=&quot;nginx\\=\\${NGINX\\-\\\/usr\\\/sbin\\\/nginx}&quot; forth_init_string=&quot;nginx\\=\\${NGINX\\-\\\/usr\\\/local\\\/nginx\\\/sbin\\\/nginx}&quot; sudo sed -ire &quot;s\/$third_init_string\/$forth_init_string\/g&quot; etc\/rc.d\/init.d\/nginx }<\/code><\/pre>\n<p>  \u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0435 \u0441 \u041b\u0438\u043d\u0443\u043a\u0441 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 user{add,mod.del} \u0447\u0438\u0441\u0442\u043e \u043f\u0441\u0438\u0445\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0435\u0449\u0451 \u0434\u0432\u0443\u0445:  <\/p>\n<pre><code class=\"bash\">userlist () { sudo gawk -F: '{print $1}' \/etc\/passwd | sort -g }  userex () { \tif [ &quot;$( userlist | grep &quot;$1&quot; )&quot; = &quot;$1&quot;  ]; then { \treturn 0  \t}  \telse {  \treturn 1  \t}  \tfi }<\/code><\/pre>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">install_nginx () { nginx_install_prefix=&quot;\/usr\/local\/nginx&quot; #install pcre gotosrc &quot;ftp:\/\/ftp.csx.cam.ac.uk\/pub\/software\/programming\/pcre\/pcre-8.39.tar.gz&quot; setconfex .\/configure --prefix=$nginx_install_prefix make -j$(getnumcores) sudo make -j$(getnumcores) install #instaall zlib gotosrc &quot;http:\/\/zlib.net\/zlib-1.2.8.tar.gz&quot; setconfex .\/configure --prefix=$nginx_install_prefix make -j$(getnumcores) sudo make -j$(getnumcores) install #install nginx gotosrc $(getlatestlink_nginx) setconfex hidengxver<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b configure \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<pre><code class=\"bash\">.\/configure --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 --http-client-body-temp-path=\/var\/cache\/nginx\/client_temp --http-proxy-temp-path=\/var\/cache\/nginx\/proxy_temp --http-fastcgi-temp-path=\/var\/cache\/nginx\/fastcgi_temp --http-uwsgi-temp-path=\/var\/cache\/nginx\/uwsgi_temp --http-scgi-temp-path=\/var\/cache\/nginx\/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-ipv6 --with-pcre=..\/pcre-8.39 --with-zlib=..\/zlib-1.2.8 make -j$(getnumcores); sudo make -j$(getnumcores) install  gotorpm &quot;https:\/\/nginx.org\/packages\/centos\/6\/x86_64\/RPMS\/nginx-1.10.2-1.el6.ngx.x86_64.rpm&quot;  modify_nginx_init sudo cp etc\/sysconfig\/nginx \/etc\/sysconfig\/nginx sudo cp etc\/logrotate.d\/nginx \/etc\/logrotate.d\/nginx sudo cp etc\/rc.d\/init.d\/nginx \/etc\/rc.d\/init.d\/nginx<\/code><\/pre>\n<p>  \u0414\u0430, \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0436\u0430\u043b\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0430\u043f\u043e\u043a, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0451 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0443. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">if ! test -d \/var\/cache\/nginx\/client_temp; then { sudo mkdir -p \/var\/cache\/nginx\/client_temp } fi<\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c nginx, \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"bash\">if ! userex &quot;nginx&quot;; then { sudo useradd --home-dir \/var\/cache\/nginx &quot;nginx&quot; } fi<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441:  <\/p>\n<pre><code class=\"bash\">sudo chmod +x \/etc\/rc.d\/init.d\/nginx sudo chkconfig --add nginx<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0438 \u043e\u043d\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0438\u043b\u0438 \u043c\u0435\u0440\u0442\u0432\u0430:  <\/p>\n<pre><code class=\"bash\">if [ -z &quot;$( sudo service nginx status | grep &quot;stopped&quot;  )&quot; ]; then { sudo service nginx stop } fi sudo service nginx start; sudo chkconfig nginx on sudo service nginx status<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b Engine X \u043d\u0435 \u043f\u043e\u0441\u043b\u0430\u043b \u043d\u0430 Forbidden:  <\/p>\n<pre><code class=\"bash\">sudo chown -R &quot;nginx&quot; &quot;$nginx_install_prefix&quot;&quot;\/html&quot; curl localhost }  install_nginx<\/code><\/pre>\n<p>  <a href=\"https:\/\/gist.github.com\/stranger777\/b683dfb5055067c0e5f9070e07ff7d52#file-nginx_centos68_src_installation-sh\">\u0415\u0449\u0451 \u0440\u0430\u0437 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/315098\/\"> https:\/\/habrahabr.ru\/post\/315098\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0434\u043e\u043b\u044e\u0431\u043b\u0438\u0432\u0430\u044e \u043f\u0430\u043a\u0435\u0442\u044b redhat. \u041e\u043d\u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b: \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435; \u043e\u043d\u0438 \u043d\u0435 \u0434\u0430\u044e\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0438 \u043a\u043e\u0435-\u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435, \u043e \u0447\u0451\u043c \u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0441\u043e\u0431\u0440\u0430\u043b \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440 \u2013 \u00ab\u043c\u043e\u043b\u043e\u0434\u0435\u0446\u00bb, \u0441\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0447\u0435\u043c? <br \/>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430 \u0443\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0440\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0435 \u0446\u0435\u043b\u044c\u043d\u044b, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u0441\u044b\u043b\u0430\u044e\u0442 \u043a \u0434\u0430\u043b\u0451\u043a\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439. \u042f <a href=\"https:\/\/gist.github.com\/stranger777\/b683dfb5055067c0e5f9070e07ff7d52#file-nginx_centos68_src_installation-sh\">\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0445, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 bash \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u0440\u044f\u0442\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0434\u0435\u043b\u0430\u044f \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0430 \u043d\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b server_tokens, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-280855","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280855"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280855\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}