<?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>Apache &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/category/webserver/apache/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Sun, 22 Dec 2013 04:10:46 +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 Fix Apache Error &#8220;(28)No space left on device&#8221;</title>
		<link>https://lifelinux.com/how-to-fix-apache-error-28no-space-left-on-device/</link>
					<comments>https://lifelinux.com/how-to-fix-apache-error-28no-space-left-on-device/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 22 Dec 2013 04:10:46 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[(28)No space left on device]]></category>
		<category><![CDATA[Couldn't create the proxy mutex]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1885</guid>

					<description><![CDATA[<p>On some occasions apache server will just fail, and become crashed, failing to restart with an error message like # tail /var/log/httpd/error_log [Sun Dec 22 10:05:27.006998 2013] [core:emerg] [pid 15001:tid 140145945569216] (28)No space left on device: AH00023: Couldn't create the fcgid-proctbl mutex [Sun Dec 22 10:05:38.000403 2013] [core:emerg] [pid 15018:tid 140368783902656] (28)No space left on [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-fix-apache-error-28no-space-left-on-device/">How To Fix Apache Error &#8220;(28)No space left on device&#8221;</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>On some occasions apache server will just fail, and become crashed, failing to restart with an error message like<span id="more-1885"></span></p>
<pre>
# tail /var/log/httpd/error_log

[Sun Dec 22 10:05:27.006998 2013] [core:emerg] [pid 15001:tid 140145945569216] (28)No space left on device: AH00023: Couldn't create the fcgid-proctbl mutex
[Sun Dec 22 10:05:38.000403 2013] [core:emerg] [pid 15018:tid 140368783902656] (28)No space left on device: AH00023: Couldn't create the proxy mutex
[Sun Dec 22 10:05:38.000456 2013] [proxy:crit] [pid 15018:tid 140368783902656] (28)No space left on device: AH02478: failed to create proxy mutex
</pre>
<p>If you see an error similar to the bellow, it could indicate that your server has run out of semaphores. To see how many semaphores are being used, type the following command</p>
<pre>
# ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000000 38797312   apache     600        1
0x00000000 38731777   apache     600        1
0x00000000 38830082   apache     600        1
0x00000000 38961155   apache     600        1
0x00000000 38895620   apache     600        1
0x00000000 38993925   apache     600        1
0x00000000 39026694   apache     600        1
0x00000000 39059463   apache     600        1
0x00000000 39092232   apache     600        1
0x00000000 39125001   apache     600        1
0x00000000 39157770   apache     600        1
0x00000000 39288843   apache     600        1
0x00000000 39223308   apache     600        1
0x00000000 39321613   apache     600        1
0x00000000 39354382   apache     600        1
0x00000000 39387151   apache     600        1
0x00000000 39419920   apache     600        1
0x00000000 39452689   apache     600        1
0x00000000 39485458   apache     600        1
</pre>
<p>To fix it and get Apache server started again, we must clean the semaphores. Run the following command to flush them:</p>
<pre>
for whatever in `ipcs -s | awk '{print $2}'`; do ipcrm -s $whatever; done
</pre>
<p>If that command may not work on older server then you may need to do the following</p>
<pre>
# /etc/init.d/httpd stop
# ipcs -s | grep nobody | gawk '{ print $2 }' | xargs -n 1 ipcrm sem
# /etc/init.d/httpd start
</pre>
<p>Final, you may want to increase the semaphore limits on your server. You can do that by adding the following to the /etc/sysctl.conf</p>
<pre>
kernel.msgmni = 512
kernel.sem = 250 128000 32 512
</pre>
<p>After, type the following command to update new setting for kernel</p>
<pre>
# sysctl -p
</pre>
<g:plusone href="https://lifelinux.com/how-to-fix-apache-error-28no-space-left-on-device/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-fix-apache-error-28no-space-left-on-device/">How To Fix Apache Error &#8220;(28)No space left on device&#8221;</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-fix-apache-error-28no-space-left-on-device/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Setup Iptables Firewall For A Web Server On CentOS</title>
		<link>https://lifelinux.com/how-to-setup-iptables-firewall-for-a-web-server-on-centos/</link>
					<comments>https://lifelinux.com/how-to-setup-iptables-firewall-for-a-web-server-on-centos/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 07 Mar 2013 05:49:02 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1649</guid>

					<description><![CDATA[<p>I have setup an web server using Apache on CentOS. How do I configure firewall using iptables to allow or block access to the web server under CentOS ? In Tutorial I will show you How do I do it. What is iptables ? iptables is a user space application program that allows a system [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-iptables-firewall-for-a-web-server-on-centos/">How To Setup Iptables Firewall For A Web Server 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>I have setup an web server using Apache on CentOS. How do I configure firewall using iptables to allow or block access to the web server under CentOS ? In Tutorial I will show you How do I do it.<br />
<span id="more-1649"></span></p>
<h2>What is iptables ?</h2>
<p>iptables is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables for Ethernet frames.</p>
<h2>Setting up iptables</h2>
<p>In most Linux distros including Redhat / CentOS Linux installs iptables by default. You can use the following procedure to verify that iptables has been installed. Open terminal and type the following command:</p>
<pre>
# iptables -V
</pre>
<p>Sample outputs:</p>
<pre>
iptables v1.4.7
</pre>
<p>You can use the following command to view the status of iptables command, enter:</p>
<pre>
# yum info iptables
</pre>
<p>Sample outputs:</p>
<pre>
Installed Packages
Name        : iptables
Arch        : x86_64
Version     : 1.4.7
Release     : 5.1.el6_2
Size        : 833 k
Repo        : installed
From repo   : anaconda-CentOS-201207061011.x86_64
Summary     : Tools for managing Linux kernel packet filtering capabilities
URL         : http://www.netfilter.org/
License     : GPLv2
Description : The iptables utility controls the network packet filtering code in
            : the Linux kernel. If you need to set up firewalls and/or IP
            : masquerading, you should install this package.
...
</pre>
<p>If the above message does not appear, then type the following command to install iptables</p>
<pre>
# yum install iptables -y
</pre>
<h2>Configuration iptables for a web server</h2>
<p>The default iptables configuration on CentOS does not allow access to the HTTP (TCP PORT # 80) and HTTPS (TCP PORT # 443) ports used by the Apache web server. You can do step by step to configure<br />
<strong>Step 1: Flush or remove all iptables rules</strong></p>
<pre>
# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X
</pre>
<p><strong>Step 2: Set default rules</strong></p>
<pre>
# iptables -P INPUT DROP
# iptables -P FORWARD ACCEPT
# iptables -P OUTPUT ACCEPT
</pre>
<p><strong>Step 3: Allow access to HTTP (80) and HTTPS (443)</strong></p>
<pre>
# iptables -A INPUT -i lo -j ACCEPT 
# iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT 
# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
# iptables -A INPUT -p icmp -j ACCEPT
# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
</pre>
<h2>Turn on and save iptables</h2>
<p>Type the following two commands to turn on firewall:</p>
<pre>
# chkconfig iptables on
# service iptables save
</pre>
<h2>Anti synflood with iptables</h2>
<p>Edit /etc/sysctl.conf to defend against certain types of attacks and append / update as follows:</p>
<pre>
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.netfilter.ip_conntrack_max = 1048576
</pre>
<p>And type the following command</p>
<pre>
# iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 --syn -m recent --set --name CHECK --rsource 
# iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 --syn -m recent --update --seconds 5 --hitcount 15 --rttl --name CHECK --rsource -j DROP 
</pre>
<g:plusone href="https://lifelinux.com/how-to-setup-iptables-firewall-for-a-web-server-on-centos/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-iptables-firewall-for-a-web-server-on-centos/">How To Setup Iptables Firewall For A Web Server 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-setup-iptables-firewall-for-a-web-server-on-centos/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>What is the role of this variables in php.ini file (expose_php &#8211; allow_url_fopen &#8211; register_globals) ?</title>
		<link>https://lifelinux.com/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/</link>
					<comments>https://lifelinux.com/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/#comments</comments>
		
		<dc:creator><![CDATA[Linux Killer]]></dc:creator>
		<pubDate>Tue, 29 Jan 2013 19:52:34 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux server]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[rsync command]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[variables]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1446</guid>

					<description><![CDATA[<p>There are a lot of people do not know what these variables and how they can be used , this Variables exist in php.ini file , the php.ini file is contains settings PHP on server , and for each variable in the php.ini file have a special role and can be disabled and activated with ON and [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/">What is the role of this variables in php.ini file (expose_php &#8211; allow_url_fopen &#8211; register_globals) ?</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>There are a lot of people do not know what these variables and how they can be used , this Variables exist in php.ini file , the php.ini file is contains settings PHP on server , and for each variable in the php.ini file have a special role and can be disabled and activated with ON and Off</p>
<p><span id="more-1446"></span></p>
<p>Disable = Off</p>
<p>Activate = On</p>
<p>So now I will explain to you the benefit of each function and put you a choice in the activation and disable</p>
<pre>expose_php</pre>
<p>Is a a property from which to see PHP version on the server so disabling means not making available to the hacker to know the version of PHP</p>
<pre>allow_url_fopen</pre>
<p>When you disable this function no one will be able to contain another link in a specific page , but some scripts like AM4SS &#8211; Vbulletin need this function for the arrival of notifications within the Admin Control Panel</p>
<pre>register_globals</pre>
<p>When you Desable this function become possible to control the content of php files difficult and does not allow the Edited only by the owner<br />
<strong>So now we come to the disabled and activation of these properties</strong></p>
<p>Enter in the shell and modify the php.ini file with the following command</p>
<pre>nano /usr/local/lib/php.ini</pre>
<p>By pressing Ctrl + W will open new box writes what you want to search for inside file</p>
<p>Looking for the variable you want edited for example</p>
<pre>allow_url_fopen</pre>
<p>You&#8217;ll find as follows :</p>
<pre>allow_url_fopen = On</pre>
<p>Mark value after the mark (=) On for activate Off  for disabled , Apply it with the rest of the properties , After completion of the amendment to click on the keys CTRL + X + Y then Enter button</p>
<p>You will see a new command line in the main interface in shell<br />
Observation : you must restart Apache after any amendment to this file for edited is defined in the php and Apache<br />
To restart apache :</p>
<pre>service httpd restart</pre>
<p>Or you can restart apache using server Control Panel WHM In a private box to restart services From there you can restart any service you want to.</p>
<g:plusone href="https://lifelinux.com/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/">What is the role of this variables in php.ini file (expose_php &#8211; allow_url_fopen &#8211; register_globals) ?</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/what-is-the-role-of-this-variables-in-php-ini-file-expose_php-allow_url_fopen-register_globals/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How Do I Configure Apache Server To Listen Multiple Ports ?</title>
		<link>https://lifelinux.com/how-do-i-configure-apache-server-to-listen-multiple-ports/</link>
					<comments>https://lifelinux.com/how-do-i-configure-apache-server-to-listen-multiple-ports/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 30 Dec 2011 17:10:32 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[/etc/httpd/conf/httpd.conf]]></category>
		<category><![CDATA[apache web server]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[incoming requests]]></category>
		<category><![CDATA[number 80]]></category>
		<category><![CDATA[port 8080]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[restart apache]]></category>
		<category><![CDATA[restart httpd]]></category>
		<category><![CDATA[tcp port 80]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1288</guid>

					<description><![CDATA[<p>By default Apache server listens on TCP port 80 but I&#8217;d like an Apache Web Server to listen on port 80 and port 8080. The following article explains how do I configure Apache server to listen multiple ports under CentOS Linux Server? To configure Apache server to listen multiple ports, you need to login as [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-configure-apache-server-to-listen-multiple-ports/">How Do I Configure Apache Server To Listen Multiple Ports ?</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 Apache server listens on TCP port 80 but I&#8217;d like an Apache Web Server to listen on port 80 and port 8080. The following article explains how do I configure Apache server to listen multiple ports under CentOS Linux Server?<br />
<span id="more-1288"></span><br />
To configure Apache server to listen multiple ports, you need to login as root and open configure file <strong>/etc/httpd/conf/httpd.conf</strong> and modify the Listen directive tells the server to accept incoming requests on the specified port.</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find line that read as follows:</p>
<pre>Listen 80</pre>
<p>Force Apache server to listen on both port 80 and 8080:</p>
<pre>Listen 80
Listen 8080</pre>
<p>And find the VirtualHost portion for your website config and add *:8080 as shown below:</p>
<pre>&lt;VirtualHost *:80 *:8080&gt;
...
&lt;/VirtualHost&gt;</pre>
<p>Save and close the file. Restart apache server:</p>
<pre># service httpd restart</pre>
<g:plusone href="https://lifelinux.com/how-do-i-configure-apache-server-to-listen-multiple-ports/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-configure-apache-server-to-listen-multiple-ports/">How Do I Configure Apache Server To Listen Multiple Ports ?</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-do-i-configure-apache-server-to-listen-multiple-ports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Start / Stop / Restart Apache Server</title>
		<link>https://lifelinux.com/linux-start-stop-restart-apache-server/</link>
					<comments>https://lifelinux.com/linux-start-stop-restart-apache-server/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 30 Dec 2011 16:51:21 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[/etc/init.d/httpd]]></category>
		<category><![CDATA[apache httpd server]]></category>
		<category><![CDATA[configuration error]]></category>
		<category><![CDATA[fedora linux]]></category>
		<category><![CDATA[restart apache web server]]></category>
		<category><![CDATA[restart httpd]]></category>
		<category><![CDATA[server service]]></category>
		<category><![CDATA[service command]]></category>
		<category><![CDATA[stop apache web server]]></category>
		<category><![CDATA[stop httpd]]></category>
		<category><![CDATA[syntax check]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1282</guid>

					<description><![CDATA[<p>I&#8217;m using Apache server in CentOS / RHEL / Debian / Ubuntu and I&#8217;d like to start, stop or restart my apache server after making some changes to configuration settings. How do I start/stop/restart apache server ? CentOS / RHEL If you are using CentOS / RHEL then type the following commands Start Apache server [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/linux-start-stop-restart-apache-server/">Linux Start / Stop / Restart Apache Server</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>I&#8217;m using Apache server in CentOS / RHEL / Debian / Ubuntu and I&#8217;d like to start, stop or restart my apache server after making some changes to configuration settings. How do I start/stop/restart apache server ?<span id="more-1282"></span></p>
<h2>CentOS / RHEL</h2>
<p>If you are using CentOS / RHEL then type the following commands</p>
<p><strong>Start Apache server</strong></p>
<pre>
# service httpd start
</pre>
<p><strong>Stop Apache server</strong></p>
<pre>
# service httpd stop
</pre>
<p><strong>Restart Apache server</strong></p>
<pre>
# service httpd start
</pre>
<p>You can also use following commands:</p>
<pre>
# /etc/init.d/httpd start
# /etc/init.d/httpd stop
# /etc/init.d/httpd restart
</pre>
<p>Please note that restart option is a shorthand way of stopping and then starting the Apache Server. You need to restart server whenever you make changes to configuration settings. It is also good idea to check configuration error before typing restart option:</p>
<pre>
# httpd -t
</pre>
<p>Sample outputs</p>
<pre>
Syntax OK
</pre>
<h2>Debian / Ubuntu</h2>
<p>If you are using Debian / Ubuntu then type the following commands</p>
<p><strong>Start Apache server</strong></p>
<pre>
# service apache2 start
</pre>
<p><strong>Stop Apache server</strong></p>
<pre>
# service apache2 stop
</pre>
<p><strong>Restart Apache server</strong></p>
<pre>
# service apache2 start
</pre>
<p>You can also use following commands:</p>
<pre>
# /etc/init.d/apache2 start
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 restart
</pre>
<g:plusone href="https://lifelinux.com/linux-start-stop-restart-apache-server/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/linux-start-stop-restart-apache-server/">Linux Start / Stop / Restart Apache Server</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/linux-start-stop-restart-apache-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installing Apache With Worker MPM And PHP-FastCGI</title>
		<link>https://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/</link>
					<comments>https://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 28 Aug 2011 09:01:34 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[/usr/local/etc/apache22/httpd.conf]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[binary compatibility]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[freebsd php apache]]></category>
		<category><![CDATA[freebsd php fastcgi]]></category>
		<category><![CDATA[freebsd php5 fastcgi]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod fcgi]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[process management]]></category>
		<category><![CDATA[suhosin]]></category>
		<category><![CDATA[zend engine]]></category>
		<category><![CDATA[zend technologies]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1138</guid>

					<description><![CDATA[<p>The worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time. Worker generally is a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM. This guide provides the process of switching from Apache&#8217;s default installation of MPM Prefork to that [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/">Installing Apache With Worker MPM And PHP-FastCGI</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>The worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time. Worker generally is a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM. This guide provides the process of switching from Apache&#8217;s default installation of MPM Prefork to that of MPM Worker and i will also be covering the proper installation of FastCGI (mod_fcgid) to further improve your server performance.<br />
<span id="more-1138"></span></p>
<h2>Install Apache &amp; Switching Apache to Worker MPM mode</h2>
<p>To install apache on CentOS, type the following command as root</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>
<p>To switch Apache to Worker MPM mode edit /etc/sysconfig/httpd</p>
<pre># vi /etc/sysconfig/httpd</pre>
<p>Uncomment the following line</p>
<pre>HTTPD=/usr/sbin/httpd.worker</pre>
<h2>Install PHP &amp; mod_fcgid</h2>
<p>To install PHP 5.3 on CentOS, type the following command</p>
<pre># yum install php53</pre>
<p>Apache run mod_php by default, to disable mod_php, type the following command</p>
<pre># mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.bak</pre>
<p>To install mod_fcgid, the first you need to ensure httpd-devel package installed, enter</p>
<pre># yum install httpd-devel</pre>
<p>Download &amp; Extract mod_fcgid</p>
<pre># wget http://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-2.3.6.tar.gz
tar zxvf mod_fcgid-2.3.6.tar.gz
cd mod_fcgid-2.3.6</pre>
<p>To compile mod_fcgid, type the following command</p>
<pre># ./configure.apxs
# make
# make install</pre>
<p>The module will be automatically installed and specified in the configuration file of the Apache. The next step create config for mod_fcgi, enter</p>
<pre># vi /etc/httpd/conf.d/mod_fcgid.conf</pre>
<p>Add the following content</p>
<pre>AddHandler php-fcgi
&lt;FilesMatch \.php$&gt;
Options +ExecCGI
AddHandler php-fcgi .php
FCGIWrapper /var/www/cgi-bin/php-fcgi .php
&lt;/FilesMatch&gt;
AddType text/html .php
DirectoryIndex index.php</pre>
<p>Create php-fcgi script in cgi-bin, enter</p>
<pre>
# vi /var/www/cgi-bin/php-fcgi
</pre>
<p>Add the following content</p>
<pre>
#!/bin/sh
PHPRC=/etc/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=0
exec /usr/bin/php-cgi
</pre>
<p>Make file executable</p>
<pre>
# chmod +x /var/www/cgi-bin/php-fcgi
</pre>
<p>I would recommend that you specify the line below in /etc/php.ini cgi.fix_pathinfo = 1, enter</p>
<pre>
# echo "cgi.fix_pathinfo = 1" >> /etc/php.ini
</pre>
<p>Final, restart Apache with the following command</p>
<pre>
# /etc/init.d/httpd restart
</pre>
<g:plusone href="https://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/">Installing Apache With Worker MPM And PHP-FastCGI</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/installing-apache-with-worker-mpm-and-php-fastcgi/feed/</wfw:commentRss>
			<slash:comments>3</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 Limit File Upload Size On Apache</title>
		<link>https://lifelinux.com/how-to-limit-file-upload-size-on-apache/</link>
					<comments>https://lifelinux.com/how-to-limit-file-upload-size-on-apache/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Tue, 24 May 2011 09:25:56 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[apache .htaccess]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[configuration options]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Limiting Upload Size]]></category>
		<category><![CDATA[LimitRequestBody]]></category>
		<category><![CDATA[request body]]></category>
		<category><![CDATA[restart apache web server]]></category>
		<category><![CDATA[uploads]]></category>
		<category><![CDATA[virtual host]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=748</guid>

					<description><![CDATA[<p>To limit the total size of the HTTP request body sent from the client use LimitRequestBody Directive. The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-limit-file-upload-size-on-apache/">How To Limit File Upload Size On Apache</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>To limit the total size of the HTTP request body sent from the client use <strong>LimitRequestBody</strong> Directive.<br />
<span id="more-748"></span><br />
The <strong>LimitRequestBody</strong> directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for passing form information to the server. Implementations of the PUT method will require a value at least as large as any representation that the server wishes to accept for that resource.</p>
<p>This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.</p>
<p>This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.</p>
<p>For example,if we want to limit upload size to 100k for  /var/www/html/uploads, we need to add below commands to .htaccess or httpd.conf.</p>
<pre>
&lt;Directory "/var/www/html/uploads"&gt;
    LimitRequestBody 102400
&lt;/Directory&gt;
</pre>
<p>Finally, restart apache ( if added to httpd.conf ), type the following command as root</p>
<pre>
# /etc/init.d/httpd graceful
</pre>
<g:plusone href="https://lifelinux.com/how-to-limit-file-upload-size-on-apache/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-limit-file-upload-size-on-apache/">How To Limit File Upload Size On Apache</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-limit-file-upload-size-on-apache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Increase PHP Memory Limit</title>
		<link>https://lifelinux.com/how-to-increase-php-memory-limit/</link>
					<comments>https://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="https://lifelinux.com/how-to-increase-php-memory-limit/">How To Increase PHP Memory Limit</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>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="https://lifelinux.com/how-to-increase-php-memory-limit/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-increase-php-memory-limit/">How To Increase PHP Memory Limit</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-increase-php-memory-limit/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How To Limit Resources Used By A PHP Script</title>
		<link>https://lifelinux.com/how-to-limit-resources-used-by-a-php-script/</link>
					<comments>https://lifelinux.com/how-to-limit-resources-used-by-a-php-script/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 11 May 2011 04:07:00 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[amount of time]]></category>
		<category><![CDATA[apache web server]]></category>
		<category><![CDATA[filesize]]></category>
		<category><![CDATA[input time]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[limit resources]]></category>
		<category><![CDATA[max input]]></category>
		<category><![CDATA[max size]]></category>
		<category><![CDATA[maximum execution time]]></category>
		<category><![CDATA[maximum size]]></category>
		<category><![CDATA[memory limit]]></category>
		<category><![CDATA[php allow_url_fopen = Off]]></category>
		<category><![CDATA[php cgi.force_redirect = 0]]></category>
		<category><![CDATA[php file_uploads = Off]]></category>
		<category><![CDATA[php max_execution_time = 30]]></category>
		<category><![CDATA[php max_input_time = 30]]></category>
		<category><![CDATA[php memory_limit = 40M]]></category>
		<category><![CDATA[php post_max_size = 8M]]></category>
		<category><![CDATA[php scripts]]></category>
		<category><![CDATA[php sql.safe_mode = On]]></category>
		<category><![CDATA[php upload_max_filesize = 2M]]></category>
		<category><![CDATA[request data]]></category>
		<category><![CDATA[resource limits]]></category>
		<category><![CDATA[uploaded files]]></category>
		<category><![CDATA[web server service]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=390</guid>

					<description><![CDATA[<p>PHP supports the following resource limits directives in php.ini file. To limit resources used by a PHP script edit the file php.ini. Note that this change will affect all websites and PHP scripts on the server. To find the location of php.ini, you can use the phpinfo() PHP function to find it. Create file with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-limit-resources-used-by-a-php-script/">How To Limit Resources Used By A PHP Script</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>PHP supports the following resource limits directives in <strong>php.ini</strong> file. To limit resources used by a PHP script edit the file php.ini. Note that this change will affect all websites and PHP scripts on the server.</p>
<p>To find the location of php.ini, you can use the phpinfo() PHP function to find it. Create file with following content:</p>
<pre>&lt;?php
phpinfo();
?&gt;</pre>
<p><span id="more-390"></span><br />
Sample outputs:<br />
<a href="http://www.lifelinux.com/wp-content/uploads/2011/05/php.ini_.png"><img loading="lazy" class="aligncenter size-medium wp-image-392" title="php.ini" src="http://www.lifelinux.com/wp-content/uploads/2011/05/php.ini_-300x49.png" alt="" width="300" height="49" srcset="https://lifelinux.com/wp-content/uploads/2011/05/php.ini_-300x49.png 300w, https://lifelinux.com/wp-content/uploads/2011/05/php.ini_.png 335w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>To edit php.ini, type the following command:</p>
<pre>[root@lifelinux ~]# vi /etc/usr/local/etc/php.ini</pre>
<p>Set maximum execution time of each script:</p>
<pre>max_execution_time = 30</pre>
<p>Set maximum amount of time each script may spend parsing request data</p>
<pre>max_input_time = 30</pre>
<p>Set maximum amount of memory a script may consume</p>
<pre>memory_limit = 64M</pre>
<p>Set maximum size of POST data that PHP will accept</p>
<pre>post_max_size = 8M</pre>
<p>Set maximum allowed size for uploaded files</p>
<pre>upload_max_filesize = 8M</pre>
<p>Disable/Enable HTTP file uploads (Disallow uploading unless necessary)</p>
<pre>file_uploads = Off</pre>
<p>Final, restart web server, example restart apache server, type the following command</p>
<pre>[root@lifelinux ~]# /etc/init.d/httpd restart</pre>
<g:plusone href="https://lifelinux.com/how-to-limit-resources-used-by-a-php-script/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-limit-resources-used-by-a-php-script/">How To Limit Resources Used By A PHP Script</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-limit-resources-used-by-a-php-script/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
