<?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>tru3n0 &#187; nginx debian php mysql</title>
	<atom:link href="http://tru3n0.com/tag/nginx-debian-php-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://tru3n0.com</link>
	<description>GNU/Linux, Web Development, Android and Free Software</description>
	<lastBuildDate>Fri, 02 Dec 2011 16:04:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Instalar nginx en Debian con soporte PHP5 y MySQL</title>
		<link>http://tru3n0.com/2010/02/19/instalar-nginx-en-debian-con-soporte-php5-y-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instalar-nginx-en-debian-con-soporte-php5-y-mysql</link>
		<comments>http://tru3n0.com/2010/02/19/instalar-nginx-en-debian-con-soporte-php5-y-mysql/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 19:21:24 +0000</pubDate>
		<dc:creator>tru3n0</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx debian php mysql]]></category>

		<guid isPermaLink="false">http://tru3n0.com/?p=300</guid>
		<description><![CDATA[Primero instalaremos el servidor MySQL. sudo apt-get install mysql-server mysql-client Al terminar de instalar los paquetes nos pedira la clave para el usuario root. A continuacion instalaremos php5 con todos los paquetes que queramos, en este caso solo el soporte &#8230; <a href="http://tru3n0.com/2010/02/19/instalar-nginx-en-debian-con-soporte-php5-y-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Primero instalaremos el servidor MySQL.</p>
<blockquote><p>sudo apt-get install mysql-server mysql-client</p></blockquote>
<p>Al terminar de instalar los paquetes nos pedira la clave para el usuario root.</p>
<p>A continuacion instalaremos php5 con todos los paquetes que queramos, en este caso solo el soporte para mysql, el cli y el cgi. Tambien instalaremos el paquete <a href="http://redmine.lighttpd.net/projects/spawn-fcgi/">spawn-fcgi</a> de lighttpd para el <a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface">cgi</a>.</p>
<blockquote><p>sudo apt-get install php5 php5-cli php5-cgi spawn-fcgi</p></blockquote>
<p>Solo nos queda por instalar nginx.</p>
<blockquote><p>sudo apt-get install nginx</p></blockquote>
<p>Una vez instalado arrancamos spawn-fcgi en el puerto 9000 o cualquier otro que queramos.</p>
<blockquote><p>sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid</p></blockquote>
<p>Editamos la configuracion del sitio por defecto (<em>/etc/nginx/sites-enabled/default</em>), la configuracion mas simple para php seria esta.</p>
<pre>server {
    listen        80;
    server_name   nginx.org  www.nginx.org;
    root          /data/www;

    location / {
        index     index.html  index.php;
    }

    location ~* .(gif|jpg|png)$ {
        expires   30d;
    }

    location ~ .php$ {
        fastcgi_pass   localhost:9000;
        fastcgi_param  SCRIPT_FILENAME
                       $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}
</pre>
<p>Creamos un fichero de prueba en /data/www que se llame <em>index.php</em> con el siguiente contenido</p>
<pre>&lt;?php
        php_info();
?&gt;
</pre>
<p>Reiniciamos el servidor.</p>
<blockquote><p>sudo /etc/init.d/nginx restart</p></blockquote>
<p>Ya deberiamos poder ver la informaccion de php accediendo a localhost desde el navegador.</p>
<p>Para que se inicie spawn-fcgi cada vez que reiniciemos el servidor tenemos que escribir esta linea antes de<em> exit 0</em> en el fichero <em>/etc/rc.local</em></p>
<blockquote><p>/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://tru3n0.com/2010/02/19/instalar-nginx-en-debian-con-soporte-php5-y-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

