Archive / Linux

RSS feed for this section

Real IP in apache acces logs whm/cpanel

in /usr/local/apache/conf/includes/post_virtualhost_global.conf add LogFormat “%{X-Forwarded-For}i %h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined

Some DOS/DDOS protection

Bellow I describe how to avoid some denial of service attacks TCP syn flood attacks This kind of attack assumes that an attacker is sending syn packets to the server but not any ACK packets, because of this breaking the … Continue reading

centos install memcached and memcache php module

1. yum install memcached 2a. wget http://pecl.php.net/get/memcache-3.0.6.tgz 2b. tar -xvf memcache-3.0.6.tgz here is a little storry, we need to use phpize to prepare the imagick php extension for compiling. On my server I have multiple php installations and if I … Continue reading

Configure: error: Cannot find libmysqlclient under /usr/local

The fix is pretty simple, run the following commands and afterwards reenter your previous ./configure command ln -s /usr/lib64/libmysqlclient.so /usr/lib/libmysqlclient.so ln -s /usr/lib64/libmysqlclient.so /usr/local/libmysqlclient.so

install percona in a whm cpanel environment

1. stop all services /etc/init.d/httpd stop ; /etc/init.d/exim stop ; /etc/init.d/pure-ftpd stop ; /etc/init.d/dovecot stop ; /etc/init.d/cpanel stop ; /etc/init.d/lfd stop ; /etc/init.d/munin-node stop ; /etc/init.d/crond stop ; /etc/init.d/mysql stop ; /etc/init.d/exim stop ; /etc/init.d/portsentry stop 2. uninstall mysql, the … Continue reading

install imagick for php

I’ll describe the installation process for Centos as this is my server’s operating system, the installation is very similar for any linux flavour. In order to have imagick class available inside php firstly we need to install ImageMagick-devel: 1. yum … Continue reading

install apc for php

cd to where you dearchived the sourcecode files for apc export PHP_PREFIX=”/opt/php” #where /opt/php is where you have php installed $PHP_PREFIX/bin/phpize ./configure –with-php-config=$PHP_PREFIX/bin/php-config make make install add in php.ini the reference to the new extension that was copied inside extension … Continue reading

Linux track cpu usage per user

Quick info how to setup everything so you’ll be able to check the cpu user per each user. As a note I have the PHP set up in fcgid mode and also suexec so each php process is running under … Continue reading

Solving: mod_fcgid: read data timeout

This is starting to be a more and more common problem because the hosting companies are using fcgid more often (which is a great thing as fcgid and suexec combination has a lot of advantages). solving the read data timeout … Continue reading