{"id":1577,"date":"2018-10-24T17:53:14","date_gmt":"2018-10-24T17:53:14","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=1577"},"modified":"2018-10-25T02:21:55","modified_gmt":"2018-10-25T02:21:55","slug":"install-the-ngx_cache_purge-module-in-nginx","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/24\/install-the-ngx_cache_purge-module-in-nginx\/","title":{"rendered":"Install The ngx_cache_purge Module In Nginx"},"content":{"rendered":"<p>Ngx_cache_purge is a module which will allow the fastcgi_cache, proxy, SCGI and uWSGI caches to have content purged from them. The caches allow precompiled code to be served as opposed to running a new version each time. This can greatly reduce the amount of processing power per page request. This specific module allows that cached content to be purged when needed. To compile this module from source if you have done a source build of Nginx like this <a href=\"https:\/\/linuxadmin.io\/nginx-compile-source\/\">Nginx Compile From Source On CentOS<\/a>. Adding the module is pretty straightforward. You can read more about the module <a href=\"http:\/\/labs.frickle.com\/nginx_ngx_cache_purge\/README\">here<\/a><\/p>\n<p>First get the ngx_cache_purge package<\/p>\n<p>wget -O \/usr\/src\/ngx_cache_purge-2.3.tar.gz http:\/\/labs.frickle.com\/files\/ngx_cache_purge-2.3.tar.gz<\/p>\n<p>Uncompress the package<\/p>\n<p>tar xfvz ngx_cache_purge-2.3.tar.gz<\/p>\n<p>cd to your Nginx build directory<\/p>\n<p>cd \/usr\/src\/nginx-1.11.13<\/p>\n<p>Get the prior build configuration options<\/p>\n<p># nginx -V<br \/>\nnginx version: nginx\/1.11.13<br \/>\nbuilt by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)<br \/>\nbuilt with OpenSSL 1.0.1e-fips 11 Feb 2013<br \/>\nTLS SNI support enabled<br \/>\nconfigure arguments: &#8211;user=nginx &#8211;group=nginx &#8211;prefix=\/etc\/nginx &#8211;sbin-path=\/usr\/sbin\/nginx &#8211;conf-path=\/etc\/nginx\/nginx.conf &#8211;pid-path=\/var\/run\/nginx.pid &#8211;lock-path=\/var\/run\/nginx.lock &#8211;error-log-path=\/var\/log\/nginx\/error.log &#8211;http-log-path=\/var\/log\/nginx\/access.log &#8211;with-http_gzip_static_module &#8211;with-http_stub_status_module &#8211;with-http_ssl_module &#8211;with-pcre &#8211;with-file-aio &#8211;with-http_realip_module &#8211;without-http_scgi_module &#8211;without-http_uwsgi_module &#8211;with-http_realip_module<\/p>\n<p>Copy all of the configure arguments and append \u2013add-module=\/path\/to\/ngx_cache_purge<\/p>\n<p>.\/configure &#8211;user=nginx &#8211;group=nginx &#8211;prefix=\/etc\/nginx &#8211;sbin-path=\/usr\/sbin\/nginx &#8211;conf-path=\/etc\/nginx\/nginx.conf &#8211;pid-path=\/var\/run\/nginx.pid &#8211;lock-path=\/var\/run\/nginx.lock &#8211;error-log-path=\/var\/log\/nginx\/error.log &#8211;http-log-path=\/var\/log\/nginx\/access.log &#8211;with-http_gzip_static_module &#8211;with-http_stub_status_module &#8211;with-http_ssl_module &#8211;with-pcre &#8211;with-file-aio &#8211;with-http_realip_module &#8211;without-http_scgi_module &#8211;without-http_uwsgi_module &#8211;with-http_realip_module &#8211;add-module=\/usr\/src\/ngx_cache_purge-2.3<\/p>\n<p>Once configure has finished, You can go ahead perform a make and install it<\/p>\n<p>make<\/p>\n<p>make install<\/p>\n<p>Then restart nginx<\/p>\n<p>\/etc\/init.d\/nginx restart<\/p>\n<p>Run the following to ensure the module is now loaded:<\/p>\n<p>nginx -V 2&gt;&amp;1 | grep ngx_cache_purge -o<\/p>\n<p>It should return ngx_cache_purge if it is.<\/p>\n<p>That is all you need to do to add the module to a Nginx build.<\/p>\n<p>May 28, 2017LinuxAdmin.io<\/p>\n<p><a href=\"https:\/\/linuxadmin.io\/add-ngx_cache_purge-module-to-nginx\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ngx_cache_purge is a module which will allow the fastcgi_cache, proxy, SCGI and uWSGI caches to have content purged from them. The caches allow precompiled code to be served as opposed to running a new version each time. This can greatly reduce the amount of processing power per page request. This specific module allows that cached &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/24\/install-the-ngx_cache_purge-module-in-nginx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install The ngx_cache_purge Module In Nginx&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1577","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=1577"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1577\/revisions"}],"predecessor-version":[{"id":1635,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1577\/revisions\/1635"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=1577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=1577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=1577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}