<?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>freebsd php fastcgi &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="http://lifelinux.com/tag/freebsd-php-fastcgi/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Sun, 28 Aug 2011 09:56:12 +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>Installing Apache With Worker MPM And PHP-FastCGI</title>
		<link>http://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/</link>
					<comments>http://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="http://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="http://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="http://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://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="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/installing-apache-with-worker-mpm-and-php-fastcgi/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
