Installing Python 2.7 on Centos 6.5

Centos  6.5 is shipped with Python version 2.6. And for some projects and/or applications you may need to use version 2.7. First thing which comes to mind is to compile it from sources. But obviously it’s not the best way. It would create more problem in future, besides it’s quite easy to get the whole system…
Read more

AWK: how to get text which is between two strings

If you need to get some text which is in file between two lines you could use awk for this. You may need it while analyzing access logs to fix some issue, for instance. Here’s how you could do it: awk ‘/2012:00:20:49/, /2012:00:35/’ access_log > output It’s a simple and convenient way.

Apache: getting remote IP when working behind nginx

Sometimes you may want to use Apache behind nginx. In this case nginx works as reverse proxy and handles user connections and static files. And Apache generates dynamic content (for instance, with use of PHP). In this case remote IP in your scripts would be 127.0.0.1 since Apache gets requests from the same server. It…
Read more

LEMP: disabling PHP functions

Let’s consider typical LEMP stack: Linux nginx php-fpm MySQL server For security reasons you might want to disable some dangerous functions like exec or system.  As you may know, you can do this by adding list of function to disable_functions parameter in your php.ini. At the same time php-fpm allows to limit PHP parameters per pool….
Read more