<?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>enterprise linux &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/enterprise-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Mon, 02 Apr 2012 14:50:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6</title>
		<link>https://lifelinux.com/how-to-install-lighttpd-and-php-php-fpm-on-centos-6/</link>
					<comments>https://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="https://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="https://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="https://lifelinux.com/wp-content/uploads/2012/04/php-info-300x275.jpg 300w, https://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="https://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="https://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="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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 Configure Static IP Address On CentOS</title>
		<link>https://lifelinux.com/how-to-configure-static-ip-address-on-centos/</link>
					<comments>https://lifelinux.com/how-to-configure-static-ip-address-on-centos/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 16 Sep 2011 15:35:31 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[/etc/HOSTNAME]]></category>
		<category><![CDATA[/etc/init.d/network restart]]></category>
		<category><![CDATA[/etc/init.d/networking restart]]></category>
		<category><![CDATA[/etc/network/interfaces]]></category>
		<category><![CDATA[/etc/resolv.conf]]></category>
		<category><![CDATA[/etc/sysconfig/network]]></category>
		<category><![CDATA[/etc/sysconfig/network-scripts/ifcfg-eth0]]></category>
		<category><![CDATA[/etc/sysconfig/network-scripts/ifcfg-eth1]]></category>
		<category><![CDATA[default gateway]]></category>
		<category><![CDATA[dns servers]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[gateway ip]]></category>
		<category><![CDATA[internet protocol version]]></category>
		<category><![CDATA[internet protocol version 4]]></category>
		<category><![CDATA[network configuration]]></category>
		<category><![CDATA[network interfaces]]></category>
		<category><![CDATA[network scripts]]></category>
		<category><![CDATA[networking service]]></category>
		<category><![CDATA[setup linux]]></category>
		<category><![CDATA[static ip address]]></category>
		<category><![CDATA[static ip configuration]]></category>
		<category><![CDATA[tcp ip settings]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1226</guid>

					<description><![CDATA[<p>Configure a static IP address on CentOS is quite easy. In this article, I&#8217;ll show you how to do it through command line. Log on as root, change directory to /etc/sysconfig/network-scripts and list all available devices with the following command # cd /etc/sysconfig/network-scripts # ls -la &#124; grep ifcfg- Sample outputs -rw-r--r-- 3 root root [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-configure-static-ip-address-on-centos/">How To Configure Static IP Address On CentOS</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>Configure a static IP address on CentOS is quite easy. In this article, I&#8217;ll show you how to do it through command line.<br />
<span id="more-1226"></span><br />
Log on as root, change directory to /etc/sysconfig/network-scripts and list all available devices with the following command</p>
<pre># cd /etc/sysconfig/network-scripts
# ls -la | grep ifcfg-</pre>
<p>Sample outputs</p>
<pre>-rw-r--r--  3 root root   244 Oct 15  2010 ifcfg-<span style="color: #ff0000;">eth0</span>
-rw-r--r--  3 root root   141 Oct 15  2010 ifcfg-<span style="color: #ff0000;">eth1</span>
-rw-r--r--  1 root root   254 Oct 13  2010 ifcfg-<span style="color: #0000ff;">lo</span></pre>
<p>Find the configuration file corresponding to the NIC for which you want to set a static IP and edit it. In this example I&#8217;ll configure a static IP address for eth1 and use the following Internet Protocol Version 4:<br />
# IP address: 192.168.1.10<br />
# Netmask: 255.255.255.0<br />
# Gateway IP: 192.168.1.1<br />
# DNS Server IP # 2: 8.8.8.8<br />
# DNS Server IP # 2: 8.8.4.4</p>
<pre># vi ifcfg-eth1</pre>
<p>Sample outputs</p>
<pre># Intel Corporation 82574L Gigabit Network Connection
DEVICE=eth1
HWADDR=00:25:90:0B:A3:E5
ONBOOT=no
HOTPLUG=no
BOOTPROTO=dhcp
TYPE=Ethernet</pre>
<p>Now set the parameters below according to your settings, sample static ip configuration</p>
<pre># Intel Corporation 82574L Gigabit Network Connection
DEVICE=eth1
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:25:90:0B:A3:E5
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes</pre>
<p>To setup DNS servers, edit /etc/resolv.conf, enter</p>
<pre># vi /etc/resolv.conf</pre>
<p>Sample configurations</p>
<pre>nameserver 8.8.8.8
nameserver 8.8.4.4</pre>
<p>Now save the configuration file and exit the text editor. To apply changes, we need to bring the network interface down and back up, type the following command</p>
<pre># /etc/init.d/network restart</pre>
<p>Or,</p>
<pre># service network restart</pre>
<g:plusone href="https://lifelinux.com/how-to-configure-static-ip-address-on-centos/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-configure-static-ip-address-on-centos/">How To Configure Static IP Address On CentOS</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-configure-static-ip-address-on-centos/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>How To Setup A LAMP Server On Centos 6.0</title>
		<link>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/</link>
					<comments>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 26 Aug 2011 00:50:25 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[Apache Hardening]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[install httpd]]></category>
		<category><![CDATA[install LAMP]]></category>
		<category><![CDATA[install php]]></category>
		<category><![CDATA[install php 5]]></category>
		<category><![CDATA[install php5]]></category>
		<category><![CDATA[LAMP Hardening]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux security]]></category>
		<category><![CDATA[linux security modules]]></category>
		<category><![CDATA[optimize apache]]></category>
		<category><![CDATA[optmizing apache]]></category>
		<category><![CDATA[php 5]]></category>
		<category><![CDATA[php version]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[red hat enterprise]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel 5]]></category>
		<category><![CDATA[rpm command]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[setup LAMP]]></category>
		<category><![CDATA[yum command]]></category>
		<category><![CDATA[yum install httpd]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1081</guid>

					<description><![CDATA[<p>LAMP is essentially a server that runs Linux, Apache, MySQL and Php/Perl and is more commonly known as a LAMP server. This guide provides step-by-step instructions for installing a full-featured LAMP server on a CentOS 6 .0 1. Update system Before proceeding to install, update the system with the following command # yum update 2. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/">How To Setup A LAMP Server On Centos 6.0</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>LAMP</strong> is essentially a server that runs <strong>L</strong>inux, <strong>A</strong>pache, <strong>My</strong>SQL and <strong>P</strong>hp/<strong>P</strong>erl and is more commonly known as a LAMP server. This guide provides step-by-step instructions for installing a full-featured LAMP server on a CentOS 6 .0<br />
<span id="more-1081"></span></p>
<h2>1. Update system</h2>
<p>Before proceeding to install, update the system with the following command</p>
<pre># yum update</pre>
<h2>2. Install and Configure the Apache Web Server</h2>
<p>The Apache web server is the most popular server online, used on more than 70% of all servers connected to the World Wide Web. And there are good reasons for it: it’s free, it’s very stable, it delivers a great performance, it’s very customizable. To install the current version of the Apache web server use the following command</p>
<pre># yum install httpd</pre>
<p>If you want to run Apache by default when the system boots, type the following command</p>
<pre># chkconfig httpd --level 2345 on</pre>
<p>To start Apache for the first time, type the following command</p>
<pre># /etc/init.d/httpd start</pre>
<h3>3. Apache Web Server Security and Optimization</h3>
<p><strong>1. Disable any unnecessary apache modules, type the following command</strong></p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>My example configuration is here</p>
<pre>LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p><strong>2. Optimize Timeout &amp; KeepAlive</strong><br />
You need to control Timeouts &amp; KeepAlive to improve server performance. Type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find &amp; Edit it as follows</p>
<pre>Timeout 10
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 5</pre>
<p><strong>3. Optimize MPM (Multi-Processing Module)</strong><br />
Apache&#8217;s default installation of MPM Prefork. To optimize MPM Prefork, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;IfModule prefork.c&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;IfModule prefork.c&gt;
    StartServers          5
    MinSpareServers      10
    MaxSpareServers      15
    ServerLimit         450
    MaxClients          450
    MaxRequestsPerChild   0
&lt;/IfModule&gt;</pre>
<p>Which,</p>
<p># StartServers: number of server processes to start<br />
# MinSpareServers: minimum number of server processes which are kept spare<br />
# MaxSpareServers: maximum number of server processes which are kept spare<br />
# ServerLimit: maximum value for MaxClients for the lifetime of the server<br />
# MaxClients: maximum number of server processes allowed to start<br />
# MaxRequestsPerChild: maximum number of requests a server process serves</p>
<p><strong>4. Enable Mod_rewite</strong><br />
To enable mod_rewirte, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;Directory "/var/www/html"&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;Directory "/var/www/html"&gt;
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
&lt;Limit GET POST OPTIONS PROPFIND&gt;
    Order allow,deny
    Allow from all
&lt;/Limit&gt;
&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;
    Order deny,allow
    Deny from all
&lt;/LimitExcept&gt;
&lt;/Directory&gt;</pre>
<p><strong>5. Enable File Caching</strong><br />
Enabling file caching can greatly improve your site’s performance and speed. If you want to enable file caching, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;Directory "/var/www/html"&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;Directory "/var/www/html"&gt;
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
&lt;Limit GET POST OPTIONS PROPFIND&gt;
    Order allow,deny
    Allow from all
&lt;/Limit&gt;
&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;
    Order deny,allow
    Deny from all
&lt;/LimitExcept&gt;
&lt;FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png|html|css)$"&gt;  
	Header set Cache-Control "max-age=604800, public"  
&lt;/FilesMatch&gt;
&lt;/Directory&gt;</pre>
<h2>4. Install and Configure MySQL Database Server</h2>
<p>MySQL Server is one of the most popular database servers in the world, especially for use with dynamic, content rich websites. To install MySQL database server use the following command</p>
<pre># yum install mysql mysql-server</pre>
<p>After installing MySQL, I highly recommend to run mysql_secure_installation, a program that helps secure MySQL. Important points to note are:<br />
1. Be sure that the root account has a secure password set.<br />
2. Do not create an anonymous account, and if it exists, say &#8220;yes&#8221; to remove it.<br />
3. If your web server and MySQL server are on the same machine, you should disable the network access.</p>
<p>If you want to run MySQL by default when the system boots, type the following command</p>
<pre># chkconfig mysqld--level 2345 on</pre>
<p>To start MySQL for the first time, type the following command</p>
<pre># /etc/init.d/mysqld start</pre>
<h2>5. Installing and Configuring PHP</h2>
<p>PHP is a general-purpose scripting language originally designed for web development to produce dynamic web pages. Many popular web applications like WordPress, Joomla, Drupal, OScommerce, Magento are written in PHP. To install PHP on CentOS use the following command</p>
<pre># yum install php53 php53-mysql</pre>
<p>To create secure PHP configuration settings, type the following command</p>
<pre>
# vi /etc/php.ini
</pre>
<p>Find &#038; Edit it as follows</p>
<pre>
allow_url_fopen = Off 
display_errors = Off 
display_startup_errors = Off 
log_errors = On 
error_reporting = E_ALL 
expose_php = Off 
magic_quotes_gpc = On 
magic_quotes_sybase = Off 
register_globals = Off
max_execution_time = 60
memory_limit = 64M
</pre>
<p>To prevent run PHP scripts with a different file extension, type the following command</p>
<pre># vi /etc/httpd/conf.d/php.conf</pre>
<p>Find</p>
<pre>
AddHandler php5-script .php
AddType text/html .php
</pre>
<p>Replace it as follows</p>
<pre>&lt;FilesMatch \.php$&gt;
	AddHandler php5-script .php
	AddType text/html .php
&lt;/FilesMatch&gt;</pre>
<p>Restart Apache to reload new configurations. Type the following command</p>
<pre># /etc/init.d/httpd restart</pre>
<g:plusone href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/">How To Setup A LAMP Server On Centos 6.0</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Flush/Remove All Iptables Rules In Linux</title>
		<link>https://lifelinux.com/how-to-flushremove-all-iptables-rules/</link>
					<comments>https://lifelinux.com/how-to-flushremove-all-iptables-rules/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 19 May 2011 02:50:58 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[centos linux]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[fedora core]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[flush firewall]]></category>
		<category><![CDATA[gnu linux]]></category>
		<category><![CDATA[init script]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[stop firewall]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=633</guid>

					<description><![CDATA[<p>By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. Type the following command to see its # cat /etc/sysconfig/iptables Or # iptables -L Temporarily delete all the firewall rules At first, create flush.iptables script with following command # vi flush.iptables Add the following content #!/bin/sh iptables -F iptables -X iptables -t nat -F iptables [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-flushremove-all-iptables-rules/">How To Flush/Remove All Iptables Rules In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. Type the following command to see its</p>
<pre>
# cat /etc/sysconfig/iptables
</pre>
<p><span id="more-633"></span><br />
Or </p>
<pre>
# iptables -L
</pre>
<h3>Temporarily delete all the firewall rules</h3>
<p>At first, create flush.iptables script with following command</p>
<pre>
# vi flush.iptables
</pre>
<p>Add the following content</p>
<pre>
#!/bin/sh
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
</pre>
<p>Finally, run flush.iptables script with the following command</p>
<pre>
# sh flush.iptables
</pre>
<p>After running flush.iptables script, if you restart the iptables, you&#8217;ll see all the default rules again. So, flush is only temporary.</p>
<h3>Permanently remove all the default firewall rules</h3>
<p>Step 1. Flush all these rules temporarily, as we discussed above.<br />
Step 2. Saving firewall rules to /etc/sysconfig/iptables. Type the following command</p>
<pre>
# /etc/init.d/iptables save
</pre>
<p>Or</p>
<pre>
# iptables-save > /etc/sysconfig/iptables
</pre>
<g:plusone href="https://lifelinux.com/how-to-flushremove-all-iptables-rules/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-flushremove-all-iptables-rules/">How To Flush/Remove All Iptables Rules In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-flushremove-all-iptables-rules/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Setting Up Password Aging In Linux</title>
		<link>https://lifelinux.com/setting-up-password-aging-in-linux/</link>
					<comments>https://lifelinux.com/setting-up-password-aging-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 18 May 2011 06:18:22 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[/etc/login.defs]]></category>
		<category><![CDATA[account password]]></category>
		<category><![CDATA[chage command]]></category>
		<category><![CDATA[configuration name]]></category>
		<category><![CDATA[configuration parameter]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux users]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[pass max days]]></category>
		<category><![CDATA[pass min days]]></category>
		<category><![CDATA[pass warn age]]></category>
		<category><![CDATA[password expiry]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[shadow password]]></category>
		<category><![CDATA[usermod command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=611</guid>

					<description><![CDATA[<p>By default, all the account password expiration in Linux are disabled. There have two method to enable and disable password expiration, one of method by editing /etc/shadow file. Another method is using chage command. 1. Edit /etc/shadow Login as root and type the following command # vi /etc/shadow Sample outputs ... lifelinux:$1$UgE5i8uC$mtNxSoPOCl5G5.9mQOQLy.:15092:0:99999:7::: ... As with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/setting-up-password-aging-in-linux/">Setting Up Password Aging In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>By default, all the account password expiration in Linux are disabled. There have two method to enable and disable password expiration, one of method by editing /etc/shadow file. Another method is using chage command.<span id="more-611"></span></p>
<h3>1. Edit /etc/shadow</h3>
<p>Login as root and type the following command</p>
<pre>
# vi /etc/shadow
</pre>
<p>Sample outputs</p>
<pre>
...
lifelinux:$1$UgE5i8uC$mtNxSoPOCl5G5.9mQOQLy.:15092:0:99999:7:::
...
</pre>
<p>As with the passwd file, each field in the shadow file is also separated with &#8220;:&#8221; colon characters, and are as follows:<br />
1. Username, up to 8 characters. Case-sensitive, usually all lowercase. A direct match to the username in the /etc/passwd file.<br />
2. Password, 13 character encrypted. A blank entry (eg. ::) indicates a password is not required to log in (usually a bad idea), and a &#8220;*&#8221; entry (eg. :*:) indicates the account has been disabled.<br />
3. The number of days (since January 1, 1970) since the password was last changed.<br />
4. The number of days before password may be changed (0 indicates it may be changed at any time)<br />
5. The number of days after which password must be changed (99999 indicates user can keep his or her password unchanged for many, many years)<br />
6. The number of days to warn user of an expiring password (7 for a full week)<br />
7. The number of days after password expires that account is disabled<br />
8. The number of days since January 1, 1970 that an account has been disabled<br />
9. A reserved field for possible future use<br />
<strong>Syntax:</strong></p>
<pre>
{userName}:{password}:{lastpasswdchanged}:{Minimum_days}:{Maximum_days}:{Warn}:{Inactive}:{Expire}:
</pre>
<h3>2. Using chage command</h3>
<pre>
Usage: chage [options] user

Options:
  -d, --lastday LAST_DAY        set last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
</pre>
<p>To list current aging type chage command for particular user account, example lifelinux, enter</p>
<pre>
# chage -l lifelinux
</pre>
<p>Sample outputs</p>
<pre>
Last password change                                    : Apr 28, 2011
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
</pre>
<p><strong>Example:</strong> Set password aging for lifelinux, force password change every 60 days (-M 60), and prevent password changes for seven days (-m 7). Login users will receiving warnings 7 days (-W 7) and account will be locked after 7 days (-I 7).</p>
<pre>
# chage -m 7 -M 60 -W 7 -I 7 lifelinux
</pre>
<p>To Disable password aging, enter</p>
<pre>
# chage -m 0 -M 99999 -I -1 lifelinux
</pre>
<p>Force user to change password at first login, enter</p>
<pre>
# chage -d 0 lifelinux
</pre>
<g:plusone href="https://lifelinux.com/setting-up-password-aging-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/setting-up-password-aging-in-linux/">Setting Up Password Aging In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/setting-up-password-aging-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>chkconfig Command</title>
		<link>https://lifelinux.com/chkconfig-command/</link>
					<comments>https://lifelinux.com/chkconfig-command/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 17:24:13 +0000</pubDate>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[chkconfig command]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[init script]]></category>
		<category><![CDATA[rhel 5]]></category>
		<category><![CDATA[system administrators]]></category>
		<category><![CDATA[update-rc.d]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=103</guid>

					<description><![CDATA[<p>chkconfig provides a  simple  command-line  tool  for  maintaining  the/etc/rc[0-6].d  directory  hierarchy by relieving system administrators of the task of directly manipulating the  numerous  symbolic  links  in those directories. chkconfig has five distinct functions: adding new services for  management,  removing  services  from management, listing the current startup information for services, changing the  start-up  information  for  services, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/chkconfig-command/">chkconfig Command</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>chkconfig</strong> provides a  simple  command-line  tool  for  maintaining  the/etc/rc[0-6].d  directory  hierarchy by relieving system administrators of the task of directly manipulating the  numerous  symbolic  links  in those directories.<span id="more-103"></span></p>
<p>chkconfig has five distinct functions: adding new services for  management,  removing  services  from management, listing the current startup information for services, changing the  start-up  information  for  services, and checking the start-up state of a particular service.</p>
<h2>Synopsis</h2>
<pre>chkconfig --list [name]
chkconfig --add name
chkconfig --del name
chkconfig [--level levels] name &lt;on|off|reset&gt;
chkconfig [--level levels] name
</pre>
<h2>Example</h2>
<p>List status for all services</p>
<pre>chkconfig --list
</pre>
<p>List status for test service</p>
<pre>chkconfig --list test
</pre>
<p>Add service called test</p>
<pre>chkconfig --add test
</pre>
<p>Delete service called test</p>
<pre>chkconfig --del test
</pre>
<p>Turn on &amp; Turn off service</p>
<pre>chkconfig --level 3 5 httpd off
</pre>
<p>The command above will turn off httpd service in <a href="http://www.lifelinux.com/linux-runlevels/">run levels</a> 3 and 5.</p>
<g:plusone href="https://lifelinux.com/chkconfig-command/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/chkconfig-command/">chkconfig Command</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/chkconfig-command/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
