<?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>Tutoriales Ubuntu &#187; ubuntu configurar dominios lighttp</title>
	<atom:link href="http://www.tutoriales-ubuntu.com/archives/tag/ubuntu-configurar-dominios-lighttp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tutoriales-ubuntu.com</link>
	<description>Todo sobre Ubuntu!</description>
	<lastBuildDate>Mon, 23 Nov 2009 22:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Configurar Dominios (vhosts) en Lighttpd</title>
		<link>http://www.tutoriales-ubuntu.com/archives/configurar-dominios-vhosts-en-lighttpd</link>
		<comments>http://www.tutoriales-ubuntu.com/archives/configurar-dominios-vhosts-en-lighttpd#comments</comments>
		<pubDate>Sun, 12 Apr 2009 17:11:15 +0000</pubDate>
		<dc:creator>roaksoax</dc:creator>
				<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[configurar dominios]]></category>
		<category><![CDATA[configurar dominios lighttpd]]></category>
		<category><![CDATA[configurar vhost lighttp]]></category>
		<category><![CDATA[dominios]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu configurar dominios lighttp]]></category>
		<category><![CDATA[ubuntu configurar vhosts lighttpd]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://www.tutoriales-ubuntu.com/?p=59</guid>
		<description><![CDATA[En este tutorial les mostraré como configurar dominios en Lighttpd, de tal manera que cuando alguna persona ingrese http://ejemplovhost.com en el explorador de internet, la dirección se redireccione de la siguiente forma http://www.ejemplovhost.com. También se mostrará la configuración inversa para este escenario, es decir, que cuando alguien ingrese http://www.ejemplovhost.com la dirección se cambie a http://ejemplovhost.com. [...]]]></description>
			<content:encoded><![CDATA[<p>En este tutorial les mostraré como configurar dominios en Lighttpd, de tal manera que cuando alguna persona ingrese <em><strong>http://ejemplovhost.com</strong></em> en el explorador de internet, la dirección se redireccione de la siguiente forma <em><strong>http://www.ejemplovhost.com</strong></em>. También se mostrará la configuración inversa para este escenario, es decir, que cuando alguien ingrese <em><strong>http://www.ejemplovhost.com</strong></em> la dirección se cambie a <em><strong>http://ejemplovhost.com</strong>.</em></p>
<p>Lo primero que tenemos que hacer para configurar un dominio para Lighttpd es crear el archivo donde se guardará esta configuración de este dominio, o vhost. Para nuestro caso creamos el siguiente archivo:</p>
<blockquote><p><em><code>sudo vim /etc/lighttpd/ejemplovhost.com.conf</code></em></p></blockquote>
<p>Y luego ingresamos la configuración de acuerdo al tipo de redirección que deseamos.<br />
<span id="more-59"></span><br />
<strong>De http://ejemplo.com a http://www.ejemplo.com</strong></p>
<blockquote><p><em><code>$HTTP["host"] =~ "^ejemplovhost\.com$" {<br />
&nbsp; &nbsp; &nbsp; &nbsp;url.redirect = ( "^/(.*)" =&gt; "http://www.ejemplovhost.com/$1" )<br />
}</code></em></p>
<p><em><code>$HTTP["host"] =~ "www\.ejemplovhost\.com$" {<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.document-root = "/var/www/ejemplovhost.com/"<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.errorlog = "/var/log/lighttpd/ejemplovhost.com.error.log"<br />
&nbsp; &nbsp; &nbsp; &nbsp;accesslog.filename = "/var/log/lighttpd/ejemplovhost.com.access.log",<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.error-handler-404 = "/index.php"<br />
}</code></em></p></blockquote>
<p><strong>De http://www.ejemplo.com a http://ejemplo.com</strong></p>
<blockquote><p><em><code>$HTTP["host"] =~ "www\.ejemplovhost\.com$" {<br />
&nbsp; &nbsp; &nbsp; &nbsp;url.redirect = ( "^/(.*)" =&gt; "http://ejemplovhost.com/$1" )<br />
}</code></em></p>
<p><em><code>$HTTP["host"] =~ "ejemplovhost\.com$" {<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.document-root = "/var/www/ejemplovhost.com/"<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.errorlog = "/var/log/lighttpd/ejemplovhost.com.error.log"<br />
&nbsp; &nbsp; &nbsp; &nbsp;accesslog.filename = "/var/log/lighttpd/ejemplovhost.com.access.log",<br />
&nbsp; &nbsp; &nbsp; &nbsp;server.error-handler-404 = "/index.php"<br />
}</code></em></p></blockquote>
<p>Ahora bien, para que esta configuración funcione tenemos que hacer dos cosas en el archivo de configuración de Lighttpd, <em><strong>/etc/lighttpd/lighttpd.conf</strong>. </em>Lo primero que tenemos que hacer es habilitar <em><strong>&#8220;mod_redirect&#8221;</strong></em> en la sección <em><strong>server.modules</strong></em>. Este archivo tiene que quedar algo similar a como se ve a continuación:</p>
<blockquote><p><em><code>server.modules = (<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_access",<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_alias",<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_accesslog",<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_compress",<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_rewrite",<br />
&nbsp; &nbsp; &nbsp; &nbsp;"mod_redirect"<br />
#   "mod_evhost",<br />
#   "mod_usertrack",<br />
#   "mod_rrdtool",<br />
#   "mod_webdav",<br />
#   "mod_expire",<br />
#   "mod_flv_streaming",<br />
#   "mod_evasive"<br />
)</code></em></p></blockquote>
<p>Y antes de cerrar y guardar este archivo, tenemos que indicarle a Lighttpd que cargue el archivo donde hemos configurado el dominio o vhost. Esto lo hacemos al final del archivo (<em><strong>/etc/lighttpd/lighttpd.conf</strong></em>) agregando lo siguiente:<br />
<em><br />
<blockquote><code>include “ejemplovhost.com.conf”</code></p></blockquote>
<p></em><br />
Ahora simplemente reiniciamos Lighttp:<br />
<em><br />
<blockquote><code>/etc/init.d/lighttpd restart</code></p></blockquote>
<p></em><br />
Y esto es todo lo que tenemos que hacer para tener nuestro dominio funcionando. Cada vez que deseamos agregar un nuevo dominio a nuestra configuración, seguimos los mismos pasos. Para ver el tutorial de como instalar Lighttpd haga clic en: <a href="http://www.tutoriales-ubuntu.com/archives/instalar-lighttpd-php5-mysql-en-ubuntu" target="_self"><strong><em>Instalar Lighttpd, PHP5, MySQL en Ubuntu</em></strong></a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutoriales-ubuntu.com/archives/configurar-dominios-vhosts-en-lighttpd/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

