Sending alerts for PHP fatal errors

If you need to send alerts for PHP errors or some other error messages you can use SEC – simple event correlator. Here’s how you can do that. It’s assumed that you use php-fpm / nginx setup on Centos 6.5, but it should work on Debian/Ubuntu as well. Let’s suppose your PHP log is in…
Read more

Ansible: installing pyenv on Centos

In one of our previous post we covered how to install Python 2.7 on Centos using pyenv which is a Python versions management tool. Today we will show how to use ansible to do that for you.  (If you are on Ubuntu you might want to check ansible-galaxy-pyenv .) Manual installation process is described here. This is how…
Read more

Go: how to install on Centos 6.5

Go is a quite new programming language. It was developed  in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. Although it’s not as mature as C, Python or Java, it has already gained significant popularity in developers community. For instance, Docker is written in Go. It’s also in active use in Dropbox, Canonical and…
Read more

Ansible: how to add swap memory on your Linux box

If you are not familiar with ansible, you might want to take a look at our previous post.  So here’s a problem. If you have, say, Amazon EC2 instance or Rackspace Cloud server, you might want to add swap memory. You can do do it by running the following commands: sudo dd if=/dev/zero of=/mnt/4GB.swap bs=4096…
Read more

Ansible: quick intro

Ansible is a solution for remote server management. It’s pure Python and basically the only thing  it requires is SSH connection. Why you might want to start using it? Well.. For starters, it’s very simple. It’s possible to start using it after 10 minutes introduction. It doesn’t require to know anything special. All configuration is plain…
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