msgbartop
Tips de administración de servidores y herramientas Web
msgbarbottom

Creando un rewrite en jBoss  

junio 16, 2010 Publicado en Admin-tips, Configuración, InfraEstructura con 31 Comentarios



jboss rewriteJBoss viene con un modulo que le permite configurar rewrites, de la misma manera en que los hace Apache con su modulo mod_rewrite.

A continuación describo los pasos para configurar Jboss y crear una regla de rewrite para nuestro sitio web:

Configurar el perfil de jboss para que cargue el modulo de rewrite

Debemos modificar el archivo server.xml, para este caso lo vamos a hacer a nivel de <host>, el archivo se encuentra en:

<jboss>/server/default/deploy/jbossweb.sar/server.xml

y debemos agregar la siguiente linea a nivel de la seccion <host>:

<Valve className=”org.jboss.web.rewrite.RewriteValve” />

Crear el archivo que tendrá los rewrite

como es a nivel de <host> se debe colocar en la carpeta de configuracion del profile de jboss asi <jboss>/server/conf/[engine_name]/[host_name] :

mkdir -p /<jboss>/server/default/conf/jboss.web/localhost

para este caso engine_name es jboss.web y host_name es localhost.

Ahora creamos el archivo rewrite.properties en la carpeta que creamos en el paso anterior y configuramos nuestras reglas de rewrite.

RewriteCond  %{HTTP_HOST}       ^admin.tusitio.com$
RewriteCond  %{REQUEST_URI}     !^/js/(.*)$
RewriteCond  %{REQUEST_URI}     !^/css/(.*)$
RewriteRule  ^/(.*)$            /admin/$1  [L]

con la regla anterior estamos diciendo que todos los request que sean de admin.tusitio.com, que no pertenezcan a la carpeta /js o a la carpeta /css, los redireccione a la carpeta /admin, manteniendo el resto de la url, por ejemplo si hacemos el request admin.tusitio.com/estadisticas/index.html, lo que jboss realmente nos va a mostrar es el archivo admin.tusitio.com/admin/estadisticas/index.html
En otro post veremos con mas detalle la configuracion de rewrites

Tags: , , ,

Comentarios

  1. |

    Pretty site, would actually like to see a bit a lot more content though! Then again my puppet web site hasn’t much both – Excellent publish anyway, additional your XML feed! Cheers

  2. |

    Hey, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

  3. |

    I admit, I have not been on this webpage in a long time… however it was another pleasure to see It is such an essential topic and ignored by so numerous, even professionals. I thank you to help making people more aware of possible issueExcellent stuff as typical.

  4. |

    Delighted i stubled onto this amazing site, Another good site is Dbol will be sure to save it so i can browse regularly.

  5. |

    Delighted i stubled onto this amazing site, Another good site is Dbol will be sure to save it so i can browse regularly.

  6. |

    Bookmarking now cheers, a good fast read.

  7. |

    Lucky i uncovered this site, Another good site is Dbol will be sure to bookmark it so i can come by routinely.

  8. |

    Hey, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

  9. |

    This is my 1st time I have visited your internet site. I observed a great deal of interesting things in your blog site. From the tons of comments on your posts, I guess I am not the only 1! preserve up the good perform.

  10. |

    makeup brushes is good is excellent

  11. |

    Once I came over to this article I can only look at part of it, is this my net internet browser or the internet web site? Should I reboot?

  12. |

    Top! Please continue to publish accurate data for the player, bring good luck! Thank you!!!!!!!!!!

  13. |

    Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I’m more of a visual learner,I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I’ve added you guys to my blogroll. This is a great article thanks for sharing this informative information.. I will visit your blog regularly for some latest post.

  14. |

    This is a fantastic site, would you be interested in doing an interview regarding how you developed it? If so e-mail me!

  15. |

    I believed it was going to be some boring old post, however it actually compensated for my time. I’ll publish a hyperlink to this web page http://www.niquepa.com/2010/06/creando-un-rewrite-en-jboss/ on my blog. I am certain my visitors will discover that very useful.

  16. |

    Your website does not show up properly on my iphone 3gs – you might want to try and fix that

  17. |

    I must admit that this is one great insight. It surely gives a company the opportunity to get in on the ground floor and really take part in creating something special and tailored to their needs. wajadud555

  18. |

    Do you guys have a facebook or myspace fan web page? I looked for for one on twitter but couldn’t discover it, I’d love to become a fan!

  19. |

    I tried to submit a comment previously, but it has not shown up. I believe your spam filter may possibly be broken?

  20. |

    Terrific write-up, I have bookmarked this site so hopefully I will discover a lot more on this topic in the foreseeable future!

  21. |

    This is a really excellent read for me, should admit that you’re among the finest bloggers I ever saw. Thanks for publishing this enlightening post Creando un rewrite en jBoss | Infraestructura y Servicios. Carry on the nice work, I have added you to my blogroll.

  22. |

    Nice site, nice and easy on the eyes and great content too.

  23. |

    Took my time to read all of the feedback, but I actually enjoyed the article Creando un rewrite en jBoss | Infraestructura y Servicios. It proved to be very useful to me and I am positive to all the commenters here! I’ll subscribe to your feed, please keep writing!

  24. |

    I needed to say that it’s good to know that somebody discussed this as I had problems finding the same information elsewhere. This is the first place that gave me the info. Thank you.

  25. |

    Creando un rewrite en jBoss | Infraestructura y Servicios is a high quality post. I would like to write like this too – taking time and actual effort to make a great post… but what can I say… I procrastinate alot and never seem to get anything done.

  26. |

    Is your RSS feed working? I tried to subscribe and it wouldn’t load…

  27. |

    Creando un rewrite en jBoss | Infraestructura y Servicios was a fairly good post. I just stumbled upon your blog and needed to say that I’ve really loved reading your blog posts. Any way I will be grabbing your feed and I hope you post again soon.

  28. |

    Hey, is your RSS button working?

  29. |

    Keep working on more info for your blog,great job!

  30. |

    Heya this is a excellent post. I’m going to email this to my friends. I stumbled on this while exploring on aol I’ll be sure to come back. thanks for sharing.

  31. |

    Good day, i have just book marked this particular article on my twitter account and got a whole lot of positive responses! I feel you are definitely doing a great job with your weblog. I have got a single question though, this is a blogengine blog site correct?