Tag Archives: CentOS

yum disableexcludes

yum –disableexcludes=all update
yum –disableexcludes=main install php
yum –disableexcludes=repoid install php httpd

all : Disable all excludes
main : Disable excludes defined in [main] in yum.conf
repoid : Disable excludes defined for given repo id
yum –exclude Command Line Option

ZPanel on CentOS 64

wget -O installer-10-1-0-centos-64.sh.x https://github.com/bobsta63/zpanelx/releases/download/10.1.0/installer-10-1-0-centos-64.sh.x

or 32bit: wget -O installer-10-1-0-centos-32.sh.x https://github.com/bobsta63/zpanelx/releases/download/10.1.0/installer-10-1-0-centos-32.sh.x

chmod +x installer-10-1-0-centos-64.sh.x
yum install ld-linux.so.2 curl
./installer-10-1-0-centos-64.sh.x

memcache on CentOS

yum install memcached php-pecl-memcache
pecl install memcache

if pecl fail you can install from source:
wget http://pecl.php.net/get/memcache
tar xvfz memcache-*
cd memcache*
phpize
./configure
make && make install
echo extension=memcache.so >> /etc/php.ini

service httpd restart
service memcached start
or maybe run manually:
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody

mod_fastcgi with PHP-FPM on Centos

yum install php-fpm
chkconfig –levels 235 php-fpm on
vi /etc/php-fpm.d/www.conf
;listen = 127.0.0.1:9000
listen = /tmp/php5-fpm.sock
pm.status_path = /status
ping.path = /ping

service php-fpm start

yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum install mod_fastcgi # Get mod_fastcgi from rpmforge or compile yourself

yum install libtool httpd-devel apr-devel apr
wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
tar -zxvf mod_fastcgi-current.tar.gz
cd mod_fastcgi*
make top_dir=/usr/lib64/httpd
make install top_dir=/usr/lib64/httpd

mv /etc/httpd/conf.d/{php.conf,php.conf.disable}
mkdir /usr/lib/cgi-bin/
vi /etc/httpd/conf.d/mod_fastcgi.conf
LoadModule fastcgi_module modules/mod_fastcgi.so


DirectoryIndex index.php index.html index.shtml index.cgi
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /tmp/php5-fpm.sock -pass-header Authorization

# For monitoring status with e.g. Munin

SetHandler php5-fcgi-virt
Action php5-fcgi-virt /php5-fcgi virtual

service httpd restart

check rpm content

rpm -qlp mod_fastcgi-2.4.6-2.el6.rf.x86_64.rpm

/etc/httpd/conf.d/fastcgi.conf
/usr/lib64/httpd/modules/mod_fastcgi.so
/usr/share/doc/mod_fastcgi-2.4.6
/usr/share/doc/mod_fastcgi-2.4.6/CHANGES
/usr/share/doc/mod_fastcgi-2.4.6/INSTALL
/usr/share/doc/mod_fastcgi-2.4.6/INSTALL.AP2
/usr/share/doc/mod_fastcgi-2.4.6/README
/usr/share/doc/mod_fastcgi-2.4.6/docs
/usr/share/doc/mod_fastcgi-2.4.6/docs/LICENSE.TERMS
/usr/share/doc/mod_fastcgi-2.4.6/docs/mod_fastcgi.html
/usr/share/doc/mod_fastcgi-2.4.6/php-wrapper
/usr/share/selinux/targeted/mod_fastcgi.pp
/var/run/mod_fastcgi

Use repoquery if you don’t have local rpm file.
repoquery –list mod_fastcgi

My favorite way:
yumdownloader mod_fastcgi
rpm2cpio mod_fastcgi-2.4.6-2.el6.rf.x86_64.rpm | cpio -t

centos – reload new kernel without reboot

uname -r
2.6.32-71.29.1.el6.i686

yum update kernel*

then:
yum install kexec-tools

Now we get last installed kernel version release and put it on a var:

# latestkernel=`ls -t /boot/vmlinuz-* | sed “s/\/boot\/vmlinuz-//g” | head -n1`

# echo $latestkernel
2.6.32-220.4.1.el6.i686

Now we need to load the new kernel version in memory:

kexec -l /boot/vmlinuz-${latestkernel} –initrd=/boot/initramfs-${latestkernel}.img –append=”`cat /proc/cmdline`”

realod new kernel:
kexec -e

The system will “restart without restarting”..something like a fast reboot, without performing BIOS checks

name -r
2.6.32-220.4.1.el6.i686

apache mpm-itk

mpm-itk is a fork of mpm-prefork, which allows you to configure individual Apache vhosts to run as specified users and groups. This makes it extremely secure if used in a shared hosting environment.

yum install –enablerepo=webtatic httpd-itk

vi /etc/sysconfig/httpd
HTTPD=/usr/sbin/httpd.itk

VirtualHost *:80 :
ServerName linux4you.tk
DocumentRoot /var/www/htm/linux4you.tk
AssignUserId vuser vgroup

service httpd start

OSSEC

OSSEC is an open source centralized log monitoring and notification system. OSSEC is often used to meet PCI Compliance central logging and intrusion monitoring requirements with a free and self-managed solution. OSSEC monitors all types of logs such as syslog, apache, maillogs, mysql logs, ftp logs, cisco IOS logs, and more. I’ll show you how to install OSSEC on the latest Red Hat Linux or CentOS 6!