Monthly Archives: April 2019

ispconfig install php 5.6

mkdir -p /opt/php-5.6
mkdir /usr/local/src/php5.6-build
cd /usr/local/src/php5.6-build
wget http://de2.php.net/get/php-5.6.33.tar.bz2/from/this/mirror -O php-5.6.33.tar.bz2
tar jxf php-5.6.33.tar.bz2

./configure --prefix=/opt/php-5.6 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl=/opt/openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

make
make install

cp /usr/local/src/php5.6-build/php-5.6.33/php.ini-production /opt/php-5.6/lib/php.ini
cp /opt/php-5.6/etc/php-fpm.conf.default /opt/php-5.6/etc/php-fpm.conf

ispconfig install 5.4

apt-get update
apt-get install -y libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libxml2-dev zlib1g-dev libcurl4-gnutls-dev libjpeg-turbo8-dev libbz2-dev libjpeg-dev libfreetype6-dev libmcrypt-dev libcurl4-gnutls-dev
ln -s /usr/include/x86_64-linux-gnu/curl curl

cd /usr/local/include
mkdir /opt/php-5.4.45
mkdir /usr/local/src/php5
cd /usr/local/src/php5
wget http://de2.php.net/get/php-5.4.45.tar.gz/from/this/mirror
mv mirror php-5.4.45.tar.gz
tar -xzvf php-5.4.45.tar.gz
cd php-5.4.45
./configure --prefix=/opt/php-5.4.45 --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-mbstring --enable-sockets --enable-exif --enable-bcmath --enable-calendar --enable-zip --enable-ftp --enable-gd-native-ttf --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir --with-zlib --with-zlib-dir --with-bz2 --with-mcrypt --with-mhash --with-pcre-regex --with-libxml-dir=/usr --with-xmlrpc --with-xsl --with-mysql --with-libdir=/lib/x86_64-linux-gnu --with-curl
make
make install

linux high load average no reason

11:38:50 up 62 days, 1:12, 1 user, load average: 638.59, 755.02, 776.17
Cpu(s): 9.5%us, 9.5%sy, 0.0%ni, 76.2%id, 4.8%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32753672k total, 5634300k used, 27119372k free, 617352k buffers

top –

660025 root 20 0 15560 1932 1008 R 100.0 0.0 0:00.21 top
717745 27 20 0 99516 41m 2472 S 70.2 0.1 145:04.24 /usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysql –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –skip-external-locking –socket=/var/lib/mysql/mysql.sock
1 root 20 0 19236 316 88 S 0.0 0.0 0:09.58 /sbin/init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.72 [kthreadd]
3 root RT 0 0 0 0 S 0.0 0.0 0:08.22 [migration/0]
4 root 20 0 0 0 0 S 0.0 0.0 1:11.89 [ksoftirqd/0]
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 [stopper/0]
6 root RT 0 0 0 0 S 0.0 0.0 0:10.47 [watchdog/0]
7 root RT 0 0 0 0 S 0.0 0.0 0:27.77 [migration/1]
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 [stopper/1]
9 root 20 0 0 0 0 S 0.0 0.0 27:23.15 [ksoftirqd/1]
10 root RT 0 0 0 0 S 0.0 0.0 0:03.64 [watchdog/1]
11 root RT 0 0 0 0 S 0.0 0.0 0:12.50 [migration/2]
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 [stopper/2]

Try to find disk load:
ps aux | sort -rk 8 | awk '$8 == "D"' | tail -30
root 1015702 0.0 0.0 100992 104 ? D Apr05 0:00 /bin/df -P
root 1016451 0.0 0.0 100992 100 ? D Apr06 0:00 /bin/df -P
root 1020754 0.0 0.0 100992 100 ? D Apr05 0:00 /bin/df -P
root 1023815 0.0 0.0 100992 8 ? D Apr07 0:00 /bin/df -P
root 1026974 0.0 0.0 100992 100 ? D Apr05 0:00 /bin/df -P
root 1027504 0.0 0.0 100992 104 ? D Apr06 0:00 /bin/df -P
root 1027647 0.0 0.0 100992 104 ? D Apr06 0:00 /bin/df -P
root 1029003 0.0 0.0 100992 100 ? D Apr06 0:00 /bin/df -P
root 1029478 0.0 0.0 100992 12 ? D Apr04 0:00 /bin/df -P
root 1030382 0.0 0.0 100992 104 ? D Apr06 0:00 /bin/df -P
root 1031427 0.0 0.0 100992 100 ? D Apr07 0:00 /bin/df -P
root 1036867 0.0 0.0 100992 8 ? D Apr04 0:00 /bin/df -P
root 1037879 0.0 0.0 100992 104 ? D Apr05 0:00 /bin/df -P
root 1037958 0.0 0.0 100992 100 ? D Apr05 0:00 /bin/df -P
root 1038801 0.0 0.0 100992 100 ? D Apr05 0:00 /bin/df -P
root 1039219 0.0 0.0 100992 100 ? D Apr06 0:00 /bin/df -P

Fast fix:
ps aux | grep -w [d]f | awk '{print $2}' | xargs kill -9

It was caused by virtualizor:
ps aux | grep -w [v]irtualizor | awk '{print $2}' | xargs kill -9

MegaCli back failed disk

If your raid array is degraded, but you think your HDD is good, you can try back it again. You CAN NOT just change status of failed disk to online, because you server data will be almost lost.

/root/bin/MegaCli64 -pdmarkmissing -physdrv[4:0] -aAll
/root/bin/MegaCli64 -pdprprmv -physdrv[4:0] -a0
/root/bin/MegaCli64 -PDMakeGood -PhysDrv[4:0] -a0
/root/bin/MegaCli64 -PDRbld -Start -PhysDrv[4:0] -a0 or /root/bin/MegaCli64 -pdlocate -start -physdrv[4:0] -a0

Sometimes you need fix foreign configuration:
/root/bin/MegaCli64 -CfgForeign -Clear -aALL
/root/bin/MegaCli64 -PDHSP -Set -PhysDrv [4:0] -a0 or /root/bin/MegaCli64 -PDHSP -Rmv -PhysDrv [4:0] -aN

Make sure you have backups of very important data.