<?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>worker processes &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="http://lifelinux.com/tag/worker-processes/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Wed, 09 Oct 2013 07:56:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.15</generator>
	<item>
		<title>How To Install Nginx And PHP-FPM On CentOS 6 Via Yum</title>
		<link>http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/</link>
					<comments>http://lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 16 Feb 2012 16:17:40 +0000</pubDate>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[chow command]]></category>
		<category><![CDATA[compile nginx and php]]></category>
		<category><![CDATA[freebsd nginx]]></category>
		<category><![CDATA[host names]]></category>
		<category><![CDATA[install nginx]]></category>
		<category><![CDATA[install nginx and php on linux]]></category>
		<category><![CDATA[install nginx and php-fpm]]></category>
		<category><![CDATA[install nginx on centos]]></category>
		<category><![CDATA[install nginx via yum]]></category>
		<category><![CDATA[install php-fpm]]></category>
		<category><![CDATA[install php-fpm via yum]]></category>
		<category><![CDATA[installing nginx]]></category>
		<category><![CDATA[installing nginx and php-fpm]]></category>
		<category><![CDATA[installing php-fpm]]></category>
		<category><![CDATA[mime types]]></category>
		<category><![CDATA[mkdir command]]></category>
		<category><![CDATA[necessary directories]]></category>
		<category><![CDATA[nginx and php-fpm]]></category>
		<category><![CDATA[nginx configuration file]]></category>
		<category><![CDATA[nginx named based virtual hosting]]></category>
		<category><![CDATA[nginx php-fpm]]></category>
		<category><![CDATA[nginx virtual hosting]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[server error log]]></category>
		<category><![CDATA[vi command]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[worker processes]]></category>
		<category><![CDATA[www user]]></category>
		<category><![CDATA[yum install nginx]]></category>
		<category><![CDATA[yum install php-fpm]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1339</guid>

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