<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vi command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="http://lifelinux.com/tag/vi-command/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Wed, 09 Oct 2013 07:56:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.18</generator>
	<item>
		<title>How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6</title>
		<link>http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/</link>
					<comments>http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Mon, 02 Apr 2012 12:37:28 +0000</pubDate>
				<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[caching software]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[lighttpd init-d startup script]]></category>
		<category><![CDATA[php fastcgi configuration]]></category>
		<category><![CDATA[php-cgi]]></category>
		<category><![CDATA[red hat enterprise]]></category>
		<category><![CDATA[redhat linux]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[vi command]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1358</guid>

					<description><![CDATA[<p>lighttpd is an open-source web server more optimized for speed-critical environments than common products while remaining standards-compliant, secure and flexible. This tutorial shows how you can install Lighttpd on a CentOS 6 server with PHP (PHP-FPM). First, update CentOS to latest version, login root and type the following command # yum update -y Install some [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/">How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p style="text-align: justify;"><strong>lighttpd</strong> is an open-source web server more optimized for speed-critical environments than common products while remaining standards-compliant, secure and flexible. This tutorial shows how you can install Lighttpd on a CentOS 6 server with PHP (PHP-FPM).<br />
<span id="more-1358"></span><br />
First, update CentOS to latest version, login root and type the following command</p>
<pre># yum update -y</pre>
<p>Install some packages need for the following steps</p>
<pre># yum install wget make cpp gcc gcc-c++ -y</pre>
<p>Make a folder where you will store lighttpd and php sources</p>
<pre># mkdir -p /opt/source</pre>
<h2>Installing Lighttpd</h2>
<p>You need to download the latest lighttpd source from <a href="http://www.lighttpd.net/download">http://www.lighttpd.net/download</a> into the /opt/source. Type the following command</p>
<pre># cd /opt/source
# wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.30.tar.gz</pre>
<p>Extract lighttpd-1.4.30.tar.gz package</p>
<pre># tar zxvf lighttpd-1.4.30.tar.gz
# cd lighttpd-1.4.30</pre>
<p>To build lighttpd, type the following command</p>
<pre># ./configure --prefix=/webserver/lighttpd --disable-ipv6
# make
# make install</pre>
<p>During ./configure, you might get some errors like the following</p>
<pre>...
configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre
...</pre>
<p>To solve the problem, type the following command</p>
<pre># yum install pcre pcre-devel</pre>
<pre>...
configure: error: zlib-headers and/or libs where not found, install them or build with --without-zlib
...</pre>
<p>To solve the problem, type the following command</p>
<pre># yum install zlib zlib-devel</pre>
<pre>...
configure: error: bzip2-headers and/or libs where not found, install them or build with --without-bzip2
...</pre>
<p>To solve the problem, type the following command</p>
<pre># yum install bzip2 bzip2-devel</pre>
<h2>Configuring Lighttpd</h2>
<p>Access to folder of lighttpd, where lighttpd installed [/webserver/lighttpd] and make dirs</p>
<pre># cd /webserver/lighttpd
# mkdir -p etc/init.d
# mkdir -p etc/sysconfig
# mkdir -p www/htdocs
# mkdir -p var/run
# mkdir -p var/log
# mkdir -p var/lock/subsys
# mkdir -p var/cache</pre>
<p>Add a user called &#8220;lighttpd&#8221; and chown all dir made for lighttpd user</p>
<pre># useradd -s /sbin/nologin -d /webserver/lighttpd/www/ lighttpd
# chown lighttpd -R etc
# chown lighttpd -R var
# chown lighttpd -R www</pre>
<p>Return back forder /opt/source/lighttpd-1.4.30 to copy configuration files</p>
<pre># cd /opt/source/lighttpd-1.4.30
# cp doc/config/modules.conf /webserver/lighttpd/etc/
# cp -r doc/config/conf.d /webserver/lighttpd/etc/
# cp -r doc/config/vhosts.d/ /webserver/lighttpd/etc/</pre>
<p>Create default lighttpd configuration file: /webserver/lighttpd/etc/lighttpd.conf (download sample <a href="http://www.lifelinux.com/wp-content/uploads/2012/04/lighttpd.conf_.txt">lighttpd.conf</a> file). Type the following command</p>
<pre># wget http://www.lifelinux.com/wp-content/uploads/2012/04/lighttpd.conf_.txt -O /webserver/lighttpd/etc/lighttpd.conf</pre>
<p>If you want to run lighttpd by default when the system boots, create file called lighttpd in /webserver/lighttpd/etc/init.d/</p>
<pre># vi /webserver/lighttpd/etc/init.d/lighttpd</pre>
<p>Append following line</p>
<pre>#!/bin/sh
#
# lighttpd     Startup script for the lighttpd server
#
# chkconfig: - 85 15
# description: Lightning fast webserver with light system requirements
#
# processname: lighttpd
# config: /webserver/lighttpd/etc/lighttpd.conf
# config: /webserver/lighttpd/etc/sysconfig/lighttpd
# pidfile: /webserver/lighttpd/var/run/lighttpd.pid
#
# Note: pidfile is assumed to be created
# by lighttpd (config: server.pid-file).
# If not, uncomment 'pidof' line.

# Source function library
. /etc/rc.d/init.d/functions

if [ -f /webserver/lighttpd/etc/sysconfig/lighttpd ]; then
	. /webserver/lighttpd/etc/sysconfig/lighttpd
fi

if [ -z "$LIGHTTPD_CONF_PATH" ]; then
	LIGHTTPD_CONF_PATH="/webserver/lighttpd/etc/lighttpd.conf"
fi

prog="lighttpd"
lighttpd="/webserver/lighttpd/sbin/lighttpd"
RETVAL=0

start() {
	echo -n $"Starting $prog: "
	daemon $lighttpd -f $LIGHTTPD_CONF_PATH
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] &amp;&amp; touch /webserver/lighttpd/var/lock/subsys/$prog
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc $lighttpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] &amp;&amp; rm -f /webserver/lighttpd/var/lock/subsys/$prog
	return $RETVAL
}

reload() {
	echo -n $"Reloading $prog: "
	killproc $lighttpd -HUP
	RETVAL=$?
	echo
	return $RETVAL
}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		stop
		start
		;;
	condrestart)
		if [ -f /webserver/lighttpd/var/lock/subsys/$prog ]; then
			stop
			start
		fi
		;;
	reload)
		reload
		;;
	status)
		status $lighttpd
		RETVAL=$?
		;;
	*)
		echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
		RETVAL=1
esac

exit $RETVAL</pre>
<p>Chmod lighttpd with executed permission and create symbolic link in &#8220;/etc/init.d&#8221;. Type the following command</p>
<pre># chmod +x /webserver/lighttpd/etc/init.d/lighttpd
# ln -s /webserver/lighttpd/etc/init.d/lighttpd /etc/init.d/lighttpd</pre>
<p>Create file called &#8220;lighttpd&#8221; in /webserver/lighttpd/etc/sysconfig</p>
<pre># vi /webserver/lighttpd/etc/sysconfig/lighttpd</pre>
<p>Append following line</p>
<pre>LIGHTTPD_CONF_PATH=/webserver/lighttpd/etc/lighttpd.conf</pre>
<p>To start lighttpd for the first time, type the following command</p>
<pre># /etc/init.d/lighttpd start</pre>
<h2>Install PHP (PHP-FPM)</h2>
<p>Download latest version of PHP at http://download.php.net</p>
<pre># cd /opt/source
# wget http://www.php.net/get/php-5.3.10.tar.gz/from/ca.php.net/mirror</pre>
<p>To Extract its, enter</p>
<pre># tar zxvf php-5.3.10.tar.gz
# cd php-5.3.10</pre>
<p>To build PHP, I&#8217;ll create bash file called build.sh</p>
<pre># vi build.sh</pre>
<p>Append following line</p>
<pre>#!/bin/sh
"./configure" \
"--prefix=/webserver/php" \
"--enable-fpm" \
"--with-libdir=lib64" \
"--with-bz2" \
"--with-config-file-path=/webserver/php/etc" \
"--with-config-file-scan-dir=/webserver/php/etc/php.d" \
"--with-curl=/usr/local/lib" \
"--with-gd" \
"--with-gettext" \
"--with-jpeg-dir=/usr/local/lib" \
"--with-freetype-dir=/usr/local/lib" \
"--with-kerberos" \
"--with-mcrypt" \
"--with-mhash" \
"--with-mysql" \
"--with-mysqli" \
"--with-pcre-regex=/usr" \
"--with-pdo-mysql=shared" \
"--with-pdo-sqlite=shared" \
"--with-pear=/usr/local/lib/php" \
"--with-png-dir=/usr/local/lib" \
"--with-pspell" \
"--with-sqlite=shared" \
"--with-tidy" \
"--with-xmlrpc" \
"--with-xsl" \
"--with-zlib" \
"--with-zlib-dir=/usr/local/lib" \
"--with-openssl" \
"--with-iconv" \
"--enable-bcmath" \
"--enable-calendar" \
"--enable-exif" \
"--enable-ftp" \
"--enable-gd-native-ttf" \
"--enable-libxml" \
"--enable-magic-quotes" \
"--enable-soap" \
"--enable-sockets" \
"--enable-mbstring" \
"--enable-zip" \
"--enable-wddx"</pre>
<p>Type the following command to install PHP</p>
<pre># sh build.sh
# make
# make install</pre>
<p>If you have problems building PHP then read the <a href="http://www.lifelinux.com/error-compiling-php-on-centos-x64/">article</a>. Next step, copy php.ini to /webserver/php/etc/, enter</p>
<pre># cp php.ini-production /webserver/php/etc/php.ini</pre>
<p>Rename php-fpm.conf, enter</p>
<pre># cd /webserver/php/etc
# cp php-fpm.conf.default php-fpm.conf</pre>
<p>Open php-fpm.conf, type</p>
<pre># vi php-fpm.conf</pre>
<p>Append following line</p>
<pre>[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
user = nobody
group = nobody
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500</pre>
<p>If you want to run PHP-FPM by default when the system boots, create file called php-fpm in /etc/init.d/</p>
<pre># vi /etc/init.d/php-fpm</pre>
<p>Append following line</p>
<pre>#! /bin/sh

### BEGIN INIT INFO
# Provides:          php-fpm
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts php-fpm
# Description:       starts the PHP FastCGI Process Manager daemon
### END INIT INFO

php_fpm_BIN=/webserver/php/sbin/php-fpm
php_fpm_CONF=/webserver/php/etc/php-fpm.conf
php_fpm_PID=/webserver/php/var/run/php-fpm.pid

php_opts="--fpm-config $php_fpm_CONF"

wait_for_pid () {
	try=0

	while test $try -lt 35 ; do

		case "$1" in
			'created')
			if [ -f "$2" ] ; then
				try=''
				break
			fi
			;;

			'removed')
			if [ ! -f "$2" ] ; then
				try=''
				break
			fi
			;;
		esac

		echo -n .
		try=`expr $try + 1`
		sleep 1

	done

}

case "$1" in
	start)
		echo -n "Starting php-fpm "

		$php_fpm_BIN $php_opts

		if [ "$?" != 0 ] ; then
			echo " failed"
			exit 1
		fi

		wait_for_pid created $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed"
			exit 1
		else
			echo " done"
		fi
	;;

	stop)
		echo -n "Gracefully shutting down php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -QUIT `cat $php_fpm_PID`

		wait_for_pid removed $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed. Use force-exit"
			exit 1
		else
			echo " done"
		fi
	;;

	force-quit)
		echo -n "Terminating php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -TERM `cat $php_fpm_PID`

		wait_for_pid removed $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed"
			exit 1
		else
			echo " done"
		fi
	;;

	restart)
		$0 stop
		$0 start
	;;

	reload)

		echo -n "Reload service php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -USR2 `cat $php_fpm_PID`

		echo " done"
	;;

	*)
		echo "Usage: $0 {start|stop|force-quit|restart|reload}"
		exit 1
	;;

esac</pre>
<p>Chmod php-fpm with executed permission, enter</p>
<pre># chmod +x /etc/init.d/php-fpm</pre>
<p>To start PHP-FPM for the first time, type the following command</p>
<pre># /etc/init.d/php-fpm start</pre>
<h2>Configure PHP-FPM and Lighttpd working together</h2>
<p>Uncomment the following line in /webserver/lighttpd/etc/modules.conf</p>
<pre>##
## FastCGI (mod_fastcgi)
##
include "conf.d/fastcgi.conf"</pre>
<p>Open /webserver/lighttpd/etc/conf.d/fastcgi.conf, and append following line</p>
<pre>server.modules += ( "mod_fastcgi" )
fastcgi.server = ( ".php" =&gt;
  ( "php-tcp" =&gt;
    (
      "host" =&gt; "127.0.0.1",
      "port" =&gt; "9000"
    )
  )
)</pre>
<p>Save and close the file. Type the following command to restart Lighttpd</p>
<pre># /etc/init.d/lighttpd restart</pre>
<p>This completes the installation steps. To test php you can create a info.php file in the document root folder</p>
<pre># vi /webserver/lighttpd/www/htdocs/info.php</pre>
<p>Append following line</p>
<pre>&lt;?php
phpinfo();
?&gt;</pre>
<p><a href="http://www.lifelinux.com/wp-content/uploads/2012/04/php-info.jpg"><img loading="lazy" src="http://www.lifelinux.com/wp-content/uploads/2012/04/php-info-300x275.jpg" alt="" title="php-info" width="300" height="275" class="aligncenter size-medium wp-image-1378" srcset="http://lifelinux.com/wp-content/uploads/2012/04/php-info-300x275.jpg 300w, http://lifelinux.com/wp-content/uploads/2012/04/php-info.jpg 627w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
If you see the above, you have completed a successful installation of lighttpd and php.</p>
<g:plusone href="http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/">How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Nginx And PHP-FPM On CentOS 6 Via Yum</title>
		<link>http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/</link>
					<comments>http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 16 Feb 2012 16:17:40 +0000</pubDate>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[chow command]]></category>
		<category><![CDATA[compile nginx and php]]></category>
		<category><![CDATA[freebsd nginx]]></category>
		<category><![CDATA[host names]]></category>
		<category><![CDATA[install nginx]]></category>
		<category><![CDATA[install nginx and php on linux]]></category>
		<category><![CDATA[install nginx and php-fpm]]></category>
		<category><![CDATA[install nginx on centos]]></category>
		<category><![CDATA[install nginx via yum]]></category>
		<category><![CDATA[install php-fpm]]></category>
		<category><![CDATA[install php-fpm via yum]]></category>
		<category><![CDATA[installing nginx]]></category>
		<category><![CDATA[installing nginx and php-fpm]]></category>
		<category><![CDATA[installing php-fpm]]></category>
		<category><![CDATA[mime types]]></category>
		<category><![CDATA[mkdir command]]></category>
		<category><![CDATA[necessary directories]]></category>
		<category><![CDATA[nginx and php-fpm]]></category>
		<category><![CDATA[nginx configuration file]]></category>
		<category><![CDATA[nginx named based virtual hosting]]></category>
		<category><![CDATA[nginx php-fpm]]></category>
		<category><![CDATA[nginx virtual hosting]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[server error log]]></category>
		<category><![CDATA[vi command]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[worker processes]]></category>
		<category><![CDATA[www user]]></category>
		<category><![CDATA[yum install nginx]]></category>
		<category><![CDATA[yum install php-fpm]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1339</guid>

					<description><![CDATA[<p>In the last article, I showed you how to install Nginx and PHP (PHP-FPM) on CentOS 6 from source. Today, I&#8217;m going to show you how to install Nginx with PHP-FPM via yum. Before starting to install Nginx and PHP-FPM, you must uninstall all previous Apache and PHP related RPMs installed on your system. Login [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/">How To Install Nginx And PHP-FPM On CentOS 6 Via Yum</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>In the <a href="http://www.lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/">last article</a>, I showed you how to install Nginx and PHP (PHP-FPM) on CentOS 6 from source. Today, I&#8217;m going to show you how to install Nginx with PHP-FPM via yum.<br />
<span id="more-1339"></span><br />
Before starting to install Nginx and PHP-FPM, you must uninstall all previous Apache and PHP related RPMs installed on your system. Login as root and type the following command</p>
<pre># yum remove httpd* php*</pre>
<h2>Enabling Additional Repositories</h2>
<p>By default, php-fpm is not available from the official CentOS repositories, but from the Remi RPM repository which itself depends on the EPEL repository; we can enable both repositories as follows:</p>
<pre># yum install yum-priorities -y
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm</pre>
<p>Sample outputs</p>
<pre>Retrieving http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
warning: /var/tmp/rpm-tmp.00kiDx: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]</pre>
<h2>Installing Nginx</h2>
<p>Type the following command</p>
<pre># yum install nginx</pre>
<p>Sample outputs</p>
<pre>Dependencies Resolved

================================================================================
 Package                  Arch      Version                    Repository  Size
================================================================================
Installing:
 nginx                    x86_64    0.8.54-1.el6               epel       358 k
Installing for dependencies:
 GeoIP                    x86_64    1.4.8-1.el6                epel       620 k
 fontconfig               x86_64    2.8.0-3.el6                base       186 k
 freetype                 x86_64    2.3.11-6.el6_1.8           updates    358 k
 gd                       x86_64    2.0.35-10.el6              base       142 k
 libX11                   x86_64    1.3-2.el6                  base       582 k
 libX11-common            noarch    1.3-2.el6                  base       188 k
 libXau                   x86_64    1.0.5-1.el6                base        22 k
 libXpm                   x86_64    3.5.8-2.el6                base        59 k
 libjpeg                  x86_64    6b-46.el6                  base       134 k
 libpng                   x86_64    2:1.2.46-1.el6_1           base       180 k
 libxcb                   x86_64    1.5-1.el6                  base       100 k
 libxslt                  x86_64    1.1.26-2.el6               base       450 k
 perl                     x86_64    4:5.10.1-119.el6_1.1       base        10 M
 perl-Module-Pluggable    x86_64    1:3.90-119.el6_1.1         base        37 k
 perl-Pod-Escapes         x86_64    1:1.04-119.el6_1.1         base        30 k
 perl-Pod-Simple          x86_64    1:3.13-119.el6_1.1         base       209 k
 perl-libs                x86_64    4:5.10.1-119.el6_1.1       base       575 k
 perl-version             x86_64    3:0.77-119.el6_1.1         base        49 k

Transaction Summary
================================================================================
Install      19 Package(s)
Upgrade       0 Package(s)

Total download size: 14 M
Installed size: 47 M
Is this ok [y/N]: y</pre>
<p>If you want to run nginx by default when the system boots, type the following command</p>
<pre># chkconfig --level 345 nginx on</pre>
<p>To start Nginx for the first time, type the following command</p>
<pre># /etc/init.d/nginx start</pre>
<p>Sample output</p>
<pre>Starting nginx:                                            [  OK  ]</pre>
<h2>Installing PHP-FPM</h2>
<p>Type the following command</p>
<pre># yum --enablerepo=remi install php php-fpm</pre>
<p>Sample outputs</p>
<pre>Dependencies Resolved

====================================================================================
 Package            Arch        Version                          Repository    Size
====================================================================================
Installing:
 php                x86_64      5.3.10-2.el6.remi                remi         2.3 M
 php-fpm            x86_64      5.3.10-2.el6.remi                remi         1.1 M
Installing for dependencies:
 apr                x86_64      1.3.9-3.el6_1.2                  base         123 k
 apr-util           x86_64      1.3.9-3.el6_0.1                  base          87 k
 apr-util-ldap      x86_64      1.3.9-3.el6_0.1                  base          15 k
 httpd              x86_64      2.2.15-15.el6.centos.1           updates      813 k
 httpd-tools        x86_64      2.2.15-15.el6.centos.1           updates       70 k
 libedit            x86_64      2.11-4.20080712cvs.1.el6         base          74 k
 mailcap            noarch      2.1.31-2.el6                     base          27 k
 php-cli            x86_64      5.3.10-2.el6.remi                remi         2.2 M

Transaction Summary
====================================================================================
Install      10 Package(s)
Upgrade       0 Package(s)

Total download size: 6.8 M
Installed size: 21 M
Is this ok [y/N]: y</pre>
<p>If you want to run php-fpm by default when the system boots, type the following command</p>
<pre># chkconfig --level 345 php-fpm on</pre>
<p>PHP was installed with only core modules. It&#8217;s very likely that additional modules will be desired, such as MySQL, XML, GD, etc. Type the following command</p>
<pre># yum --enablerepo=remi install php-gd php-mysql php-mbstring php-xml php-mcrypt</pre>
<p>To start PHP-FPM for the first time, type the following command</p>
<pre># /etc/init.d/php-fpm restart</pre>
<p>Sample output</p>
<pre>Starting php-fpm:                                          <span style="color: #339966;">[ OK ]</span></pre>
<h2>Configure PHP-FPM and Nginx working together</h2>
<p>The configuration file for Nginx is located at /etc/nginx/nginx.conf. To edit nginx.conf type the following command</p>
<pre># vi /etc/nginx/nginx.conf</pre>
<p>Uncomment and edit as follows</p>
<pre>        ...
	location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm index.php;
        }
        ...
	location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
        ...</pre>
<p>Restart Nginx to reload new configuration, enter</p>
<pre># /etc/init.d/nginx reload</pre>
<p>Now create the following PHP file in the document root</p>
<pre># vi /usr/share/nginx/html/info.php</pre>
<p>Append content as follows:</p>
<pre>&lt;?php
phpinfo();
?&gt;</pre>
<p>Access it http://YOUR-SERVER-IP</p>
<p><a href="http://www.lifelinux.com/wp-content/uploads/2012/02/php-fpm.jpg"><img loading="lazy" class="aligncenter size-medium wp-image-1348" title="php-fpm" alt="" src="http://www.lifelinux.com/wp-content/uploads/2012/02/php-fpm-300x220.jpg" width="300" height="220" srcset="http://lifelinux.com/wp-content/uploads/2012/02/php-fpm-300x220.jpg 300w, http://lifelinux.com/wp-content/uploads/2012/02/php-fpm.jpg 611w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<h2>Nginx Virtual Hosting Configuration</h2>
<p><strong>Your sample setup</strong><br />
IP: 192.168.1.113<br />
Domain: domain.local<br />
Hosted at: /home/www/domain.local</p>
<p>Type the following command to create user called www</p>
<pre># useradd www</pre>
<p>Create necessary directories</p>
<pre># mkdir -p /home/www/domain.local/public_html
# mkdir -p /home/www/domain.local/log
# chown -R www.www /home/www/
# chmod 755 /home/www/</pre>
<p>Creating virtual host config file</p>
<pre># cd /etc/nginx/conf.d/
# cp virtual.conf www.conf</pre>
<p>Open www.conf, enter</p>
<pre># vi /etc/nginx/conf.d/www.conf</pre>
<p>Append configuration as follows:</p>
<pre>server {
        server_name  domain.local;
        root /home/www/domain.local/public_html;
        access_log /home/www/domain.local/log/domain.local-access.log;
        error_log /home/www/domain.local/log/domain.local-error.log;

        location / {
                index  index.html index.htm index.php;
        }
        location ~ \.php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
}</pre>
<p>You can also check the current status as well as the configuration syntax:</p>
<pre># /etc/init.d/nginx configtest</pre>
<p>Sample outputs</p>
<pre>the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful</pre>
<p>Now edit /etc/php-fpm.d/www.conf to change the users who own the php-fpm processes to www, enter</p>
<pre># vi /etc/php-fpm.d/www.conf</pre>
<p>Find &#8220;group of processes&#8221; and edit as follows:</p>
<pre>; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = <span style="color: #008000;">www</span>
; RPM: Keep a group allowed to write in log dir.
group = <span style="color: #008000;">www</span></pre>
<p>Finally restart nginx</p>
<pre># /etc/init.d/nginx restart
# /etc/init.d/php-fpm restart</pre>
<g:plusone href="http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/">How To Install Nginx And PHP-FPM On CentOS 6 Via Yum</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Nginx And PHP (PHP-FPM) On CentOS 6</title>
		<link>http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/</link>
					<comments>http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 15 Sep 2011 14:16:45 +0000</pubDate>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[compile nginx and php]]></category>
		<category><![CDATA[install nginx]]></category>
		<category><![CDATA[install nginx and php on linux]]></category>
		<category><![CDATA[install nginx on centos]]></category>
		<category><![CDATA[install php-fpm]]></category>
		<category><![CDATA[installing nginx]]></category>
		<category><![CDATA[installing nginx and php-fpm]]></category>
		<category><![CDATA[installing php-fpm]]></category>
		<category><![CDATA[nginx and php-fpm]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1203</guid>

					<description><![CDATA[<p>In this article, I&#8217;ll go over the steps of how to install Nginx and PHP (PHP-FPM) working together on CentOS 6. To start I used clean version of CentOS 6. The first step is update CentOS to latest version, type the following command # yum update -y Install some packages need for the following steps [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/">How To Install Nginx And PHP (PHP-FPM) On CentOS 6</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>In this article, I&#8217;ll go over the steps of how to install Nginx and PHP (PHP-FPM) working together on CentOS 6. To start I used clean version of CentOS 6.<br />
<span id="more-1203"></span><br />
The first step is update CentOS to latest version, type the following command</p>
<pre># yum update -y</pre>
<p>Install some packages need for the following steps</p>
<pre># yum install gcc.x86_64 gcc-c++.x86_64 make.x86_64 wget.x86_64</pre>
<h2>Install Nginx</h2>
<p>Download latest version of Nginx at http://nginx.org/</p>
<pre># wget http://nginx.org/download/nginx-1.0.5.tar.gz</pre>
<p>Extract nginx-1.0.5.tar.gz package</p>
<pre># tar zxvf nginx-1.0.5.tar.gz
# cd nginx-1.0.5</pre>
<p>To build nginx, type the following command</p>
<pre># ./configure --prefix=/webserver/nginx --without-mail_pop3_module --without-mail_imap_module  --without-mail_smtp_module --with-http_ssl_module  --with-http_stub_status_module  --with-http_gzip_static_module
# make
# make install</pre>
<p>You may get some errors like the following</p>
<pre>./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre= option.</pre>
<p>To fix it, enter</p>
<pre># yum install pcre-devel.x86_64</pre>
<pre>/configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl= option.</pre>
<p>To fix it, enter</p>
<pre># yum install openssl.x86_64 openssl-devel.x86_64</pre>
<p>When build process completed successfully, it&#8217;ll display as follows</p>
<pre>  Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/webserver/nginx"
  nginx binary file: "/webserver/nginx/sbin/nginx"
  nginx configuration prefix: "/webserver/nginx/conf"
  nginx configuration file: "/webserver/nginx/conf/nginx.conf"
  nginx pid file: "/webserver/nginx/logs/nginx.pid"
  nginx error log file: "/webserver/nginx/logs/error.log"
  nginx http access log file: "/webserver/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"</pre>
<p>If you want to run Nginx by default when the system boots, create file called nginx in /etc/init.d/ with following content</p>
<pre>#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] &amp;&amp; exit 0

nginx="/webserver/nginx/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/webserver/nginx/conf/nginx.conf"

lockfile=/var/lock/subsys/nginx

start() {
	[ -x $nginx ] || exit 5
	[ -f $NGINX_CONF_FILE ] || exit 6
	echo -n $"Starting $prog: "
	daemon $nginx -c $NGINX_CONF_FILE
	retval=$?
	echo
	[ $retval -eq 0 ] &amp;&amp; touch $lockfile
	return $retval
}

stop() {
	echo -n $"Stopping $prog: "
	killproc $prog -QUIT
	retval=$?
	echo
	[ $retval -eq 0 ] &amp;&amp; rm -f $lockfile
	return $retval
}

restart() {
	configtest || return $?
	stop
	start
}

reload() {
	configtest || return $?
	echo -n $”Reloading $prog: ”
	killproc $nginx -HUP
	RETVAL=$?
	echo
}

force_reload() {
	restart
}

configtest() {
	$nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
	status $prog
}

rh_status_q() {
	rh_status &gt;/dev/null 2&gt;&amp;1
}

case "$1" in
	start)
		rh_status_q &amp;&amp; exit 0
		$1
	;;
	stop)
		rh_status_q || exit 0
		$1
	;;
	restart|configtest)
		$1
	;;
	reload)
		rh_status_q || exit 7
		$1
	;;
	force-reload)
		force_reload
	;;
	status)
		rh_status
	;;
	condrestart|try-restart)
		rh_status_q || exit 0
	;;
	*)
		echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
		exit 2
esac</pre>
<p>Chmod nginx with executed permission, enter</p>
<pre># chmod +x /etc/init.d/nginx</pre>
<p>To start Nginx for the first time, type the following command</p>
<pre># /etc/init.d/nginx start</pre>
<h2>Install PHP (PHP-FPM)</h2>
<p>Download latest version of PHP at http://download.php.net</p>
<pre># wget http://www.php.net/get/php-5.3.8.tar.gz/from/ca.php.net/mirror</pre>
<p>To Extract its, enter</p>
<pre># tar zxvf php-5.3.8.tar.gz
# cd php-5.3.8</pre>
<p>To build PHP, I&#8217;ll create bash file called build.sh with following content</p>
<pre>#!/bin/sh
"./configure" \
"--prefix=/webserver/php" \
"--enable-fpm" \
"--with-libdir=lib64" \
"--with-bz2" \
"--with-config-file-path=/webserver/php/etc" \
"--with-config-file-scan-dir=/webserver/php/etc/php.d" \
"--with-curl=/usr/local/lib" \
"--with-gd" \
"--with-gettext" \
"--with-jpeg-dir=/usr/local/lib" \
"--with-freetype-dir=/usr/local/lib" \
"--with-kerberos" \
"--with-mcrypt" \
"--with-mhash" \
"--with-mysql" \
"--with-mysqli" \
"--with-pcre-regex=/usr" \
"--with-pdo-mysql=shared" \
"--with-pdo-sqlite=shared" \
"--with-pear=/usr/local/lib/php" \
"--with-png-dir=/usr/local/lib" \
"--with-pspell" \
"--with-sqlite=shared" \
"--with-tidy" \
"--with-xmlrpc" \
"--with-xsl" \
"--with-zlib" \
"--with-zlib-dir=/usr/local/lib" \
"--with-openssl" \
"--with-iconv" \
"--enable-bcmath" \
"--enable-calendar" \
"--enable-exif" \
"--enable-ftp" \
"--enable-gd-native-ttf" \
"--enable-libxml" \
"--enable-magic-quotes" \
"--enable-soap" \
"--enable-sockets" \
"--enable-mbstring" \
"--enable-zip" \
"--enable-wddx"</pre>
<p>Type the following command to install PHP</p>
<pre># sh build.sh
# make
# make install</pre>
<p>If you have problems building PHP then read the <a href="http://www.lifelinux.com/error-compiling-php-on-centos-x64/">article</a>.<br />
Next step, copy php.ini to /webserver/php/etc/, enter</p>
<pre># cp php.ini-production /webserver/php/etc/php.ini</pre>
<p>Rename php-fpm.conf, enter</p>
<pre># cd /webserver/php/etc
# cp php-fpm.conf.default php-fpm.conf</pre>
<p>Edit php-fpm.conf with following content</p>
<pre>[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
user = nobody
group = nobody
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500</pre>
<p>If you want to run PHP-FPM by default when the system boots, create file called php-fpm in /etc/init.d/ with following content</p>
<pre>#! /bin/sh

### BEGIN INIT INFO
# Provides:          php-fpm
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts php-fpm
# Description:       starts the PHP FastCGI Process Manager daemon
### END INIT INFO

php_fpm_BIN=/webserver/php/sbin/php-fpm
php_fpm_CONF=/webserver/php/etc/php-fpm.conf
php_fpm_PID=/webserver/php/var/run/php-fpm.pid

php_opts="--fpm-config $php_fpm_CONF"

wait_for_pid () {
	try=0

	while test $try -lt 35 ; do

		case "$1" in
			'created')
			if [ -f "$2" ] ; then
				try=''
				break
			fi
			;;

			'removed')
			if [ ! -f "$2" ] ; then
				try=''
				break
			fi
			;;
		esac

		echo -n .
		try=`expr $try + 1`
		sleep 1

	done

}

case "$1" in
	start)
		echo -n "Starting php-fpm "

		$php_fpm_BIN $php_opts

		if [ "$?" != 0 ] ; then
			echo " failed"
			exit 1
		fi

		wait_for_pid created $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed"
			exit 1
		else
			echo " done"
		fi
	;;

	stop)
		echo -n "Gracefully shutting down php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -QUIT `cat $php_fpm_PID`

		wait_for_pid removed $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed. Use force-exit"
			exit 1
		else
			echo " done"
		fi
	;;

	force-quit)
		echo -n "Terminating php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -TERM `cat $php_fpm_PID`

		wait_for_pid removed $php_fpm_PID

		if [ -n "$try" ] ; then
			echo " failed"
			exit 1
		else
			echo " done"
		fi
	;;

	restart)
		$0 stop
		$0 start
	;;

	reload)

		echo -n "Reload service php-fpm "

		if [ ! -r $php_fpm_PID ] ; then
			echo "warning, no pid file found - php-fpm is not running ?"
			exit 1
		fi

		kill -USR2 `cat $php_fpm_PID`

		echo " done"
	;;

	*)
		echo "Usage: $0 {start|stop|force-quit|restart|reload}"
		exit 1
	;;

esac</pre>
<p>Chmod php-fpm with executed permission, enter</p>
<pre># chmod +x /etc/init.d/php-fpm</pre>
<p>To start PHP-FPM for the first time, type the following command</p>
<pre># /etc/init.d/php-fpm start</pre>
<h2>Configure PHP-FPM and Nginx working together</h2>
<p>The configuration file for Nginx is located at /webserver/nginx/conf/nginx.conf. To edit nginx.conf type the following command</p>
<pre># vi /webserver/nginx/conf/nginx.conf</pre>
<p>Uncomment the following lines</p>
<pre>        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }</pre>
<p>Type the following command to restart Nginx</p>
<pre># /etc/init.d/nginx restart</pre>
<g:plusone href="http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/">How To Install Nginx And PHP (PHP-FPM) On CentOS 6</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-install-nginx-and-php-php-fpm-on-centos-6/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
		<item>
		<title>How To Increase The Number Of PTY (Pseudo-Terminal Driver)</title>
		<link>http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/</link>
					<comments>http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sat, 14 May 2011 10:27:31 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cat command]]></category>
		<category><![CDATA[character devices]]></category>
		<category><![CDATA[communication channel]]></category>
		<category><![CDATA[kernel configuration]]></category>
		<category><![CDATA[linux installation]]></category>
		<category><![CDATA[login sessions]]></category>
		<category><![CDATA[master slave]]></category>
		<category><![CDATA[maximum number]]></category>
		<category><![CDATA[pseudo terminal]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysctl command]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=488</guid>

					<description><![CDATA[<p>What is PTY? A pseudo-terminal (PTY) is a pair of virtual character devices that provide a bidirectional communication channel. One end of the channel is called the master; the other end is called the slave. The slave end of the pseudo-terminal provides an interface that behaves exactly like a classical terminal. A process that expects [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/">How To Increase The Number Of PTY (Pseudo-Terminal Driver)</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><h3>What is PTY?</h3>
<p>A <strong>pseudo-terminal</strong> (PTY) is a pair of virtual character devices that provide a bidirectional communication channel. One end of the channel is called the master; the other end is called the slave. The slave end of the pseudo-terminal provides an interface that behaves exactly like a classical terminal. A process that expects to be connected to a terminal, can open the slave end of a pseudo-terminal and then be driven by a program that has opened the master end. Anything that is written on the master end is provided to the process on the slave end as though it was input typed on a terminal.<span id="more-488"></span></p>
<h3>Check maximum number of PTY</h3>
<p>Login as root and type the following command</p>
<pre>
[root@lifelinux ~]# cat /proc/sys/kernel/pty/max
</pre>
<p>Sample output</p>
<pre>
4096
</pre>
<h3>Increase the maximum number of PTY temporarily</h3>
<p>If you need to increase the PTYs to allow more sessions temporarily. Type the following command</p>
<pre>
[root@lifelinux ~]# echo 5000 > /proc/sys/kernel/pty/max
</pre>
<p>The setting is changed instantly but this setting will be erased after the reboot.</p>
<h3>Increase the maximum number of PTY permanently</h3>
<p>Edit kernel configuration file at /etc/sysctl.conf, enter</p>
<pre>
[root@lifelinux ~]# vi /etc/sysctl.conf
</pre>
<p>Add or edit following config directive</p>
<pre>
kernel.pty.max = 5000
</pre>
<p>To enable the changes made in sysctl.conf you will need to run the command</p>
<pre>
[root@lifelinux ~]# sysctl -p
</pre>
<g:plusone href="http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/">How To Increase The Number Of PTY (Pseudo-Terminal Driver)</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-increase-the-number-of-pty-pseudo-terminal-driver/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Enable IP Forwarding On CentOS / RedHat</title>
		<link>http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/</link>
					<comments>http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 11 May 2011 05:30:06 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[/proc system]]></category>
		<category><![CDATA[Check IP Forwarding]]></category>
		<category><![CDATA[disable IP Forwarding]]></category>
		<category><![CDATA[IP Forwarding]]></category>
		<category><![CDATA[sysctl]]></category>
		<category><![CDATA[sysctl -p]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=412</guid>

					<description><![CDATA[<p>By default, Linux distribution such as Redhat, CentOS, and Fedora will have IP Forwarding disabled. The need to forward IP packets from one source to another using linux as the default gateway or linux router, IP forwarding should be enabled from this considerations. There are several techniques to enable IP Forwarding. Check IP Forwarding status [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/">How To Enable IP Forwarding On CentOS / RedHat</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>By default, Linux distribution such as Redhat, CentOS, and Fedora will have <strong>IP Forwarding</strong> disabled. The need to forward IP packets from one source to another using linux as the default gateway or linux router, IP forwarding should be enabled from this considerations. There are several techniques to enable IP Forwarding.<span id="more-412"></span></p>
<h3>Check IP Forwarding status</h3>
<p>Type the following command</p>
<pre>
[root@lifelinux ~]# sysctl -l | grep ip_forward
</pre>
<p>Sample outputs</p>
<pre>
net.ipv4.ip_forward = 0
</pre>
<p>or checking out the value in the /proc system</p>
<pre>
[root@lifelinux ~]# cat /proc/sys/net/ipv4/ip_forward
0
</pre>
<p>If IP forwarding is disabled, a value of 0 would be displayed and if IP forwarding was recently enabled, linux should be displaying a numerical value of 1.</p>
<h3>Enable IP Forwarding temporarily</h3>
<p>Login as root and type the following command</p>
<pre>
[root@lifelinux ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
</pre>
<p>The setting is changed instantly but this setting will be erased after the reboot.</p>
<h3>Enable IP Forwarding permanently</h3>
<p>Type the following command</p>
<pre>
[root@lifelinux ~]# vi /etc/sysctl.conf
</pre>
<p>Add the following line</p>
<pre>
net.ipv4.ip_forward = 1
</pre>
<p>To enable the changes made in sysctl.conf you will need to run the command</p>
<pre>
[root@lifelinux ~]# sysctl -p
</pre>
<g:plusone href="http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/">How To Enable IP Forwarding On CentOS / RedHat</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-enable-ip-forwarding-on-centos-redhat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Increase PHP Memory Limit</title>
		<link>http://lifelinux.com/how-to-increase-php-memory-limit/</link>
					<comments>http://lifelinux.com/how-to-increase-php-memory-limit/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 11 May 2011 04:19:40 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[Fatal Error: PHP Allowed Memory Size Exhausted]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[memory_limit]]></category>
		<category><![CDATA[PHP Memory Limit]]></category>
		<category><![CDATA[php_value]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=400</guid>

					<description><![CDATA[<p>If you have seen an error like “Fatal Error: PHP Allowed Memory Size Exhausted” in webserver logs or in your browser, this means that PHP has exhausted the maximum memory limit. There are several techniques to increase the PHP memory limit and you only need to use one of them. Changing memory limit globally from [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-increase-php-memory-limit/">How To Increase PHP Memory Limit</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>If you have seen an error like “<em><span style="color: #ff0000;">Fatal Error: PHP Allowed Memory Size Exhausted</span></em>” in webserver logs or in your browser, this means that PHP has exhausted the maximum memory limit.  There are several techniques to increase the PHP memory limit and you only need to use one of them.<span id="more-400"></span></p>
<h3>Changing memory limit globally from php.ini</h3>
<p>To find locate the php.ini file used by your web server. You can use the phpinfo() PHP function to <a href="http://www.lifelinux.com/how-to-limit-resources-used-by-a-php-script/">find it</a>. After, type the following command to edit php.ini file:</p>
<pre>[root@lifelinux ~]# vi /etc/usr/local/etc/php.ini</pre>
<p>Edit the memory_limit parameter in the php.ini file</p>
<pre>memory_limit = 32M</pre>
<p>You will require root access to make changes to php.ini on the system. This change is global and will be used by all php scripts running on the system. Once you change this value, you will need to restart the web server in order for it to become active.</p>
<h3>Changing memory limit using .htaccess</h3>
<p>Edit the .htaccess file in the web root directory. Look for the section:</p>
<pre>php_value memory_limit 32M</pre>
<p>This method will only work if PHP is running as an Apache module.</p>
<h3>Changing memory limit inside a single php script</h3>
<p>Set this directive inside a single php script:</p>
<pre>ini_set('memory_limit', '32M');</pre>
<g:plusone href="http://lifelinux.com/how-to-increase-php-memory-limit/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-increase-php-memory-limit/">How To Increase PHP Memory Limit</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-increase-php-memory-limit/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL Slow Query Log File</title>
		<link>http://lifelinux.com/mysql-slow-query-log-file/</link>
					<comments>http://lifelinux.com/mysql-slow-query-log-file/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 08 May 2011 11:27:47 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[/etc/my.cnf]]></category>
		<category><![CDATA[enable log slow query]]></category>
		<category><![CDATA[estart mysql service]]></category>
		<category><![CDATA[long_query_time]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[MySQL Slow Query]]></category>
		<category><![CDATA[mysql-slow-queries]]></category>
		<category><![CDATA[mysqld restart]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=349</guid>

					<description><![CDATA[<p>The slow query log consists of all SQL statements that took more than long_query_time seconds to execute and required at least min_examined_row_limit rows to be examined. The time to acquire the initial table locks is not counted as execution time. mysqld writes a statement to the slow query log after it has been executed and [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/mysql-slow-query-log-file/">MySQL Slow Query Log File</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><blockquote><p>The slow query log consists of all SQL statements that took more than long_query_time seconds to execute and required at least min_examined_row_limit rows to be examined. The time to acquire the initial table locks is not counted as execution time. <strong>mysqld</strong> writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might be different from execution order. The default value of <strong>long_query_time</strong> is 10. The minimum value is 0, and a resolution of microseconds is supported when logging to a file. However, the microseconds part is ignored and only integer values are written when logging to tables.<br />
Source: http://dev.mysql.com/doc/refman/5.5/en/slow-query-log.html
</p></blockquote>
<p><span id="more-349"></span></p>
<p>To make the change permanent whenever the MySQL server is started, and for MySQL prior 5.1.x, edit your my.cnf file (on Linux boxes this is usually somewhere like /etc/my.cnf or /etc/mysql/my.cnf) and uncomment the &#8220;log_slow_queries&#8221; line or add it if it&#8217;s not present.<br />
On a CentOS, type the following command</p>
<pre>
[root@server2 ~]# vi /etc/my.cnf
</pre>
<p>For example, the line to uncomment looks like so:</p>
<pre>
...
log_slow_queries = /var/log/mysql/mysql-slow-queries.log
...
</pre>
<p>You can change the log file name to something else or leave it blank so it uses the default. The default is to log the queries into a file in the MySQL data directory.</p>
<h3>Setting the long_query_time</h3>
<p>You can also specify how long a quey needs to run for before it is logged with the &#8220;long_query_time&#8221; setting. By default this is 10 seconds. In the my.cnf file, to change it to e.g. 1 second add the following:</p>
<pre>
...
long_query_time = 1
log_slow_queries = /var/log/mysql/mysql-slow-queries.log
...
</pre>
<p>After that, restart mysql service. Enter the following command:</p>
<pre>
[root@server2 ~]# /etc/init.d/mysqld restart
</pre>
<g:plusone href="http://lifelinux.com/mysql-slow-query-log-file/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/mysql-slow-query-log-file/">MySQL Slow Query Log File</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/mysql-slow-query-log-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to disable ICMP echo responses in Linux</title>
		<link>http://lifelinux.com/how-to-disable-ping-responses-in-linux/</link>
					<comments>http://lifelinux.com/how-to-disable-ping-responses-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Mon, 02 May 2011 03:22:33 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[disable icmp]]></category>
		<category><![CDATA[disable ping reply]]></category>
		<category><![CDATA[disable ping responses]]></category>
		<category><![CDATA[sysctl -p]]></category>
		<category><![CDATA[sysctl.conf]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=321</guid>

					<description><![CDATA[<p>Many malicious attacks begin with a ping scan. Disabling ICMP echo requests prevents your system’s discovery with a ping. Disable ICMP echo responses temporarily You can temporarily disable the ICMP using the following method but this setting will be erased after the reboot. root@lifelinux:~# echo 1 &#62; /proc/sys/net/ipv4/icmp_echo_ignore_all Also, to enable the ICMP echo responses [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-disable-ping-responses-in-linux/">How to disable ICMP echo responses in Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>Many malicious attacks begin with a ping scan. <strong>Disabling ICMP</strong> echo requests prevents your system’s discovery with a ping.</p>
<h3>Disable ICMP echo responses temporarily</h3>
<p>You can temporarily disable the ICMP using the following method but this setting will be erased after the reboot.</p>
<pre>root@lifelinux:~# echo 1 &gt;  /proc/sys/net/ipv4/icmp_echo_ignore_all</pre>
<p><span id="more-321"></span><br />
Also, to enable the ICMP echo responses back, type the following command:</p>
<pre>root@lifelinux:~# echo 0 &gt;  /proc/sys/net/ipv4/icmp_echo_ignore_all</pre>
<h3>Disable ICMP echo responses permanently</h3>
<p>You can permanently disable the ICMP echo reponses using the following method:<br />
Edit the sysctl.conf file:</p>
<pre>root@lifelinux:~# vi /etc/sysctl.conf</pre>
<p>And add the following line:</p>
<pre>net.ipv4.icmp_echo_ignore_all = 1</pre>
<p>After that, execute sysctl -p to enforce this setting immediately:</p>
<pre>root@lifelinux:~# sysctl -p</pre>
<p>The above command loads the sysctl settings from the sysctl.conf.</p>
<g:plusone href="http://lifelinux.com/how-to-disable-ping-responses-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-disable-ping-responses-in-linux/">How to disable ICMP echo responses in Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-disable-ping-responses-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Rootkit Hunter</title>
		<link>http://lifelinux.com/how-to-install-rootkit-hunter/</link>
					<comments>http://lifelinux.com/how-to-install-rootkit-hunter/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 03 Dec 2010 06:04:50 +0000</pubDate>
				<category><![CDATA[Anti Virus]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[anti rookit]]></category>
		<category><![CDATA[anti rootkit on linux]]></category>
		<category><![CDATA[install rkhunter]]></category>
		<category><![CDATA[rkhunter]]></category>
		<category><![CDATA[Rootkit Hunter]]></category>
		<category><![CDATA[rootkit on linux]]></category>
		<category><![CDATA[update rkhunter]]></category>
		<category><![CDATA[vi command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=253</guid>

					<description><![CDATA[<p>Rootkit Hunter (rkhunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. It does this by comparing SHA-1 hashes of important files with known good ones in online database, searching for default directories (of rootkits), wrong permissions, hidden files, suspicious strings in kernel modules, and special tests for Linux and FreeBSD. [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-rootkit-hunter/">How To Install Rootkit Hunter</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Rootkit Hunter</strong> (rkhunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. It does this by comparing SHA-1 hashes of important files with known good ones in online database, searching for default directories (of rootkits), wrong permissions, hidden files, suspicious strings in kernel modules, and special tests for Linux and FreeBSD.<span id="more-253"></span></p>
<p>Installation rkhunter in 5 steps</p>
<h2>Step 1: Download rkhunter</h2>
<p>Login your server as root, and type the following command</p>
<pre>wget http://biznetnetworks.dl.sourceforge.net/project/rkhunter/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz</pre>
<h2>Step 2: Extract rkhunter</h2>
<pre>tar -zxvf rkhunter-1.3.8.tar.gz</pre>
<h2>Step 3: Install rkhunter</h2>
<pre>cd rkhunter-1.3.8
sh installer.sh --install</pre>
<p>The screen as shown:</p>
<pre>Checking system for:
 Rootkit Hunter installer files: found
 A web file download command: wget found
Starting update:
 Checking installation directory "/usr/local": it exists and is writable.
 Checking installation directories:
  Directory /usr/local/share/doc/rkhunter-1.3.8: exists and is writable.
  Directory /usr/local/share/man/man8: exists and is writable.
  Directory /etc: exists and is writable.
  Directory /usr/local/bin: exists and is writable.
  Directory /usr/local/lib: exists and is writable.
  Directory /var/lib: exists and is writable.
  Directory /usr/local/lib/rkhunter/scripts: exists and is writable.
  Directory /var/lib/rkhunter/db: exists and is writable.
  Directory /var/lib/rkhunter/tmp: exists and is writable.
  Directory /var/lib/rkhunter/db/i18n: exists and is writable.
 Installing check_modules.pl: OK
 Installing filehashsha.pl: OK
 Installing stat.pl: OK
 Installing readlink.sh: OK
 Installing backdoorports.dat: OK
 Installing mirrors.dat: OK
 Installing programs_bad.dat: OK
 Installing suspscan.dat: OK
 Installing rkhunter.8: OK
 Installing ACKNOWLEDGMENTS: OK
 Installing CHANGELOG: OK
 Installing FAQ: OK
 Installing LICENSE: OK
 Installing README: OK
 Installing language support files: OK
 Installing rkhunter: OK
 Installing rkhunter.conf in no-clobber mode: OK
 &gt;&gt;&gt;
 &gt;&gt;&gt; PLEASE NOTE: inspect for update changes in "/etc/rkhunter.conf.24761",
 &gt;&gt;&gt; and apply to either "/etc/rkhunter.conf" or your local configuration
 &gt;&gt;&gt; file before running Rootkit Hunter.
 &gt;&gt;&gt;
Update complete
</pre>
<h2>Step 4: Update rkhunter</h2>
<p>At prompt type the following command</p>
<pre>rkhunter --update</pre>
<h2>Step 5:Adding daily cron job</h2>
<p>If you want get a mail daily with a status on your system, you need to do the following in steps:<br />
<strong>Create file rkhunter.sh</strong></p>
<pre>vi /etc/cron.daily/rkhunter.sh</pre>
<p><strong>Add the following code</strong></p>
<pre>#!/bin/sh
(
/usr/local/bin/rkhunter --versioncheck
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter --cronjob --report-warnings-only
) | /bin/mail -s 'rkhunter Daily Run' yourname@example.com</pre>
<p>Replace yourname@example.com above with your email.<br />
<strong></strong></p>
<p><strong>Set execute permission for rkhunter.sh</strong></p>
<pre>chmod +x /etc/cron.daily/rkhunter.sh</pre>
<g:plusone href="http://lifelinux.com/how-to-install-rootkit-hunter/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-rootkit-hunter/">How To Install Rootkit Hunter</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-install-rootkit-hunter/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install ionCube Loader</title>
		<link>http://lifelinux.com/how-to-install-ioncube-loader/</link>
					<comments>http://lifelinux.com/how-to-install-ioncube-loader/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 11:31:58 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[install ioncube loader]]></category>
		<category><![CDATA[install zend optimizer]]></category>
		<category><![CDATA[ioncube loader on apache]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[vi command]]></category>
		<category><![CDATA[zend optimizer on apache]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=84</guid>

					<description><![CDATA[<p>ionCube Loader is an extension to PHP interpreter which allows execution of ionCube-encoded files. Most of modern hosting providers already have ionCube Loader available on hosting servers. In this case no additional action is required to use iAuto, iRealty or iLister with encoded core. Download ionCube Loader http://www.ioncube.com/loaders.php Unpack ionCube Loader tar -zxvf ioncube_loaders_lin_x86.tar.gz Move [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-ioncube-loader/">How To Install ionCube Loader</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>ionCube Loader</strong> is an extension to PHP interpreter which  allows execution of ionCube-encoded files. Most of modern hosting  providers already have ionCube Loader available on hosting servers. In  this case no additional action is required to use iAuto, iRealty or  iLister with encoded core.<span id="more-84"></span><strong></strong></p>
<p><strong>Download ionCube Loader</strong></p>
<pre>http://www.ioncube.com/loaders.php</pre>
<p><strong>Unpack ionCube Loader</strong></p>
<pre>tar -zxvf ioncube_loaders_lin_x86.tar.gz</pre>
<p><strong>Move ionCube Loader to /usr/local/ionCube</strong></p>
<pre>cd ioncube_loaders_lin_x86
mv ioncube_loaders_lin_x86 /usr/local/ionCube
</pre>
<p><strong>Edit php.ini</strong></p>
<pre>vi /usr/local/lib/php.ini
</pre>
<p><strong>Add Code:</strong></p>
<pre>zend_extension=/usr/local/ionCube/ioncube_loader_lin_5.2.so
</pre>
<p><strong>Restart Apache</strong></p>
<pre>/etc/init.d/httpd restart
</pre>
<h2>Note</h2>
<p>If you have installed <a href="http://www.lifelinux.com/how-to-install-zend-optimizer-ioncube-loader-on-apache-2-x/"><strong>Zend Optimizer</strong></a> on Apache, I need to make sure that in file php.ini, the following line :</p>
<pre>zend_extension=/usr/local/ionCube/ioncube_loader_lin_5.2.so
</pre>
<p>it&#8217;s above the line</p>
<pre>zend_extension=/usr/local/ionCube/ZendOptimizer.so</pre>
<p><strong>Checking</strong></p>
<p>Create a file info.php in your root web directory  with content:</p>
<pre>&lt;?php
phpinfo();
?&gt;
</pre>
<p>Open your web browser and type the url: http://&lt;domain&gt;/info.php, sample outputs:</p>
<p><a href="http://www.lifelinux.com/wp-content/uploads/2010/11/ionCube.png"><img loading="lazy" class="aligncenter size-medium wp-image-92" title="ionCube install on apache" src="http://www.lifelinux.com/wp-content/uploads/2010/11/ionCube-300x101.png" alt="" width="300" height="101" srcset="http://lifelinux.com/wp-content/uploads/2010/11/ionCube-300x101.png 300w, http://lifelinux.com/wp-content/uploads/2010/11/ionCube.png 601w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<g:plusone href="http://lifelinux.com/how-to-install-ioncube-loader/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-install-ioncube-loader/">How To Install ionCube Loader</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-install-ioncube-loader/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
