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…
All posts tagged linux
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…
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…
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…
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…
Headless Selenium testing environment on Centos 6.5
Selenium is a set of tools which allows to test web applications automatically. Here’s a way to get it working on Centos 6. At the end we should be able to run headless Selenium tests with Firefox. Please note that as X11 disaplay server we will use Xvfb. At first let’s install required packages and…
elasticsearch: installation and configuration on Centos 6.2
The installation of elasticsearch (which is distributed RESTful, search engine built on top of Apache Lucene) on Centos, will be easier if it is in repositories. But it isn’t. And since the best way to install application on Centos is to use rpm packages we will need to build it. At the very beginning you…
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…
MySQL: how to fix ‘ERROR 2006 (HY000) at line ##: MySQL server has gone away’
If you get mentioned error while restoring big database, make sure you have enough size of max_allowed_packet. [mysqld] max_allowed_packet=64M After adding it to your /etc/my.cnf restart MySQL server to apply changes.