<?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>Ajaxman &#187; Apache</title>
	<atom:link href="http://www.ajaxman.net/category/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxman.net</link>
	<description>Ajax, Javascript, Xul, Internet, Recursos, Informatica ...</description>
	<lastBuildDate>Sat, 07 Jan 2012 23:15:44 +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>[Python] Ejecutando scripts de Python y psp&#8217;s con Apache 2 en GNU/Linux Debian</title>
		<link>http://www.ajaxman.net/python-ejecutando-scripts-de-python-y-psps-con-apache-2-en-gnulinux-debian.html</link>
		<comments>http://www.ajaxman.net/python-ejecutando-scripts-de-python-y-psps-con-apache-2-en-gnulinux-debian.html#comments</comments>
		<pubDate>Thu, 25 Nov 2010 05:52:19 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Debian Squeeze]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Psp]]></category>
		<category><![CDATA[Python Server Pages]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/?p=2051</guid>
		<description><![CDATA[Pues dándome espacio nuevamente, mientras estoy preparando nuevos posts, les pongo este que es lo que precisamente estoy preparando en mi Laptop con Debian Squeeze, que no es otra cosa mas que correr aplicaciones Python (y Django posteriormente) en Linux para saber mas. Bueno suponemos que ya tenemos instalado Apache2 en Linux y si no [...]]]></description>
			<content:encoded><![CDATA[<p>Pues dándome espacio nuevamente, mientras estoy preparando nuevos posts, les pongo este que es lo que precisamente estoy preparando en mi Laptop con Debian Squeeze, que no es otra cosa mas que correr aplicaciones Python (y Django posteriormente) en Linux para saber mas.</p>
<p>Bueno suponemos que ya tenemos instalado Apache2 en Linux y si no pues pueden ver el post anterior, que fue el que puse ayer en vez de este.</p>
<p>Esto solo aplica para la distribución Debian.</p>
<p>Para hacer esto, es necesario estar logueado como root (su)</p>
<pre class="brush: bash; title: ; notranslate">
root@debian:/home/ajaxman# apt-get install libapache2-mod-python
</pre>
<p>Y listo con esto ya tenemos casi listo nuestro servidor para poder desarrollar paginas en python, solo hace falta agregar ciertos controladores a nuestro VirtualHost.</p>
<p>Para ello editaremos nuestro virtualHosts por default y le agregaremos algunas lineas que están en el siguiente código</p>
<pre class="brush: bash; title: ; notranslate">
root@debian:/home/ajaxman# vim /etc/apache2/sites-available/default
&lt;Directory /home/ajaxman/htdocs&gt;
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all

 #####################################################################
 ##### Las siguientes lineas son las que agregaremos para python #####
 #####################################################################

 AddHandler mod_python .py
 PythonHandler mod_python.publisher
 PythonDebug On

 #####################################################################
 #####         Fin de las lineas para python             #####
 #####################################################################
&lt;/Directory&gt;
</pre>
<p>Y reiniciamos nuestro Apache</p>
<pre class="brush: bash; title: ; notranslate">
root@debian:/home/ajaxman# /etc/init.d/apache2 restart
</pre>
<p>Y ahora crearemos un script en python, para probar que funciona (Lo podemos hacer en Vi,nano, Kwrite o en algún otro editor) y lo guardamos en nuestro DocumentRoot</p>
<p>Y agregamos el siguiente código (vim test.py)</p>
<pre class="brush: python; title: ; notranslate">

def index(req):
 return &quot;Python esta instalado correctamente con apache&quot;;
</pre>
<p>Y lo corremos para ver que efectivamente este funcionando bien nuestro python y apache, lo que nos tiene que mostrar es el resultado que esta entre comillas.</p>
<p>Si además de eso deseamos ejecutar paginas PSP(Python Server Pages), debemos editar nuevamente nuestro VirtualHost, y cambiar los controladores de los archivos .psp.</p>
<p><strong>Nota Importante: Podemos correr scripts PSP&#8217;s y .py correctamente en apache pero al menos yo no logre que funcionaran ambos en el mismo VirtualHost, por ello si deseamos correr psp&#8217;s debemos modificar el contenido de nuestro VirtualHost o agregar un nuevo VirtualHost, ya que si queremos correr ambos generan errores. </strong></p>
<p>Solo agregaremos el código que marco en las siguientes lineas a nuestro VirtualHost.<span id="more-2051"></span></p>
<pre class="brush: bash; title: ; notranslate">
root@debian:/home/ajaxman# vim /etc/apache2/sites-available/default

&lt;Directory /home/ajaxman/htdocs&gt;
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all

 #####################################################################
 ##### Las siguientes lineas son las que agregaremos para PSP #####
 #####################################################################

 AddHandler mod_python .psp
 PythonHandler mod_python.psp
 PythonDebug On

 #####################################################################
 #####         Fin de las lineas para PSP             #####
 #####################################################################
&lt;/Directory&gt;
</pre>
<p>Y obviamente reiniciamos apache</p>
<pre class="brush: bash; title: ; notranslate">

root@debian:/home/ajaxman# /etc/init.d/apache2 restart
</pre>
<p>Y creamos nuestro script psp (vim test.psp)</p>
<pre class="brush: xml; title: ; notranslate">

&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;&lt;% req.write(&quot;Hola desde Python Server Pages&quot;) %&gt;&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Y ejecutamos nuestro script.</p>
<p>Y listo con esto ya podemos correr scripts de python en nuestro apache ahora ya tenemos nuestro entorno <strong>LAMPP (Linux, Apache, MySQL, PHP, Python)</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/python-ejecutando-scripts-de-python-y-psps-con-apache-2-en-gnulinux-debian.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[LAMP] Instalando un servidor Apache2, MySQL, PHP y PhpMyadmin en GNU/Linux Debian</title>
		<link>http://www.ajaxman.net/lamp-instalando-un-servidor-apache2-mysql-php-y-phpmyadmin-en-gnulinux-debian.html</link>
		<comments>http://www.ajaxman.net/lamp-instalando-un-servidor-apache2-mysql-php-y-phpmyadmin-en-gnulinux-debian.html#comments</comments>
		<pubDate>Wed, 24 Nov 2010 05:38:00 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Phpmyadmin]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/?p=2047</guid>
		<description><![CDATA[Bueno les estaba preparando un post sobre Python-Django con apache pero creo que antes voy a postear esto. Bueno la idea es instalar un servidor LAMP completo con Apache MySQL y PHP(de momento luego python también),en un entorno GNU/Linux, esto lo haremos mediante nuestro gestor de paquetes apt o aptitude, que vienen siendo casi lo [...]]]></description>
			<content:encoded><![CDATA[<p>Bueno les estaba preparando un post sobre <strong>Python-Django</strong> con apache pero creo que antes voy a postear esto.</p>
<p>Bueno la idea es instalar un servidor <strong>LAMP completo con Apache MySQL y PHP(de momento luego python también),en un entorno GNU/Linux, esto lo haremos mediante nuestro gestor de paquetes apt o aptitude</strong>, que vienen siendo casi lo mismo, luego quizá lo hagamos compilando nuestros propios binarios pero para la practica esta bien aprender con esto.</p>
<p>Primero abrimos nuestra <strong>Terminal(Konsole en KDE4) </strong>o vamos directamente a nuestra consola si no tenemos interfaz grafica y con el comando su nos logueamos como root.</p>
<pre class="brush: bash; title: ; notranslate">

ajaxman@debian:~$ su
Contraseña:

root@debian:/home/ajaxman#
</pre>
<p>Una vez como root procederemos a instalar nuestros paquetes los cuales serán los siguientes.</p>
<ul>
<li> <strong>Apache</strong>
<ul>
<li>apache2</li>
</ul>
</li>
<li><strong>PHP</strong>
<ul>
<li>php5</li>
<li>php5-mysql</li>
<li>libapache2-mod-php5</li>
<li>php5-curl</li>
<li>php5-mcrypt</li>
<li>php5-gd</li>
</ul>
</li>
<li><strong>MySQL</strong>
<ul>
<li>mysql-server</li>
<li>mysql-client</li>
<li>phpmyadmin</li>
</ul>
</li>
</ul>
<p>Con la lista anterior estaremos instalando Apache, PHP y MySQL, además de algunos módulos necesarios para que estos tres softwares estén instalados y algunos módulos extras, los cuales a veces pueden ser necesario como en mi caso que le puse el modulo GD, el CURL y el MCRYPT.</p>
<p>GNU/Linux es muy practico y por ello nos permite instalar todo desde un solo comando, ojo puedes ser necesario tener instalado ncurses para que el MySQL no pida los datos de acceso, inserta la siguiente linea en tu consola y ahí te mostrara si las dependencias están completas o si necesitas algún software extra(para ncurses instala libncurses5-dev).</p>
<pre class="brush: bash; title: ; notranslate">

root@debian:/home/ajaxman#apt-get install apache2 php5 php5-mysql libapache2-mod-php5 php5-curl php5-mcrypt php5-gd mysql-server mysql-client phpmyadmin
</pre>
<p><span id="more-2047"></span></p>
<p>Y con esto empezara a instalar nuestro servidor, hay que poner atención a la terminal ya que nos pedirá que agreguemos una contraseña a MySQL como root, la cual es muy importante, y después configurara PHPmyAdmin.</p>
<p>Y listo creo que no se necesitan mas explicaciones, nada mas hay que tomar en cuenta la siguiente lista de tips sobre apache2.</p>
<ul>
<li>Nuestro <strong>DocumentRoot esta por default en /var/www/ </strong>(obviamente se puede cambiar)</li>
<li>En <strong>/etc/apache2/ </strong>encontraremos todo lo necesario para configurar nuestro <strong>Apache</strong></li>
<li>Para cambiar nuestro <strong>DocumentRoot hay que hacerlo desde un virtualhost</strong></li>
<li><strong>Los virtualHosts estan en /etc/apache2/sites-available/</strong></li>
<li>Podemos crear muchos virtualHosts pero no se veran hasta activarlos</li>
<li>Para <strong>activar un Virtualhost</strong> se hace con el comando <strong>#a2ensite &lt;NombreDelArchivoDelVirtualHost&gt;</strong></li>
<li>También los <strong>módulos</strong> se pueden agregar desde <strong>/etc/apache2/mods-available</strong></li>
<li>Para activar un módulos se hace con <strong># a2enmod</strong></li>
<li>Para fines practicos
<ul>
<li><strong> /etc/apache2/sites-available/ =&gt; Sitios (VirtualHosts) Disponibles</strong></li>
<li><strong> /etc/apache2/sites-enabled/ =&gt; Sitios (VirtualHosts) Activados</strong></li>
<li><strong> /etc/apache2/mods-available/ =&gt; Módulos Disponibles</strong></li>
<li><strong> /etc/apache2/mods-enabled/ =&gt; Módulos Activados</strong></li>
</ul>
</li>
</ul>
<p>Para desactivarlos es con # a2dismod a2dissite respectivamente.</p>
<p>Para configurar nuestro<strong> PHP lo haremos desde la carpeta /etc/php5/apache2/ editando el archivo php.ini</strong></p>
<p>Como verán es mas fácil de instalar y de personalizar que en Windows ya también funciona el MySQL, pueden hacer una prueba usando sus datos de root que establecieron previamente.</p>
<p>Bueno con esto terminamos el post a dormir y ya saben si hay dudas con gusto pueden dejar sus comentarios, el otro post lo termino después﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/lamp-instalando-un-servidor-apache2-mysql-php-y-phpmyadmin-en-gnulinux-debian.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] Creando Virtual Host de Apache usando Linux</title>
		<link>http://www.ajaxman.net/tutorial-creando-virtual-host-de-apache-usando-linux.html</link>
		<comments>http://www.ajaxman.net/tutorial-creando-virtual-host-de-apache-usando-linux.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 01:22:14 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Manual]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[VirtualHost]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/?p=1541</guid>
		<description><![CDATA[Hasta hoy creo que voy a escribir algo util, pero pues y saben que mi tiempo es poco y hay que aprovecharlo al máximo. Bueno la idea de este post es platicarles sobre como se pueden crear los famosos virtualhosts.Pero antes de empezar enterémonos bien que es un virtualhost. Con los virtualhosts podremos tener varios [...]]]></description>
			<content:encoded><![CDATA[<p>Hasta hoy creo que voy a escribir algo util, pero pues y saben que mi tiempo es poco y hay que aprovecharlo al máximo.</p>
<p>Bueno la idea de este post es platicarles sobre como se pueden crear los famosos <strong>virtualhosts</strong>.Pero antes de empezar enterémonos bien que es un virtualhost.</p>
<p>Con los <strong>virtualhosts</strong> podremos tener varios dominios apuntando a una misma pc. Dentro de cada <strong>virtualhost</strong> podremos definir las condiciones para cada dominio que esté representando.</p>
<p>Es como si tuviéramos varios dominios dentro de nuestro servidor osea 127.0.0.1.</p>
<p><strong>Es decir que aparte de usar http://localhost, podríamos usar http://localweb, http://proyecto, http://www.beta.com o el nombre que mas nos guste, para ello lo primero que necesitamos es tener instalado apache2 (la ultima versión) y funcionando.</strong></p>
<p>Ahora veamos como crear y usar los virtualhost(<strong>Es necesario tener permisos de root para algunos cambios</strong>)</p>
<p>Entraremos  a nuestra consola y nos moveremos a   cd /etc/apache2/sites-available/</p>
<p><em><strong>ajaxman@debianJS:~$ su<br />
Contraseña:<br />
debianJS:/home/ajaxman# cd /etc/apache2/sites-available/<br />
debianJS:/etc/apache2/sites-available#</strong></em></p>
<p>Una vez ahí veremos que hay un archivo llamado default (en mi caso hay dos el otro se llama default-ssl es digamos que la &#8220;plantilla&#8221; de los sitio con ssl)</p>
<p><em><strong>debianJS:/etc/apache2/sites-available# ls -la<br />
total 24<br />
drwxr-xr-x 2 root root 4096 abr 14 16:37 .<br />
drwxr-xr-x 7 root root 4096 nov  6 16:46 ..<br />
-rw-r&#8211;r&#8211; 1 root root 1428 nov  6 17:44 default<br />
-rw-r&#8211;r&#8211; 1 root root 7366 oct  1  2008 default-ssl</strong></em></p>
<p>El archivo default es el que contiene la información que usaremos en los virtualHost por lo cual simplemente copiaremos todo el archivo en uno nuevo eso lo hacemos mediante el comando <strong>cat</strong>.</p>
<p><em><strong>debianJS:/etc/apache2/sites-available# cat default&gt; website</strong></em></p>
<p>Ahora nuestro ls se vera asi</p>
<p><em><strong>debianJS:/etc/apache2/sites-available# ls -la<br />
total 24<br />
drwxr-xr-x 2 root root 4096 abr 14 16:37 .<br />
drwxr-xr-x 7 root root 4096 nov  6 16:46 ..<br />
-rw-r&#8211;r&#8211; 1 root root 1428 nov  6 17:44 default<br />
-rw-r&#8211;r&#8211; 1 root root 7366 oct  1  2008 default-ssl<br />
-rw-r&#8211;r&#8211; 1 root root 1480 abr 14 16:35 website</strong></em></p>
<p>Ahora lo abrimos y lo editamos con el Vi y lo unico que modificaremos sera lo siguiente.</p>
<p><strong>debianJS:/etc/apache2/sites-available# vim website</strong><br />
<em><br />
<strong>< VirtualHost *:80 ><br />
ServerAdmin webmaster@localhost</p>
<p>DocumentRoot /home/www/<br />
< Directory  / ><br />
Options FollowSymLinks<br />
AllowOverride None<br />
< /Directory ><br />
< Directory /home/www/ ><br />
Options Indexes FollowSymLinks MultiViews<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
< / Directory ><br />
&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
< VirtualHost ></strong></em></p>
<p>Por esto</p>
<p><em><strong>< VirtualHost *:80 ><br />
ServerAdmin webmaster@ajaxman.net<br />
ServerName prog<br />
ServerAlias www.website.net</p>
<p>DocumentRoot /home/www/prog<br />
< Directory / ><br />
Options FollowSymLinks<br />
AllowOverride None<br />
< /Directory ><br />
< Directory /home/www/prog ><br />
Options Indexes FollowSymLinks MultiViews<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
< / Directory ><br />
&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
< VirtualHost ></strong></em></p>
<p>Nota: Tiene espacios intencionales para evitar que wordpress lo tome como si fueran tags HTML</p>
<p>Lo que cambiamos fue</p>
<ul>
<li><strong>Agregamos Server Name</strong>, que es donde estará el nombre de nuestro servidor en este caso se llama prog</li>
<li><strong>Le agregamos un ServerAlias</strong>, que es como otro nombre para acceder a este VirtualHost, en este caso es <strong>www.website.net.</strong></li>
<li><strong>Y le modificamos el DocumentRoot</strong>, el cual sera la carpeta del sitio que queremos Virtualizar</li>
</ul>
<p><strong>Los guardamos con [Esc]:wq</strong></p>
<p>Ahora lo agregamos a apache</p>
<p><em><strong>debianJS:/etc/apache2/sites-available# a2ensite website</strong></em></p>
<p>Y apache nos dira que lo agrego con éxito, Ojo:<strong> para evitar que Apache nos de errores, es necesario que la carpeta que el indicamos en DocumentRoot exista, si no no nos va a funcionar.</strong></p>
<p><strong>a2ensite,</strong> lo único que hace es un enlace simbólico dentro de la carpeta <strong>/etc/apache2/sites-enabled</strong> a algunos de los sitios que están en la otra carpeta<strong> /etc/apache2/sites-available</strong> , es decir  en <strong>sites-available</strong> están los sitios disponibles, y en <strong>sites-enabled</strong> están  los que podemos usar.<em><strong><br />
</strong></em><br />
<span id="more-1541"></span><br />
<em><strong>debianJS:/etc/apache2/sites-enabled# ls -la<br />
total 8<br />
drwxr-xr-x 2 root root 4096 abr 14 16:26 .<br />
drwxr-xr-x 7 root root 4096 nov  6 16:46 ..<br />
lrwxrwxrwx 1 root root   26 nov  6 16:13 000-default -&gt; ../sites-available/default<br />
lrwxrwxrwx 1 root root   23 abr 14 16:26 website -&gt; ../sites-available/website</strong></em></p>
<p><strong>Ahora modificamos nuestro fichero hosts, hay que tener cuidado por que Apache en mi debian tiene dos un host y otro que se llama hosts, el que vamos a modificar es hosts(con ese al final)</strong></p>
<p><em><strong>debianJS:/etc/apache2/sites-enabled# vim /etc/hosts</strong></em></p>
<p>Nos aparecera asi</p>
<p><em><strong>127.0.0.1       localhost<br />
&#8230;&#8230;.<br />
&#8230;&#8230;&#8230;.<br />
&#8230;&#8230;&#8230;&#8230;</strong></em></p>
<p>Lo unico que debemos hacer es agregar nuestro nuevo sitio de acuerdo al alias que le pusimos o bien el servername(se ve mas chido con Alias) y quedara asi</p>
<p><em><strong>127.0.0.1       localhost<br />
127.0.0.1       www.website.net<br />
..<br />
&#8230;..<br />
&#8230;&#8230;..</strong></em></p>
<p>Guardamos nuestro archivo, y con esto le decimos a nuestro Linux, que cuando teeclemos www.website.net lo busque en nuestra misma pc y no afuera.</p>
<p>Ahora solo recargamos apache</p>
<p><strong>debianJS:/etc/apache2/sites-enabled# /etc/init.d/apache2 reload</strong></p>
<p>Y listo</p>
<p>Ahora abrimos nuestro Firefox(Navegador) (acaso hay otro?) y tecleamos www.website.net y nos debe de desplegar la informacion de la carpeta /home/www/prog ya se aun index.php index.html o un listado, claro esi esta permitido en nuestra configuracion default(recuerden que de ahi sacamos toda la configuración).</p>
<p>En resumen mis comandos fueron<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<em><strong>ajaxman@debianJS:~$ su<br />
Contraseña:<br />
debianJS:/home/ajaxman# cd /etc/apache2/sites-available/<br />
debianJS:/etc/apache2/sites-available# ls -la<br />
total 24<br />
drwxr-xr-x 2 root root 4096 abr 14 16:37 .<br />
drwxr-xr-x 7 root root 4096 nov  6 16:46 ..<br />
-rw-r&#8211;r&#8211; 1 root root 1428 nov  6 17:44 default<br />
-rw-r&#8211;r&#8211; 1 root root 7366 oct  1  2008 default-ssl<br />
debianJS:/etc/apache2/sites-available# cat default&gt; website<br />
debianJS:/etc/apache2/sites-available# vim website<br />
debianJS:/etc/apache2/sites-available# vim default<br />
debianJS:/etc/apache2/sites-available# a2ensite website<br />
Site prog already enabled<br />
debianJS:/etc/apache2/sites-available# cd ..<br />
debianJS:/etc/apache2# ls<br />
apache2.conf  conf.d  envvars  httpd.conf  mods-available  mods-enabled  ports.conf  sites-available  sites-enabled<br />
debianJS:/etc/apache2# cd sites-enabled/<br />
debianJS:/etc/apache2/sites-enabled# ls -la<br />
total 8<br />
drwxr-xr-x 2 root root 4096 abr 14 16:26 .<br />
drwxr-xr-x 7 root root 4096 nov  6 16:46 ..<br />
lrwxrwxrwx 1 root root   26 nov  6 16:13 000-default -&gt; ../sites-available/default<br />
lrwxrwxrwx 1 root root   23 abr 14 16:26 website -&gt; ../sites-available/website<br />
debianJS:/etc/apache2/sites-enabled# vim /etc/hosts<br />
debianJS:/etc/apache2/sites-enabled# /etc/init.d/apache2 reload</strong></em><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Creo que ya quedo, espero que les sea util y bueno ya mejore mis posts o no?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/tutorial-creando-virtual-host-de-apache-usando-linux.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>[Noticias]Microsoft invierte en la Fundación Apache!!</title>
		<link>http://www.ajaxman.net/noticiasmicrosoft-invierte-en-la-fundacion-apache.html</link>
		<comments>http://www.ajaxman.net/noticiasmicrosoft-invierte-en-la-fundacion-apache.html#comments</comments>
		<pubDate>Tue, 29 Jul 2008 04:24:57 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[No puede ser]]></category>
		<category><![CDATA[Noticias]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tecnologia]]></category>
		<category><![CDATA[WTF]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/?p=1002</guid>
		<description><![CDATA[Para salirnos un poco de la rutina (GNU/Linux Debian jaja) hoy les platicare de un post que me ha intrigado un poco, ya que es algo inesperado. Resulta que hoy me he enterado que Microsoft va a invertir en el Proyecto Apache. Se que a muchos se nos queda la cara de ¿WTF?, y eso [...]]]></description>
			<content:encoded><![CDATA[<p>Para salirnos un poco de la rutina (<strong>GNU/Linux Debian </strong>jaja) hoy les platicare de un post que me ha intrigado un poco, ya que es algo inesperado.</p>
<p style="text-align: center;"><img class="size-full wp-image-939 aligncenter" src="http://www.ajaxman.net/wp-content/uploads/2008/07/apache_display.png" alt="Apache" width="261" height="285" /></p>
<p>Resulta que hoy me he enterado que <strong>Microsoft </strong>va a invertir en el <strong>Proyecto Apache</strong>.</p>
<p>Se que a muchos se nos queda la cara de ¿<strong>WTF</strong>?, y eso es por que como es posible que <strong>Microsoft </strong>sea capaz de invertir en dicho proyecto justo cuando acaba de salir hace poco al mercado<strong> IIS 7</strong>.</p>
<p>Ahora bien si reflexionamos un poco, puede ser que al igual y como dicen en theinquirer, no sea tan descabellada la idea.</p>
<p>Si pensamos que de esta forma, se podría dar un mayor poder a <strong>Apache </strong>para poder manipular archivos <strong>Open XML de Microsoft</strong>, de esta forma <strong>Apache </strong>podría soportar facilmente y trabajar bastante bien con este tipo de archivos, y esto en resumidas cuentas daría a Microsoft mayor poder, si no revisen la película <strong>&#8220;Los piratas de Silicon Valey&#8221; </strong>y verán como <strong>Microsoft </strong>tiene sus tentaculos y hasta en la compañía de <strong>Cupertino</strong>, si ,me refiero a <strong>Apple</strong>.</p>
<p>De esta forma <strong>Microsoft</strong>, se une a <strong>Google </strong>y <strong>Yahoo </strong>como inversores en la<strong> fundación  Apache</strong>, el cual como informan en dicho blog, estaría siendo un patrocinador platinum, de esta manera estaría invirtiendo unos<strong> 60,000 Euros al año </strong>en esta fundación.</p>
<p>Ojala y no se les ocurra meter sus ideas en <strong>Apache </strong>y querer hacerse de el, ya que recordemos que <strong>Suse</strong>, hace unos meses no iba(va?) por buen camino ya que estaba dando demasiados privilegios al gigante de Redmon.</p>
<p>Vía | <a href="http://www.theinquirer.es/2008/07/28/microsoft-invierte-en-apache-que-extrano.html" target="_blank">Microsoft invierte en Apache, qué extraño</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/noticiasmicrosoft-invierte-en-la-fundacion-apache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Manual] El archivo de configuracion del servidor Apache httpd.conf</title>
		<link>http://www.ajaxman.net/manual-el-archivo-de-configuracion-del-servidor-apache-httpdconf.html</link>
		<comments>http://www.ajaxman.net/manual-el-archivo-de-configuracion-del-servidor-apache-httpdconf.html#comments</comments>
		<pubDate>Fri, 11 Jul 2008 19:47:50 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Ajaxman]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Servidores]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Codigo]]></category>
		<category><![CDATA[httpd.conf]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/?p=938</guid>
		<description><![CDATA[Lamentablemente a pesar de que había empezado bien ha postear en este mes otra vez estoy dejándolo, y culpen de eso a meneame jaja y a microsiervos entre otros, no ya en serio, si que he tenido unos días complicados, pero bueno ya pasaran, por cierto en 3 meses exactamente me caso , luego les [...]]]></description>
			<content:encoded><![CDATA[<p>Lamentablemente a pesar de que había empezado bien ha postear en este mes otra vez estoy dejándolo, y culpen de eso a meneame jaja y a microsiervos entre otros, no ya en serio, si que he tenido unos días complicados, pero bueno ya pasaran, por cierto en 3 meses exactamente me caso , luego les platicare mas de esto.</p>
<p>Bien esto les platico por que he recibido un par de <a href="http://www.ajaxman.net/186/apache-manual-de-instalacion-y-configuracion-de-apache-con-windows/">comentarios </a>que me piden que postee mi archivo de configuracion de apache el httpd.conf, pero como les comente a veces me quedo sin tiempo, por eso en hoy en una escapada que me he dado les pondré mi archivo de configuracion httpd.conf, en su configuracion para Windows.</p>
<p>Les cuento brevemente donde esta regularmente y para que sirve o vamos en pocas palabras que es este archivo con este nombre tan raro para muchos.</p>
<p style="text-align: center;">
<img src="http://www.ajaxman.net/wp-content/uploads/2008/07/apache_display.png" alt="Apache" title="Apache" width="261" height="285" class="alignnone size-full wp-image-939" />
</p>
<p>Cuando instalamos apache en windows a mano, osea sin usar Wamp o appserver o algunas de esas cosas, si seguimos el manual que postee, aqui &#8220;<a href="http://www.ajaxman.net/186/apache-manual-de-instalacion-y-configuracion-de-apache-con-windows/">Manual de instalación y configuración de Apache, Php y MySQL</a>&#8220;, y se instala Apache por default en la carpeta: <strong>C:\Archivos de programa\Apache Software Foundation\Apache2.2\conf</strong> , se crear un archivo llamado httpd.conf, el cual guarda los parámetros de la configuracion global y completa de nuestro servidor apache, en Linux regularmente se guardaria en <strong>/etc/apache2/http.conf</strong>.</p>
<p>En dicho archivo podremos instalar modulos para que funcione php, cgi&#8217;s, compresion gzip, proxies, modrewrite (para reescribir urls y en vez de tener direcciones art.php?id=1,art.php?id=2 etc, se vea como articulos/vendemos_gatos_a_domicilio, articulos_renta_de_autos, etc), SSI (es i no es l), etc.</p>
<p>Tambien dentro de este archivo podremos configurar los mimetypes, con lo cual le decimos a apache como debe de interpretar ciertos tipos de archivos, asi como posibilidad usar vhosts, configurar rutas, email del administrador, bueno en pocas palabras casi todo, lo que queramos hacer con Apache lo podemos hacer desde este archivo, a continuación les posteo el archivo es un poco grande, solo remarcare y comentare los punto importantes.</p>
<p>Cabe destacar que si deseamos hacer un comentario desde nuestro httdp.conf podemos usar la el carácter de numero o de gato como se le conoce a este (#) y a continuación el comentario.</p>
<p><strong>Archivo httpd.conf</strong><br />
Lo puse en lo siguiente por que el archivo es muy grande y deformaria mucho la pagina de inicio, <img src='http://www.ajaxman.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span id="more-938"></span></p>
<p>[Php]</p>
<p>#<br />
# This is the main Apache HTTP server configuration file.  It contains the<br />
# configuration directives that give the server its instructions.<br />
# See  for detailed information.<br />
# In particular, see<br />
#<br />
# for a discussion of each configuration directive.<br />
#<br />
# Do NOT simply read the instructions in here without understanding<br />
# what they do.  They&#8217;re here only as hints or reminders.  If you are unsure<br />
# consult the online docs. You have been warned.<br />
#<br />
# Configuration and logfile names: If the filenames you specify for many<br />
# of the server&#8217;s control files begin with &#8220;/&#8221; (or &#8220;drive:/&#8221; for Win32), the<br />
# server will use that explicit path.  If the filenames do *not* begin<br />
# with &#8220;/&#8221;, the value of ServerRoot is prepended &#8212; so &#8220;logs/foo.log&#8221;<br />
# with ServerRoot set to &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2&#8243; will be interpreted by the<br />
# server as &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2/logs/foo.log&#8221;.<br />
#<br />
# NOTE: Where filenames are specified, you must use forward slashes<br />
# instead of backslashes (e.g., &#8220;c:/apache&#8221; instead of &#8220;c:\apache&#8221;).<br />
# If a drive letter is omitted, the drive on which Apache.exe is located<br />
# will be used by default.  It is recommended that you always supply<br />
# an explicit drive letter in absolute paths to avoid confusion.</p>
<p>#<br />
# ServerRoot: The top of the directory tree under which the server&#8217;s<br />
# configuration, error, and log files are kept.<br />
#<br />
# Do not add a slash at the end of the directory path.  If you point<br />
# ServerRoot at a non-local disk, be sure to point the LockFile directive<br />
# at a local disk.  If you wish to share the same ServerRoot for multiple<br />
# httpd daemons, you will need to change at least LockFile and PidFile.<br />
#<br />
ServerRoot &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2&#8243;</p>
<p>#<br />
# Listen: Allows you to bind Apache to specific IP addresses and/or<br />
# ports, instead of the default. See also the<br />
# directive.<br />
#<br />
# Change this to Listen on specific IP addresses as shown below to<br />
# prevent Apache from glomming onto all bound IP addresses.<br />
#<br />
#Listen 12.34.56.78:80<br />
#Puerto que usara Apache<br />
Listen 80</p>
<p>#<br />
# Dynamic Shared Object (DSO) Support<br />
#<br />
# To be able to use the functionality of a module which was built as a DSO you<br />
# have to place corresponding `LoadModule&#8217; lines at this location so the<br />
# directives contained in it are actually available _before_ they are used.<br />
# Statically compiled modules (those listed by `httpd -l&#8217;) do not need<br />
# to be loaded here.<br />
#<br />
# Example:<br />
# LoadModule foo_module modules/mod_foo.so<br />
#<br />
#Modulos, en este caso es lo que usara para extender funcionalidades como por ejemplo ejecutar PHP<br />
#<br />
LoadModule actions_module modules/mod_actions.so<br />
LoadModule alias_module modules/mod_alias.so<br />
LoadModule asis_module modules/mod_asis.so<br />
LoadModule auth_basic_module modules/mod_auth_basic.so<br />
#LoadModule auth_digest_module modules/mod_auth_digest.so<br />
#LoadModule authn_alias_module modules/mod_authn_alias.so<br />
#LoadModule authn_anon_module modules/mod_authn_anon.so<br />
#LoadModule authn_dbd_module modules/mod_authn_dbd.so<br />
#LoadModule authn_dbm_module modules/mod_authn_dbm.so<br />
LoadModule authn_default_module modules/mod_authn_default.so<br />
LoadModule authn_file_module modules/mod_authn_file.so<br />
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so<br />
#LoadModule authz_dbm_module modules/mod_authz_dbm.so<br />
LoadModule authz_default_module modules/mod_authz_default.so<br />
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so<br />
LoadModule authz_host_module modules/mod_authz_host.so<br />
#LoadModule authz_owner_module modules/mod_authz_owner.so<br />
LoadModule authz_user_module modules/mod_authz_user.so<br />
LoadModule autoindex_module modules/mod_autoindex.so<br />
#LoadModule cache_module modules/mod_cache.so<br />
#LoadModule cern_meta_module modules/mod_cern_meta.so<br />
LoadModule cgi_module modules/mod_cgi.so<br />
#LoadModule charset_lite_module modules/mod_charset_lite.so<br />
#LoadModule dav_module modules/mod_dav.so<br />
#LoadModule dav_fs_module modules/mod_dav_fs.so<br />
#LoadModule dav_lock_module modules/mod_dav_lock.so<br />
#LoadModule dbd_module modules/mod_dbd.so<br />
#LoadModule deflate_module modules/mod_deflate.so<br />
LoadModule dir_module modules/mod_dir.so<br />
#LoadModule disk_cache_module modules/mod_disk_cache.so<br />
#LoadModule dumpio_module modules/mod_dumpio.so<br />
LoadModule env_module modules/mod_env.so<br />
#LoadModule expires_module modules/mod_expires.so<br />
#LoadModule ext_filter_module modules/mod_ext_filter.so<br />
#LoadModule file_cache_module modules/mod_file_cache.so<br />
#LoadModule filter_module modules/mod_filter.so<br />
#LoadModule headers_module modules/mod_headers.so<br />
#LoadModule ident_module modules/mod_ident.so<br />
#LoadModule imagemap_module modules/mod_imagemap.so<br />
LoadModule include_module modules/mod_include.so<br />
#LoadModule info_module modules/mod_info.so<br />
LoadModule isapi_module modules/mod_isapi.so<br />
#LoadModule ldap_module modules/mod_ldap.so<br />
#LoadModule logio_module modules/mod_logio.so<br />
LoadModule log_config_module modules/mod_log_config.so<br />
#LoadModule log_forensic_module modules/mod_log_forensic.so<br />
#LoadModule mem_cache_module modules/mod_mem_cache.so<br />
LoadModule mime_module modules/mod_mime.so<br />
#LoadModule mime_magic_module modules/mod_mime_magic.so<br />
LoadModule negotiation_module modules/mod_negotiation.so<br />
#LoadModule proxy_module modules/mod_proxy.so<br />
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so<br />
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so<br />
#LoadModule proxy_connect_module modules/mod_proxy_connect.so<br />
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so<br />
#LoadModule proxy_http_module modules/mod_proxy_http.so<br />
#LoadModule rewrite_module modules/mod_rewrite.so<br />
LoadModule setenvif_module modules/mod_setenvif.so<br />
#LoadModule speling_module modules/mod_speling.so<br />
#LoadModule ssl_module modules/mod_ssl.so<br />
#LoadModule status_module modules/mod_status.so<br />
#LoadModule substitute_module modules/mod_substitute.so<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
#LoadModule userdir_module modules/mod_userdir.so<br />
#LoadModule usertrack_module modules/mod_usertrack.so<br />
#LoadModule version_module modules/mod_version.so<br />
#LoadModule vhost_alias_module modules/mod_vhost_alias.so</p>
<p>#Configuracion PHp 5<br />
#Esta configuracion la agrege yo, puse las rutas de el dll de php agrege el tipo de aplicacion y donde esta el phpinidir<br />
#<br />
LoadModule php5_module &#8220;C:/PHP/php5apache2_2.dll&#8221;<br />
AddType application/x-httpd-php .php<br />
PHPIniDir &#8220;C:/PHP&#8221;</p>
<p><ifmodule !mpm_netware_module><br />
</ifmodule><ifmodule !mpm_winnt_module><br />
#<br />
# If you wish httpd to run as a different user or group, you must run<br />
# httpd as root initially and it will switch.<br />
#<br />
# User/Group: The name (or #number) of the user/group to run httpd as.<br />
# It is usually good practice to create a dedicated user and group for<br />
# running httpd, as with most system services.<br />
#<br />
User daemon<br />
Group daemon<br />
</ifmodule></p>
<p># &#8216;Main&#8217; server configuration<br />
#<br />
# The directives in this section set up the values used by the &#8216;main&#8217;<br />
# server, which responds to any requests that aren&#8217;t handled by a<br />
#  definition.  These values also provide defaults for<br />
# any  containers you may define later in the file.<br />
#<br />
# All of these directives may appear inside  containers,<br />
# in which case these default settings will be overridden for the<br />
# virtual host being defined.<br />
#</p>
<p>#<br />
# ServerAdmin: Your address, where problems with the server should be<br />
# e-mailed.  This address appears on some server-generated pages, such<br />
# as error documents.  e.g. admin@your-domain.com<br />
#<br />
# Aqui es donde podremos elejir el mail que queramos mostrar por si no aparece una pagina, o el mail del administrador de nuestro sitio<br />
# como veran yo use un mail ficticio para eviar el spam<br />
#</p>
<p>ServerAdmin admin@localhost.com.mx</p>
<p>#<br />
# ServerName gives the name and port that the server uses to identify itself.<br />
# This can often be determined automatically, but we recommend you specify<br />
# it explicitly to prevent problems during startup.<br />
#<br />
# If your host doesn&#8217;t have a registered DNS name, enter its IP address here.<br />
#<br />
#ServerName localhost:80</p>
<p>#<br />
# DocumentRoot: The directory out of which you will serve your<br />
# documents. By default, all requests are taken from this directory, but<br />
# symbolic links and aliases may be used to point to other locations.<br />
#<br />
#<br />
# Esta es la carpeta donde estaran nuestros scripts o nuestras paginas HTML, como los script php<br />
# Esta ruta puede ser cambiada por ejemplo a DocumentRoot &#8220;D:/Htdocs&#8221;, por ejemplo<br />
#<br />
DocumentRoot &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs&#8221;</p>
<p>#<br />
# Each directory to which Apache has access can be configured with respect<br />
# to which services and features are allowed and/or disabled in that<br />
# directory (and its subdirectories).<br />
#<br />
# First, we configure the &#8220;default&#8221; to be a very restrictive set of<br />
# features.<br />
#</p>
<p><directory /><br />
    Options FollowSymLinks<br />
    AllowOverride None<br />
    Order deny,allow<br />
    #Deny from all</p>
<p>#<br />
# Note that from this point forward you must specifically allow<br />
# particular features to be enabled &#8211; so if something&#8217;s not working as<br />
# you might expect, make sure that you have specifically enabled it<br />
# below.<br />
#</p>
<p>#<br />
# This should be changed to whatever you set DocumentRoot to.<br />
#Lo mismo que el anterior es el directorio donde estaran nuestros scripts, y lo pueden configurar  a su gusto simplemente cambien la ruta<br />
# como en el anterior<br />
<directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs"><br />
#<br />
# Possible values for the Options directive are &#8220;None&#8221;, &#8220;All&#8221;,<br />
# or any combination of:<br />
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews<br />
#<br />
# Note that &#8220;MultiViews&#8221; must be named *explicitly* &#8212; &#8220;Options All&#8221;<br />
# doesn&#8217;t give it to you.<br />
#<br />
# The Options directive is both complicated and important.  Please see<br />
# http://httpd.apache.org/docs/2.2/mod/core.html#options<br />
# for more information.<br />
#<br />
Options Indexes FollowSymLinks</p>
<p>#<br />
# AllowOverride controls what directives may be placed in .htaccess files.<br />
# It can be &#8220;All&#8221;, &#8220;None&#8221;, or any combination of the keywords:<br />
#   Options FileInfo AuthConfig Limit<br />
#<br />
AllowOverride None</p>
<p>#<br />
# Controls who can get stuff from this server.<br />
#<br />
#Order allow,deny<br />
Allow from all<br />
</directory></p>
<p>#<br />
# DirectoryIndex: sets the file that Apache will serve if a directory<br />
# is requested.<br />
# Aqui es donde agregaran que tipo de archivos aceptan como inicio en el directorio.<br />
# este archivo es el que mostrara apache por default cuando se accede a dicho directorio<br />
# y pueden ser varios, como en este ejemplo, ya que si no encuentra uno, buscara el segundo y el que sigue asi sucesivamente<br />
# en este caso busca index.php y si no esta buscara index.html, y si no hay mostrara el contenido de la carpeta, por lo cual les recomiendo<br />
#ampliamente que siempre creen uno de estos ya que se ve el contenido de la carpeta puede resultar preligroso<br />
#</p>
<p><ifmodule dir_module><br />
    DirectoryIndex index.php index.html<br />
</ifmodule></p>
<p>#<br />
# The following lines prevent .htaccess and .htpasswd files from being<br />
# viewed by Web clients.<br />
#</p>
<p><filesmatch "^\.ht"><br />
    Order allow,deny<br />
    Deny from all<br />
    Satisfy All<br />
</filesmatch></p>
<p>#<br />
# ErrorLog: The location of the error log file.<br />
# If you do not specify an ErrorLog directive within a<br />
# container, error messages relating to that virtual host will be<br />
# logged here.  If you *do* define an error logfile for a<br />
# container, that host&#8217;s errors will be logged there and not here.<br />
# Aqui es donde se guarda un registro de los errores que se generaron, al intentar acceder a un archivo, ojo esto no muestra errores php<br />
# o de  otro tipo solo son errores de acceso<br />
#<br />
ErrorLog &#8220;logs/error.log&#8221;</p>
<p>#<br />
# LogLevel: Control the number of messages logged to the error_log.<br />
# Possible values include: debug, info, notice, warn, error, crit,<br />
# alert, emerg.<br />
#<br />
LogLevel warn<br />
<ifmodule log_config_module><br />
#<br />
# The following directives define some format nicknames for use with<br />
# a CustomLog directive (see below).<br />
#<br />
LogFormat &#8220;%h %l %u %t \&#8221;%r\&#8221; %&gt;s %b \&#8221;%{Referer}i\&#8221; \&#8221;%{User-Agent}i\&#8221;" combined<br />
LogFormat &#8220;%h %l %u %t \&#8221;%r\&#8221; %&gt;s %b&#8221; common<br />
 </ifmodule><ifmodule logio_module><br />
      # You need to enable mod_logio.c to use %I and %O<br />
      LogFormat &#8220;%h %l %u %t \&#8221;%r\&#8221; %>s %b \&#8221;%{Referer}i\&#8221; \&#8221;%{User-Agent}i\&#8221; %I %O&#8221; combinedio<br />
    </ifmodule><br />
#<br />
# The location and format of the access logfile (Common Logfile Format).<br />
# If you do not define any access logfiles within a<br />
# container, they will be logged here.  Contrariwise, if you *do*<br />
# define per- access logfiles, transactions will be<br />
# logged therein and *not* in this file.<br />
# En este archivo se guarda un registro de todos los que accedieron a tus paginas y archivos, es muy util para la seguridad y<br />
# para contabilizar las visitas Awstats lo usa<br />
#<br />
CustomLog &#8220;logs/access.log&#8221; common</p>
<p>#<br />
# If you prefer a logfile with access, agent, and referer information<br />
# (Combined Logfile Format) you can use the following directive.<br />
#<br />
#CustomLog &#8220;logs/access.log&#8221; combined</p>
<p><ifmodule alias_module><br />
#<br />
# Redirect: Allows you to tell clients about documents that used to<br />
# exist in your server&#8217;s namespace, but do not anymore. The client<br />
# will make a new request for the document at its new location.<br />
# Example:<br />
# Redirect permanent /foo http://localhost/bar</p>
<p>#<br />
# Alias: Maps web paths into filesystem paths and is used to<br />
# access content that does not live under the DocumentRoot.<br />
# Example:<br />
# Alias /webpath /full/filesystem/path<br />
#<br />
# If you include a trailing / on /webpath then the server will<br />
# require it to be present in the URL.  You will also likely<br />
# need to provide a  section to allow access to<br />
# the filesystem path.</p>
<p>#<br />
# ScriptAlias: This controls which directories contain server scripts.<br />
# ScriptAliases are essentially the same as Aliases, except that<br />
# documents in the target directory are treated as applications and<br />
# run by the server when requested rather than as documents sent to the<br />
# client.  The same rules about trailing &#8220;/&#8221; apply to ScriptAlias<br />
# directives as to Alias.<br />
#<br />
ScriptAlias /cgi-bin/ &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin/&#8221;<br />
</ifmodule></p>
<p><ifmodule cgid_module><br />
    #<br />
    # ScriptSock: On threaded servers, designate the path to the UNIX<br />
    # socket used to communicate with the CGI daemon of mod_cgid.<br />
    #<br />
    #Scriptsock logs/cgisock<br />
</ifmodule><br />
#<br />
# &#8220;C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin&#8221; should be changed to whatever your ScriptAliased<br />
# CGI directory exists, if you have that configured.<br />
#<br />
<directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin"><br />
    AllowOverride None<br />
    Options None<br />
    Order allow,deny<br />
    Allow from all<br />
</directory><br />
#<br />
# DefaultType: the default MIME type the server will use for a document<br />
# if it cannot otherwise determine one, such as from filename extensions.<br />
# If your server contains mostly text or HTML documents, &#8220;text/plain&#8221; is<br />
# a good value.  If most of your content is binary, such as applications<br />
# or images, you may want to use &#8220;application/octet-stream&#8221; instead to<br />
# keep browsers from trying to display binary files as though they are<br />
# text.<br />
#<br />
DefaultType text/plain</p>
<p><ifmodule mime_module><br />
    #<br />
    # TypesConfig points to the file containing the list of mappings from<br />
    # filename extension to MIME-type.<br />
    #<br />
    TypesConfig conf/mime.types</p>
<p>    #<br />
    # AddType allows you to add to or override the MIME configuration<br />
    # file specified in TypesConfig for specific file types.<br />
    #<br />
    #AddType application/x-gzip .tgz<br />
    #<br />
    # AddEncoding allows you to have certain browsers uncompress<br />
    # information on the fly. Note: Not all browsers support this.<br />
    #<br />
    #AddEncoding x-compress .Z<br />
    #AddEncoding x-gzip .gz .tgz<br />
    #<br />
    # If the AddEncoding directives above are commented-out, then you<br />
    # probably should define those extensions to indicate media types:<br />
    #<br />
    AddType application/x-compress .Z<br />
    AddType application/x-gzip .gz .tgz</p>
<p>    #<br />
    # AddHandler allows you to map certain file extensions to &#8220;handlers&#8221;:<br />
    # actions unrelated to filetype. These can be either built into the server<br />
    # or added with the Action directive (see below)<br />
    #<br />
    # To use CGI scripts outside of ScriptAliased directories:<br />
    # (You will also need to add &#8220;ExecCGI&#8221; to the &#8220;Options&#8221; directive.)<br />
    #<br />
    #AddHandler cgi-script .cgi</p>
<p>    # For type maps (negotiated resources):<br />
    #AddHandler type-map var</p>
<p>    #<br />
    # Filters allow you to process content before it is sent to the client.<br />
    #<br />
    # To parse .shtml files for server-side includes (SSI):<br />
    # (You will also need to add &#8220;Includes&#8221; to the &#8220;Options&#8221; directive.)<br />
    #<br />
    #AddType text/html .shtml<br />
    #AddOutputFilter INCLUDES .shtml<br />
</ifmodule></p>
<p>#<br />
# The mod_mime_magic module allows the server to use various hints from the<br />
# contents of the file itself to determine its type.  The MIMEMagicFile<br />
# directive tells the module where the hint definitions are located.<br />
#<br />
#MIMEMagicFile conf/magic</p>
<p>#<br />
# Customizable error responses come in three flavors:<br />
# 1) plain text 2) local redirects 3) external redirects<br />
#<br />
# Some examples:<br />
#ErrorDocument 500 &#8220;The server made a boo boo.&#8221;<br />
#ErrorDocument 404 /missing.html<br />
#ErrorDocument 404 &#8220;/cgi-bin/missing_handler.pl&#8221;<br />
#ErrorDocument 402 http://localhost/subscription_info.html<br />
#</p>
<p>#<br />
# EnableMMAP and EnableSendfile: On systems that support it,<br />
# memory-mapping or the sendfile syscall is used to deliver<br />
# files.  This usually improves server performance, but must<br />
# be turned off when serving from networked-mounted<br />
# filesystems or if support for these functions is otherwise<br />
# broken on your system.<br />
#<br />
#EnableMMAP off<br />
#EnableSendfile off</p>
<p># Supplemental configuration<br />
#<br />
# The configuration files in the conf/extra/ directory can be<br />
# included to add extra features or to modify the default configuration of<br />
# the server, or you may simply copy their contents here and change as<br />
# necessary.</p>
<p># Server-pool management (MPM specific)<br />
#Include conf/extra/httpd-mpm.conf</p>
<p># Multi-language error messages<br />
#Include conf/extra/httpd-multilang-errordoc.conf</p>
<p># Fancy directory listings<br />
#Include conf/extra/httpd-autoindex.conf</p>
<p># Language settings<br />
#Include conf/extra/httpd-languages.conf</p>
<p># User home directories<br />
#Include conf/extra/httpd-userdir.conf</p>
<p># Real-time info on requests and configuration<br />
#Include conf/extra/httpd-info.conf</p>
<p># Virtual hosts<br />
#Include conf/extra/httpd-vhosts.conf</p>
<p># Local access to the Apache HTTP Server Manual<br />
#Include conf/extra/httpd-manual.conf</p>
<p># Distributed authoring and versioning (WebDAV)<br />
#Include conf/extra/httpd-dav.conf</p>
<p># Various default settings<br />
#Include conf/extra/httpd-default.conf</p>
<p># Secure (SSL/TLS) connections<br />
#Include conf/extra/httpd-ssl.conf<br />
#<br />
# Note: The following must must be present to support<br />
#       starting without SSL on platforms with no /dev/random equivalent<br />
#       but a statically compiled-in mod_ssl.<br />
#<br />
<ifmodule ssl_module><br />
SSLRandomSeed startup builtin<br />
SSLRandomSeed connect builtin<br />
</ifmodule><br />
[/Php]</p>
<p>Un poco extenso pero espero que les haya sido útil, sugerencias y preguntas, en los comentarios</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/manual-el-archivo-de-configuracion-del-servidor-apache-httpdconf.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[Ajax] Jaxer, ejecutando Ajax y Javascript en el servidor</title>
		<link>http://www.ajaxman.net/ajax-jaxer-ejecutando-ajax-y-javascript-en-el-servidor.html</link>
		<comments>http://www.ajaxman.net/ajax-jaxer-ejecutando-ajax-y-javascript-en-el-servidor.html#comments</comments>
		<pubDate>Fri, 25 Jan 2008 06:05:20 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Ajaxman]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Jaxer]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Noticias]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Servidores]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/543/ajax-jaxer-ejecutando-ajax-y-javascript-en-el-servidor/</guid>
		<description><![CDATA[En muchos blogs, he escuchado hablar sobre Jaxer, asi que, como sabran que me encanta programar en Javascript, les voy a platicar si es que no se han enterado sobre Jaxer. ¿Que demonios es Jaxer? Jaxer es un servidor ajax el cual nos permitira ejecutar aplicaciones Javascript dentro del servidor (Server-Side), este servidor fue creado [...]]]></description>
			<content:encoded><![CDATA[<p>En muchos blogs, he escuchado hablar sobre <strong>Jaxer</strong>, asi que, como sabran que me encanta programar en <a href="http://www.ajaxman.net/tag/javascript/">Javascript</a>, les voy a platicar si es que no se han enterado sobre Jaxer.</p>
<p><img src="http://www.ajaxman.net/wp-content/uploads/2008/01/aptana-jaxer.png" alt="Jaxer Javascript web server" /></p>
<p><strong>¿Que demonios es Jaxer?</strong><br />
Jaxer es un servidor ajax el cual nos permitira ejecutar aplicaciones Javascript dentro del servidor (Server-Side), este servidor fue creado por los mismos desarrolladores de el IDE Aptana.</p>
<p>¿Y de que nos sirve ejecutar <a href="http://www.ajaxman.net/tag/javascript/">Javascript </a>en el servidor?</p>
<p>Bueno, recordemos que hace años Javascript era un lenguaje, que practicamente estaba por desaparecer, y solo servia para la validacion de formularios, sin embargo gracias a la llegada de Ajax, el mundo cambio la forma de ver a <a href="http://www.ajaxman.net/tag/javascript/">Javascript</a>, como una herramienta extra a verlo de forma necesaria e implementar nuevas soluciones con esta valiosisima herramienta.</p>
<p>Imaginemos entonces, cuanto a crecido el mundo <a href="http://www.ajaxman.net/tag/ajax/">Ajax</a>-<a href="http://www.ajaxman.net/tag/javascript/">Javascript</a>, tanto que hoy en dia podemos encontrar juegos desarrollados con este lenguaje(precarios pero algo es algo), animaciones, librerias, Frameworks, he inclusive hasta sistemas que emulan ser un verdadero Sistema Operativo(WEB &#8211; OS).</p>
<p>Lo mas avanzado sin duda que hemos visto ultimamente desarrollado con Javascript ha sido la implementacion de Ajax, Desarrollo de Juegos, Web-Os, Paginas Offline que se almacenan en una base de datos embedida(<a href="http://gears.google.com/">Google Gears)</a>, etc.</p>
<p>Entonces si Javascript ha crecido tanto en tan poco tiempo, imaginemos que pasaria si se ejecutara en el servidor, sin duda las posibilidades serian muchas.</p>
<p>Bueno ya sabemos para que es, que es y sus ventajas(creo), ahora vayamos a ver como funciona.</p>
<p><strong>Jaxter trabaja como un servidor el cual esta implementado bajo Apache Web Server.</strong></p>
<p>Lo primero que haremos sera ir a bajar el servidor web Jaxer en la siguiente direccion Web <a href="http://www.aptana.com/jaxer/">http://www.aptana.com/jaxer/</a>, y lo bajamos a nuestro equipo.</p>
<p>Nota: Existen versiones para descargar tanto en Windows, Linux  y Mac.</p>
<p>Una vez descargado lo descomprimimos, y ya que lo hemos descomprimido ejecutamos el archivo  <strong>configure FireWall.exe</strong>, para que nos permita configurar el puerto donde vamos a correr nuestro servidor, que por default correra en el puerto 8081.</p>
<p><img src="http://www.ajaxman.net/wp-content/uploads/2008/01/configure-firewall-aptana-jaxter.PNG" alt="" /></p>
<p>Ahora ejecutamos, el archivo (en caso de windows) <strong>StartServers.bat</strong> el cual (para los curiosos) contiene lo siguiente.<br />
<span id="more-543"></span></p>
<pre class="brush: java; title: ; notranslate">
@echo off

rem
rem This batch file is part of the Windows portable Jaxer package.
rem It launches JaxerManager and, if present, the Apache web server.
rem If you create a Windows shortcut to this file, be sure the shortcut
rem has its &quot;Start in&quot; value set to the folder containing this file.
rem
rem
set JAXER_APACHE_PORT=8081
rem Note: MySQL is neither packaged nor started by default
set JAXER_MYSQL_PORT=4417
set JAXER_WEB_PORT=5370
set JAXER_COMMAND_PORT=5371
set JAXER_MIN_PROCESSES=3
set JAXER_MAX_PROCESSES=10
set NO_JAXER_SPLASH=1
set JAXER_LOGFILE=file://%CD%\logs\jaxer.log
set JAXER_TEMP=file://%CD%\temp
set ANCHOR=%~sp0
cd %ANCHOR%

if &quot;%~1&quot;==&quot;&quot; goto start_all
if &quot;%~1&quot;==&quot;start&quot; goto start_all
if &quot;%~1&quot;==&quot;stop&quot; goto stop_all
goto show_usage

:start_all
title Start Jaxer
if not exist data   mkdir data
if not exist temp	mkdir temp
if not exist public mkdir public
if exist public\favicon.ico goto redirect
if exist jaxer\default_public\favicon.ico copy jaxer\default_public\favicon.ico public\favicon.ico 1&gt; nul
:redirect
if exist public\index.html.redirect goto logs
if exist jaxer\default_public\index.html.redirect copy jaxer\default_public\index.html.redirect public\index.html.redirect 1&gt; nul
:logs
if not exist logs   mkdir logs
if not exist local_jaxer mkdir local_jaxer
if not exist local_jaxer\conf mkdir local_jaxer\conf
if exist local_jaxer\conf\config.js goto configlog
if exist jaxer\default_local_jaxer\conf\config.js copy jaxer\default_local_jaxer\conf\config.js local_jaxer\conf\config.js 1&gt; nul
:configlog
if exist local_jaxer\conf\configLog.js goto routes
if exist jaxer\default_local_jaxer\conf\configLog.js copy jaxer\default_local_jaxer\conf\configLog.js local_jaxer\conf\configLog.js 1&gt; nul
:routes
if exist local_jaxer\conf\configRoutes.js goto extensions
if exist jaxer\default_local_jaxer\conf\configRoutes.js copy jaxer\default_local_jaxer\conf\configRoutes.js local_jaxer\conf\configRoutes.js 1&gt; nul
:extensions
if not exist local_jaxer\extensions mkdir local_jaxer\extensions
if not exist mysql\bin\mysqld.exe goto start_apache
:init_mysql
if exist data\mysql goto start_mysql
echo  ___________________________________________
echo ^|                                           ^|
echo ^| This is the first use of this MySQL...    ^|
echo ^|                                           ^|
echo ^| Creating the data directory               ^|
echo ^|___________________________________________^|
echo.
mkdir data\mysql
xcopy mysql\data_blank data /s
:start_mysql
echo  _____________________________________
echo ^|                                     ^|
echo ^| Starting MySQL...                   ^|
echo ^|_____________________________________^|
echo.
start /b mysql\bin\mysqld --no-defaults --port=%JAXER_MYSQL_PORT% --standalone --console --datadir=&quot;%ANCHOR%/data&quot; --log-error=logs/mysql_error.log 1&gt; nul
:start_apache
if not exist Apache22\bin\httpd.exe goto show_jaxermanager_only
echo  _____________________________________
echo ^|                                     ^|
echo ^| Starting JaxerManager and Apache... ^|
echo ^|_____________________________________^|
echo.
start /b Apache22\bin\httpd
echo.
goto start_jaxermanager
:show_jaxermanager_only
echo  _____________________________________
echo ^|                                     ^|
echo ^| Starting JaxerManager...            ^|
echo ^|_____________________________________^|
echo.
:start_jaxermanager
cd jaxer
start /b StartJaxer.bat start 1&gt; nul
cd ..
if not exist Apache22\bin\httpd.exe goto ready
echo  ^*^*^* BROWSE TO HERE: ^-^-^&gt;  http://localhost:%JAXER_APACHE_PORT%/aptana/
echo.
:ready
if not &quot;%~1&quot;==&quot;&quot; goto done
echo  _____________________________________
echo ^|                                     ^|
echo ^| Hit any key to stop and exit        ^|
echo ^|_____________________________________^|
echo.
pause &gt; nul

:stop_all
if not exist mysql\bin\mysqladmin.exe goto stop_apache
mysql\bin\mysqladmin --port=%JAXER_MYSQL_PORT% -u root shutdown
:stop_apache
if not exist Apache22\bin\httpd.exe goto stop_jaxer
taskkill /f /im httpd.exe
:stop_jaxer
cd jaxer
start /b StartJaxer.bat exit
cd ..
if not &quot;%~1&quot;==&quot;&quot; goto done
exit

:show_usage
title Usage
echo.
echo usage: StartServers [start^|stop]

:done
</pre>
<p>Como vemos desde este archivo podemos configurar los servidores que deseamos instalar asi como tambien, se puede especificar los puertos a usar y/o servicios.</p>
<p><img src="http://www.ajaxman.net/wp-content/uploads/2008/01/jaxter-server-start.PNG" alt="" /></p>
<p>Y por ultimo para ver el servidor en funcionamiento, deberemos abrir la siguiente direccion en nuestro navegador <strong><a href="http://localhost:8081/aptana/">http://localhost:8081/aptana/</a>/strong&gt;</strong></p>
<p><strong><img src="http://www.ajaxman.net/wp-content/uploads/2008/01/aptana-jaxer_server.png" alt="" /></strong></p>
<p><strong>Ahi veremos ejemplos como una chat, entre otros,  los cuales estan dentro de la carpeta *NUESTRO_PATH/Aptana Jaxer/jaxer/aptana/samples, en donde NUESTRO_PATH es la carpeta </strong><strong>Jaxer_package_withApache</strong> donde descomprimimos nuestro servidor.</p>
<p>Pueden ver y jugar con estos ejemplos para ver cuantas cosas podemos aprender, con esta pequeña introduccion hemos visto que Javascript tiene uan gran potencial actual y futuro en el desarrollo de aplicaciones Web.</p>
<p>Basado en el articulo de <a href="http://ejohn.org/blog/server-side-javascript-with-jaxer/">Jhon Resig &#8211;  Server-Side JavaScript with Jaxer(ing)</a><br />
Y de Andres Nieto | <a href="http://www.anieto2k.com/2008/01/23/javascript-en-el-servidor-con-jaxer/">Javascript en el servidor con Jaxer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/ajax-jaxer-ejecutando-ajax-y-javascript-en-el-servidor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modrewrite Parte 1</title>
		<link>http://www.ajaxman.net/modrewrite-parte-1.html</link>
		<comments>http://www.ajaxman.net/modrewrite-parte-1.html#comments</comments>
		<pubDate>Fri, 21 Sep 2007 16:23:02 +0000</pubDate>
		<dc:creator>Ajaxman</dc:creator>
				<category><![CDATA[Ajaxman]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[Modrewrite]]></category>

		<guid isPermaLink="false">http://www.ajaxman.net/269/modrewrite-parte-1/</guid>
		<description><![CDATA[Recientemente tuve problemas con los permalinks, el modrewrite y el .htaccess, y poste una solución de este tema (con wordpress). Sin embargo me surgió una duda, que pasa si ustedes desean aplicar modrewrite a un sitio web que no utilice wordpress como motor CMS, sin no construida directamente sobre php o alguna otra plataforma. Resumiendo [...]]]></description>
			<content:encoded><![CDATA[<p>Recientemente tuve problemas con los permalinks, el modrewrite y el .htaccess, y poste una solución de este tema (con wordpress).</p>
<p>Sin embargo me surgió una duda, que  pasa si ustedes desean aplicar modrewrite a un sitio web que no utilice wordpress como motor CMS, sin no construida directamente sobre php o alguna otra plataforma.</p>
<p>Resumiendo los pasos vamos a aprender a usar modrewrite lo mejor que podamos, por cierto voy a basarme en un articulo que hace tiempo publico IBM <strike>No apache</strike> que esta muy bueno, digamos que hare una especie de traduccion y tambien mejora de ese articulo.</p>
<p>Bueno ya vayamos al grano.</p>
<p><strong>¿Que es MODREWRITE?</strong></p>
<p>Modrewrite es una manera es reescribir las url en formas mas amigables tanto como para el usuario, como para que los buscadores nos indexen mejor.</p>
<p>Imaginemos el siguiente ejemplo, tenemos la siguiente direccion</p>
<blockquote><p> www.miweb.com/index.php?articulo=12<br />
www.miweb.com/index.php?articulo=11<br />
www.miweb.com/index.php?articulo=15</p></blockquote>
<p>Para todos seria difícil recordar cual articulo nos gusto ademas de que los buscadores como google quizá, pensarían que se trata de una sola pagina y no de 3 diferentes.</p>
<p>Sin duda se vería mejor de la siguiente manera.</p>
<blockquote><p>www.miweb.com/articulo/12/javascript<br />
www.miweb.com/articulo/11/xul<br />
www.miweb.com/articulo/15/python</p></blockquote>
<p>Bueno pues de esto trata modrewrite, ahora veamos como empezar a implementarlo.</p>
<p><span class="imp">En estos ejemplos usare Apache y Php y expresiones regulares</span></p>
<p>Si no saben expresiones regulares no se preocupen yo les ayudare.</p>
<p><span class="nocommentsadd">Es recomendable que lo hagan lo puedan hacer con Vhost, pero no necesario</span></p>
<p>Empecemos</p>
<p><strong>Primero hay que activar el modulo en el servidor apache</strong><br />
<span id="more-269"></span></p>
<p>Esto se hace desde el httpd.conf el cual normalmente lo encontraremos en linux debe de estar en  <strong>/etc/apache2/httpd.conf</strong> y en windows en <strong>C:\Archivos de programa\Apache Software Foundation\Apache2.2\conf\httpd.conf</strong>.</p>
<p>Buscamos la siguientes lineas</p>
<p># Dynamic Shared Object (DSO) Support<br />
#<br />
# To be able to use the functionality of a module which was built as a DSO you<br />
# have to place corresponding `LoadModule&#8217; lines at this location so the<br />
# directives contained in it are actually available _before_ they are used.<br />
# Statically compiled modules (those listed by `httpd -l&#8217;) do not need<br />
# to be loaded here.<br />
#<br />
# Example:<br />
# LoadModule foo_module modules/mod_foo.so<br />
#<br />
&#8230;&#8230;</p>
<p>Hay una lista de modulos, para usarlos simplemente descomenten el modulo y reinicien apache</p>
<p>#LoadModule rewrite_module modules/mod_rewrite.so #esta asi<br />
&#8230;&#8230;.<br />
&#8230;&#8230;..<br />
LoadModule rewrite_module modules/mod_rewrite.so #Quedaria asi<br />
&#8230;&#8230;</p>
<p>Reiniciamos apache, y listo con esto ya tendremos cargado el modulo</p>
<p>Ahora hagamos una prueba hagamos el siguiente archivo ejemplo.php</p>
<p>var_dump($_GET);// nos permitira saber que variables recibimos por get</p>
<p>?&gt;</p>
<p>y lo guardamos en nuestro DocummentRoot, para ver que funciona vamos a nuestro navegador y teclamos al siguiente direccion</p>
<p><strong>http://localhost/ejemplo.php?id=154</strong>, el Id es cualquiera</p>
<p>Y veremos algo asi.</p>
<p>&#8230;<br />
array(1) { ["id"]=&gt;  string(3) &#8220;145&#8243; }<br />
&#8230;</p>
<p>Ahora hacemos nuestras reglas de mod rewrite las cuales se agregan a nuestro httpd.conf dentro de la siguientes lineas</p>
<p><directory><br />
..<br />
&#8230;<br />
&#8230;<br />
</directory></p>
<p>y Agregamos lo siguiente</p>
<p><strong>RewriteEngine On</strong></p>
<p><strong>RewriteRule /articulo/12/javascript/$ /ejemplo.php?Id=12<br />
RewriteRule /articulo/11/xul/$ /ejemplo.php?Id=11<br />
RewriteRule /articulo/15/python$ /ejemplo.php?Id=15<br />
</strong></p>
<p>Veamos que significa la primer linea</p>
<p><strong>RewriteEngine On</strong>, con esto le decimos que el modrewrite se ponga en modo activo, si no ponemos esta linea pues simplemente no podran usar modrewrite.</p>
<p><strong>RewriteRule /articulo/12/javascript/$ /ejemplo.php?Id=12</strong>, Con esto decimos todo lo que recibas con la dirección<br />
<strong>/articulo/12/javascript/</strong>  mandalo a <strong>/ejemplo.php?Id=12</strong>, y listo el signo de pesos, es para indicar el fin de la regla.</p>
<p>Sin embargo que ¿pasaría si tenemos 500 ó mas artículos? imagínense tener que copiar todo,</p>
<p>Entonces tenemos que recurrir a las expresiones regulares, por hoy no las tocaremos a fondo, simplemente las ocuparemos esporadicamente, veamos como.</p>
<p>Formemos la expresión regular.</p>
<ul>
<li> Usaremos le numero para indicarle que id es el que necesita, el texto de momento no nos importa.</li>
<li>  Hay que decirle que todo lo que reciba que sean números no guarde en una variable</li>
<li>  Tambien hay que indicarle que pueden ser varios números</li>
</ul>
<p>Para indicarle que pueden ser números hay que hacerlo de la siguiente forma [0-9], le decimos que pueden ser de cero a nueve, lo mismo aplica para las letras, solo que en ese caso hay que decirle si son mayusculas o minusculas, y ademas le especificamos que puede repetirse una o mas veces un numero de la siguiente forma  [0-9]+ y por ultimo para guardarlo en una variable, lo encerramos entre paréntesis y quedaría así ([0-9]+)</p>
<p>Y por ultimo para pasárselo a nuestro link real lo pasamos mediante un signo de pesos seguido del numero de variable.<br />
Entonces quedaría así.</p>
<p><strong>RewriteRule /articulo/([a-9]+)/([a-zA-Z]+)/$ /ejemplo.php?Id=$1</strong></p>
<p>La segunda variable que esta entre parentesis, no la ocupamos es simplemente para que nos quede mejor,  de esta forma nos quedaría nuestro modrewrite de asi.</p>
<p>&#8230;..<br />
RewriteEngine On</p>
<p>RewriteRule /articulo/([a-9]+)/([a-zA-Z]+)/$ /ejemplo.php?Id=$1<br />
&#8230;</p>
<p>Listo, ya estamos usando modrewrite, por cierto recuerden guardar el archivo httpd.conf y reiniciar el apache cada vez que hagan un cambio, cualquier duda déjenla en los comentarios con gusto las responderé.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxman.net/modrewrite-parte-1.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.472 seconds -->

