Blog

elasticsearch: installation and configuration on Centos 6.2

On 03.04.2012, in supportex.net-blog, by Oleksii Tykhonov
0

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 [...]

Read more

vBulletin: attachments downloads optimization using vb-accelerator

On 21.03.2012, in supportex.net-blog, by Oleksii Tykhonov
0

By default vBulletin uses PHP to deal with attachment downloads. It means that to provide a file from forum attachments to a user PHP process reads it and then starts to output it. This would work OK if you don’t have too much users. But if you do, attachments downloads from PHP could become one of [...]

Read more

AWK: how to get text which is between two strings

On 17.03.2012, in supportex.net-blog, by Oleksii Tykhonov
0

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.

Read more

Apache: getting remote IP when working behind nginx

On 06.03.2012, in supportex.net-blog, by Oleksii Tykhonov
0

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

On 26.02.2012, in php, by Oleksii Tykhonov
0

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

MySQL: how to fix ‘ERROR 2006 (HY000) at line ##: MySQL server has gone away’

On 24.02.2012, in mysql, by Oleksii Tykhonov
0

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.

Read more

MySQL: ERROR 1005 (HY000) at line 14: Can’t create table ‘example.tbl’ (errno: 150)

On 10.02.2012, in mysql, by Oleksii Tykhonov
0

If you get an error ERROR 1005 (HY000) at line 14: Can’t create table example.tbl (errno: 150) it could be for at least two reasons. MySQL doesn’t allow to create foreign keys for  a set of tables one of which doesn’t exist. To solve this restriction you can set SET foreign_key_checks to 0: mysql> SET [...]

Read more

RPM: how to get changelog from package

On 31.01.2012, in supportex.net-blog, by Oleksii Tykhonov
0

Often there’s a need to get changelog of RPM package. Here is a way to do that: [root@playground ~]# rpm -qp –changelog kernel-2.6.41.9-1.fc15.x86_64.rpm | head * Fri Jan 13 2012 Josh Boyer <jwboyer@redhat.com> 2.6.41.9-1 – Linux 3.1.9 – CVE-2012-0045 kvm: syscall instruction induced guest panic (rhbz 773392) * Wed Jan 11 2012 Josh Boyer <jwboyer@redhat.com> [...]

Read more

phpMyAdmin: how to use it with several MySQL servers

On 31.01.2012, in supportex.net-blog, by Oleksii Tykhonov
0

If you have several MySQL servers it makes sense to use one phpMyAmin to manage them.  To do it just add as many server as you need to config.inc.php. In Fedora and Centos it is located in /etc/phpMyAdmin/. Here’s an example: <?php /* Servers configuration */ $i = 0; /* Server: localhost [1] */ $i++; [...]

Read more

nginx: Using fcgiwrap for CGI applications deployment

On 19.01.2012, in supportex.net-blog, by Oleksii Tykhonov
0

From the box nginx doesn’t support CGI applications deployment since CGI is very old and poor performance way to run them. But some applications still should be deployed with use of CGI (earlier, we covered setup of Nagios and OTRS with nginx). Here is another way to do that. In this case we will use [...]

Read more