Nginx 99: Cannot assign requested address to upstream

Published on Author gryzli

If you are using Nginx for reverse or caching proxy and you are making some good amount of traffic, soon or later you are going to have issues with the TCP connections between Nginx and your backend.  You will start getting error messages looking like this:  [crit] 2323#0: *535353 connect() to 127.0.0.1:8080 failed (99: Cannot… Continue reading Nginx 99: Cannot assign requested address to upstream

Lua – Simple method to use Memcache

Published on Author gryzliLeave a comment

If you need fast and lightweight method of connecting with Memcache daemon, you can do it by just using the ‘socket’ module and open a TCP connection to the Memcache daemon.  After you have your connection done to Memcache, you could issue all kind of commands for getting/storing information.    Code

  The following… Continue reading Lua – Simple method to use Memcache

Ansible Debug Print All Variables

Published on Author gryzli

I have written a post about how to debug playbooks by dumping all variables in file (on remote server) by using Ansible template file. Here is some faster and more convenient way to print multiple variables or all with debug purpose inside a playbook.   Ansible provides very handy module – debug_module, which is described… Continue reading Ansible Debug Print All Variables

Centos 7 – Installing Collectd and Collectd-Web

Published on Author gryzli

Installing collectd/collectd-web is pretty easy (if we dont dive into the deep water). So the whole installation is basically installing several packages + few config modifications.   # Installing Collectd   # Install Centos 7 epel repository

  # Install collectd + rrd support

  # Uncomment some lines in collectd config file… Continue reading Centos 7 – Installing Collectd and Collectd-Web

Regex (PCRE) matching row with excluded words

Published on Author gryzli

Recently I had a task to match a given row, only if it contains words, different than a predefined non-matching word list.    Here is the example: Let say we have the excluded words: “bad_word1|bad_word2” We must match a row only if there words, different than the bad words from above   That should match:… Continue reading Regex (PCRE) matching row with excluded words

Configuring KeepAlive with Apache RewriteRule [P] Proxying

Published on Author gryzli

Apache can be used for proxying requests with mod_proxy to a certain backend/upstream server. Here is how a simple proxy configuration looks:

The Problem The problem with this configuration is that Apache will create new TCP session to backend (192.168.1.1:8080) for every new request it receives. This might look as an innocent detail at… Continue reading Configuring KeepAlive with Apache RewriteRule [P] Proxying

Sed – Deleting Multiline Patterns

Published on Author gryzli

Here is an easy way to delete multiline patterns with sed.   Let say we have the following pattern:  

  Now consider we want to delete the BEGIN/END block,  containing “ID:45”:

  And here is some explanation of the command run above:

 

Nginx – Configuring reverse proxy + caching

Published on Author gryzliLeave a comment

Here are some useful steps, how to configure nginx reverse proxy + caching.      1) How does Nginx  proxy cache works ?        In the scheme above we are considering that we have Apache upstream/origin server and in front of it Nginx which does reverse proxying + caching of Apache response.   … Continue reading Nginx – Configuring reverse proxy + caching

Protect from CVE-2016-5195 (DirtyCow) on Centos 7/RHEL7/cPanel/CloudLinux

Published on Author gryzli2 Comments

On october 19 2016, the Dirty Cow vulnerability went public (which is kernel privilege escalation vulnerability) . From what I have read and test, the exploit is working only on Centos 7/ RHEL7 / Cloudlinux 7 distros . I don’t know for other distros, because I’m not interested in them. How to protect yourself from… Continue reading Protect from CVE-2016-5195 (DirtyCow) on Centos 7/RHEL7/cPanel/CloudLinux