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: ProxyPreserveHost On RewriteEngine On RewriteRule ^/(.*)$ http://192.168.1.1:8080/$1 [P] 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… 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:   root@localhost# cat ss.txt BEGIN ID:45 LS:33 END BEGIN ID:50 LS:33 END BEGIN ID:47 LS:33 END BEGIN ID:55 LS:35 END   Now consider we want to delete the BEGIN/END block,  containing “ID:45”: [gryzli@localhost temp]$ cat ss.txt… Continue reading Sed – Deleting Multiline Patterns

Nginx – Configuring reverse proxy + caching

Published on Author gryzli

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 gryzli

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

Centos 5 Yum Is Throwing [Errno -3] Error performing checksum

Published on Author gryzli

If you happen to encounter this problem, you could try the following fixes:   1| If you are using “custom” repository If you are using custom repository, which is made by newer version of “createrepo” , there is a big chance that you repodata checksums are generated with sha256. Centos 5’s yum doesn’t support sha256… Continue reading Centos 5 Yum Is Throwing [Errno -3] Error performing checksum

Installing perlbrew on Centos/Rhel/Fedora

Published on Author gryzli

Why you may need perlbrew ? Perlbrew gives you the ability to maintain multiple perl versions, each having different set of install perl modules. The concept is not any new, we have already seen such things in Python (virtualenv) or Ruby (rvm). Basically you get the following benefits (as state in the perlbrew site also):… Continue reading Installing perlbrew on Centos/Rhel/Fedora

Centos/RHEL/Fedora Create Your Own YUM Repository

Published on Author gryzli

If you have learned how to build your own rpm packages (or want to use custom already built ones) , you maybe want to use your own yum repository for installing these packages. In the following how-to I will show you how to easily setup a yum repository. Prerequisites 1| Install createrepo First you need… Continue reading Centos/RHEL/Fedora Create Your Own YUM Repository

Systemd – systemctl list-unit-files timeouts

Published on Author gryzli

The problem Recently I’ve started to occasionally see systemctl to timeout, while executing “list-unit-files”. The problem itself looks very annoying and the first thought I had was: “systemd is bugged out, the server must be restarted” In my current case, the problem is observed on a Centos 7 box. If you “restart” the server you… Continue reading Systemd – systemctl list-unit-files timeouts

Centos 6 – Curl , SSL and Illegal Instruction error

Published on Author gryzli

The “Illeagal Instruction” problem If you recently started to see errors like “illegal instruction” while trying to execute different web accessing scripts/binaries (like curl httpS://example.com), then most probably your Centos 6  NSS package was just updated.   The impact of this bug is enormous, because every single HTTP library which uses nss,openssl for maintaining HTTPS… Continue reading Centos 6 – Curl , SSL and Illegal Instruction error